From eba4f15bbada44201b37b1bf3edcb31d1371f14e Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Mon, 27 Apr 2026 19:02:34 +0200 Subject: [PATCH] :rewind: Backport transit and plugins hardening compatibility issue From staging --- frontend/src/app/main.cljs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/frontend/src/app/main.cljs b/frontend/src/app/main.cljs index 6264b869d8..7bcbd1469f 100644 --- a/frontend/src/app/main.cljs +++ b/frontend/src/app/main.cljs @@ -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.