0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-08 07:50:43 -05:00

🐛 Fix release build issue

Caused by an unsolved corner case of the interaction of code-move
between modules and types defined with reify. Mainly moves some
definition of protocol to one module and the definition of the type
to other, and as the definition of the type is conditional to the
function execution, the whole build fails to initialize because the
second protocol extension implementation can't find the type initialized
on application startup.
This commit is contained in:
Andrey Antukh 2024-03-20 16:12:00 +01:00
parent dc39a14c7c
commit 526f6ef841
2 changed files with 16 additions and 17 deletions

View file

@ -28,9 +28,7 @@
[app.common.types.shape-tree :as ctst]
[app.common.types.shape.layout :as ctl]
[app.config :as cfg]
[app.main.features :as features]
[app.main.fonts :as fonts]
[app.main.store :as st]
[app.main.ui.context :as muc]
[app.main.ui.shapes.bool :as bool]
[app.main.ui.shapes.circle :as circle]
@ -46,7 +44,6 @@
[app.main.ui.shapes.svg-raw :as svg-raw]
[app.main.ui.shapes.text :as text]
[app.main.ui.shapes.text.fontfaces :as ff]
[app.main.worker :as wrk]
[app.util.dom :as dom]
[app.util.http :as http]
[app.util.strings :as ust]
@ -671,16 +668,3 @@
(do
(l/warn :msg "imposter shape is nil")
(rx/empty)))))
(defn render-thumbnail
[file-id revn]
(->> (wrk/ask! {:cmd :thumbnails/generate-for-file
:revn revn
:file-id file-id
:features (features/get-team-enabled-features @st/state)})
(rx/mapcat (fn [{:keys [fonts] :as result}]
(->> (fonts/render-font-styles fonts)
(rx/map (fn [styles]
(assoc result
:styles styles
:width 252))))))))

View file

@ -13,6 +13,7 @@
[app.common.logging :as log]
[app.main.data.dashboard :as dd]
[app.main.data.messages :as msg]
[app.main.features :as features]
[app.main.fonts :as fonts]
[app.main.rasterizer :as thr]
[app.main.refs :as refs]
@ -26,6 +27,7 @@
[app.main.ui.dashboard.placeholder :refer [empty-placeholder loading-placeholder]]
[app.main.ui.hooks :as h]
[app.main.ui.icons :as i]
[app.main.worker :as wrk]
[app.util.color :as uc]
[app.util.dom :as dom]
[app.util.dom.dnd :as dnd]
@ -47,10 +49,23 @@
(->> (rp/cmd! :create-file-thumbnail params)
(rx/map :uri))))
(defn render-thumbnail
[file-id revn]
(->> (wrk/ask! {:cmd :thumbnails/generate-for-file
:revn revn
:file-id file-id
:features (features/get-team-enabled-features @st/state)})
(rx/mapcat (fn [{:keys [fonts] :as result}]
(->> (fonts/render-font-styles fonts)
(rx/map (fn [styles]
(assoc result
:styles styles
:width 252))))))))
(defn- ask-for-thumbnail
"Creates some hooks to handle the files thumbnails cache"
[file-id revn]
(->> (render/render-thumbnail file-id revn)
(->> (render-thumbnail file-id revn)
(rx/mapcat thr/render)
(rx/mapcat (partial persist-thumbnail file-id revn))))