mirror of
https://github.com/penpot/penpot.git
synced 2025-01-08 07:50:43 -05:00
🎉 Add feature flag for wasm render
This commit is contained in:
parent
03acfc2b3c
commit
e3268739ed
3 changed files with 11 additions and 7 deletions
|
@ -51,7 +51,8 @@
|
||||||
"layout/grid"
|
"layout/grid"
|
||||||
"plugins/runtime"
|
"plugins/runtime"
|
||||||
"design-tokens/v1"
|
"design-tokens/v1"
|
||||||
"text-editor/v2"})
|
"text-editor/v2"
|
||||||
|
"render-wasm/v1"})
|
||||||
|
|
||||||
;; A set of features enabled by default
|
;; A set of features enabled by default
|
||||||
(def default-features
|
(def default-features
|
||||||
|
@ -67,7 +68,8 @@
|
||||||
(def frontend-only-features
|
(def frontend-only-features
|
||||||
#{"styles/v2"
|
#{"styles/v2"
|
||||||
"plugins/runtime"
|
"plugins/runtime"
|
||||||
"text-editor/v2"})
|
"text-editor/v2"
|
||||||
|
"render-wasm/v1"})
|
||||||
|
|
||||||
;; Features that are mainly backend only or there are a proper
|
;; Features that are mainly backend only or there are a proper
|
||||||
;; fallback when frontend reports no support for it
|
;; fallback when frontend reports no support for it
|
||||||
|
@ -84,9 +86,7 @@
|
||||||
"fdata/pointer-map"
|
"fdata/pointer-map"
|
||||||
"layout/grid"
|
"layout/grid"
|
||||||
"fdata/shape-data-type"
|
"fdata/shape-data-type"
|
||||||
"plugins/runtime"
|
"design-tokens/v1"}
|
||||||
"design-tokens/v1"
|
|
||||||
"text-editor/v2"}
|
|
||||||
(into frontend-only-features)))
|
(into frontend-only-features)))
|
||||||
|
|
||||||
(sm/register! ::features
|
(sm/register! ::features
|
||||||
|
@ -108,6 +108,7 @@
|
||||||
:feature-plugins "plugins/runtime"
|
:feature-plugins "plugins/runtime"
|
||||||
:feature-design-tokens "design-tokens/v1"
|
:feature-design-tokens "design-tokens/v1"
|
||||||
:feature-text-editor-v2 "text-editor/v2"
|
:feature-text-editor-v2 "text-editor/v2"
|
||||||
|
:feature-render-wasm "render-wasm/v1"
|
||||||
nil))
|
nil))
|
||||||
|
|
||||||
(defn migrate-legacy-features
|
(defn migrate-legacy-features
|
||||||
|
|
|
@ -110,8 +110,10 @@
|
||||||
(when *assert*
|
(when *assert*
|
||||||
(->> (rx/from cfeat/no-migration-features)
|
(->> (rx/from cfeat/no-migration-features)
|
||||||
;; text editor v2 isn't enabled by default even in devenv
|
;; text editor v2 isn't enabled by default even in devenv
|
||||||
|
;; wasm render v1 isn't enabled by default even in devenv
|
||||||
(rx/filter #(not (or (contains? cfeat/backend-only-features %)
|
(rx/filter #(not (or (contains? cfeat/backend-only-features %)
|
||||||
(= "text-editor/v2" %)
|
(= "text-editor/v2" %)
|
||||||
|
(= "render-wasm/v1" %)
|
||||||
(= "design-tokens/v1" %))))
|
(= "design-tokens/v1" %))))
|
||||||
(rx/observe-on :async)
|
(rx/observe-on :async)
|
||||||
(rx/map enable-feature))))
|
(rx/map enable-feature))))
|
||||||
|
|
|
@ -10,12 +10,13 @@
|
||||||
[app.common.data.macros :as dm]
|
[app.common.data.macros :as dm]
|
||||||
[app.common.types.shape.impl :as ctsi]
|
[app.common.types.shape.impl :as ctsi]
|
||||||
[app.common.uuid :as uuid]
|
[app.common.uuid :as uuid]
|
||||||
[app.config :as cf]
|
[app.main.features :as features]
|
||||||
|
[app.main.store :as st]
|
||||||
[app.util.object :as obj]
|
[app.util.object :as obj]
|
||||||
[promesa.core :as p]))
|
[promesa.core :as p]))
|
||||||
|
|
||||||
(def enabled?
|
(def enabled?
|
||||||
(contains? cf/flags :render-wasm))
|
(features/active-feature? @st/state "render-wasm/v1"))
|
||||||
|
|
||||||
(set! app.common.types.shape.impl/enabled-wasm-ready-shape enabled?)
|
(set! app.common.types.shape.impl/enabled-wasm-ready-shape enabled?)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue