mirror of
https://github.com/penpot/penpot.git
synced 2025-05-24 23:16:10 +02:00
Merge pull request #5321 from penpot/niwinz-improvements-features
✨ Feature flags improvements
This commit is contained in:
commit
20ea188070
8 changed files with 48 additions and 29 deletions
|
@ -30,6 +30,7 @@
|
|||
[app.util.i18n :as i18n]
|
||||
[app.util.theme :as theme]
|
||||
[beicon.v2.core :as rx]
|
||||
[cuerdas.core :as str]
|
||||
[debug]
|
||||
[features]
|
||||
[potok.v2.core :as ptk]
|
||||
|
@ -38,11 +39,11 @@
|
|||
(log/setup! {:app :info})
|
||||
|
||||
(when (= :browser cf/target)
|
||||
(log/info :message "Welcome to penpot"
|
||||
:version (:full cf/version)
|
||||
(log/info :version (:full cf/version)
|
||||
:asserts *assert*
|
||||
:build-date cf/build-date
|
||||
:public-uri (dm/str cf/public-uri)))
|
||||
:public-uri (dm/str cf/public-uri))
|
||||
(log/info :flags (str/join "," (map name cf/flags))))
|
||||
|
||||
(declare reinit)
|
||||
|
||||
|
|
|
@ -33,10 +33,13 @@
|
|||
|
||||
(defn get-team-enabled-features
|
||||
[state]
|
||||
(-> global-enabled-features
|
||||
(set/union (:features-runtime state #{}))
|
||||
(set/intersection cfeat/no-migration-features)
|
||||
(set/union (:features-team state #{}))))
|
||||
(let [runtime-features (:features-runtime state #{})
|
||||
team-features (->> (:features-team state #{})
|
||||
(into #{} cfeat/xf-remove-ephimeral))]
|
||||
(-> global-enabled-features
|
||||
(set/union runtime-features)
|
||||
(set/intersection cfeat/no-migration-features)
|
||||
(set/union team-features))))
|
||||
|
||||
(def features-ref
|
||||
(l/derived get-team-enabled-features st/state =))
|
||||
|
@ -124,9 +127,9 @@
|
|||
(let [features (get-team-enabled-features state)]
|
||||
(if (contains? features "render-wasm/v1")
|
||||
(render.wasm/initialize true)
|
||||
(render.wasm/initialize false)))
|
||||
(render.wasm/initialize false))
|
||||
|
||||
(log/trc :hint "initialized features"
|
||||
:team (str/join "," (:features-team state))
|
||||
:runtime (str/join "," (:features-runtime state)))))))
|
||||
(log/inf :hint "initialized"
|
||||
:enabled (str/join "," features)
|
||||
:runtime (str/join "," (:features-runtime state))))))))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue