Backport transit and plugins hardening compatibility issue

From staging
This commit is contained in:
Andrey Antukh 2026-04-27 19:02:34 +02:00
parent 839754715a
commit eba4f15bba

View File

@ -8,6 +8,8 @@
(:require
[app.common.data.macros :as dm]
[app.common.logging :as log]
[app.common.time :as ct]
[app.common.transit :as t]
[app.common.types.objects-map]
[app.config :as cf]
[app.main.data.auth :as da]
@ -100,6 +102,15 @@
(defn ^:export init
[options]
;; WORKAROUND: we set this really not usefull property for signal a
;; sideffect and prevent GCC remove it. We need it because we need
;; to populate the Date prototype with transit related properties
;; before SES hardning is applied on loading MCP plugin
(unchecked-set js/globalThis "penpotStartDate"
(-> (ct/now)
(t/encode-str)
(t/decode-str)))
;; Before initializing anything, check if the browser has loaded
;; stale JS from a previous deployment. If so, do a hard reload so
;; the browser fetches fresh assets matching the current index.html.