mirror of
https://github.com/penpot/penpot.git
synced 2026-06-10 17:32:38 +00:00
The setup-wasm-features function is the single source of truth for
resolving the renderer choice (URL param > profile preference > team
flags), storing the result in state[:features]. Several helpers were
re-deriving the same priority chain independently, duplicating logic:
- wasm-enabled?, wasm-url-override, wasm-url-override-ref
- enabled-by-flags?, enabled-without-migration?
This change removes all duplicated helpers and simplifies the
remaining functions to rely exclusively on the pre-computed
:features set:
- active-feature? — now just checks (contains? (:features state)
feature) without special-casing render-wasm/v1
- use-feature — uses the reactive features-ref for all features
- initialize/recompute-features effects — use the local features
binding directly
Since :features is rebuilt by setup-wasm-features on every
initialization and recompute, this preserves correctness while
eliminating ~50 lines of duplicated code.
25 lines
722 B
JSON
25 lines
722 B
JSON
{
|
|
"~:email": "foo@example.com",
|
|
"~:is-demo": false,
|
|
"~:auth-backend": "penpot",
|
|
"~:fullname": "Princesa Leia",
|
|
"~:modified-at": "~m1713533116365",
|
|
"~:is-active": true,
|
|
"~:default-project-id": "~uc7ce0794-0992-8105-8004-38e630f7920b",
|
|
"~:id": "~uc7ce0794-0992-8105-8004-38e630f29a9b",
|
|
"~:is-muted": false,
|
|
"~:default-team-id": "~uc7ce0794-0992-8105-8004-38e630f40f6d",
|
|
"~:created-at": "~m1713533116365",
|
|
"~:is-blocked": false,
|
|
"~:props": {
|
|
"~:nudge": {
|
|
"~:big": 10,
|
|
"~:small": 1
|
|
},
|
|
"~:v2-info-shown": true,
|
|
"~:viewed-tutorial?": false,
|
|
"~:viewed-walkthrough?": false,
|
|
"~:renderer": "~:wasm"
|
|
}
|
|
}
|