mirror of
https://github.com/penpot/penpot.git
synced 2026-04-25 11:18:36 +00:00
♻️ Remove worker URI from global templates and compute from public URI
- Remove penpotWorkerURI from index.mustache and rasterizer.mustache templates - Remove worker_main entry from the build manifest - Construct worker URI in config.cljs by joining public-uri with worker path - Fix global variable casing for plugins-list-uri and templates-uri - Fix alignment in worker.cljs let bindings
This commit is contained in:
parent
aed2f8a8f8
commit
98e8160875
@ -31,7 +31,6 @@
|
||||
globalThis.penpotVersion = "{{& version}}";
|
||||
globalThis.penpotVersionTag = "{{& version_tag}}";
|
||||
globalThis.penpotBuildDate = "{{& build_date}}";
|
||||
globalThis.penpotWorkerURI = "{{& manifest.worker_main}}";
|
||||
</script>
|
||||
|
||||
{{# manifest}}
|
||||
|
||||
@ -9,7 +9,6 @@
|
||||
globalThis.penpotVersion = "{{& version}}";
|
||||
globalThis.penpotVersionTag = "{{& version_tag}}";
|
||||
globalThis.penpotBuildDate = "{{& build_date}}";
|
||||
globalThis.penpotWorkerURI = "{{& manifest.worker_main}}";
|
||||
</script>
|
||||
|
||||
{{# manifest}}
|
||||
|
||||
@ -209,7 +209,6 @@ async function generateManifest() {
|
||||
config: "./js/config.js?version=" + VERSION_TAG,
|
||||
polyfills: "./js/polyfills.js?version=" + VERSION_TAG,
|
||||
libs: "./js/libs.js?version=" + VERSION_TAG,
|
||||
worker_main: "./js/worker/main.js?version=" + VERSION_TAG,
|
||||
default_translations: "./js/translation.en.js?version=" + VERSION_TAG,
|
||||
|
||||
importmap: JSON.stringify({
|
||||
|
||||
@ -153,9 +153,9 @@
|
||||
(def privacy-policy-uri (obj/get global "penpotPrivacyPolicyURI"))
|
||||
(def flex-help-uri (obj/get global "penpotGridHelpURI" "https://help.penpot.app/user-guide/flexible-layouts/"))
|
||||
(def grid-help-uri (obj/get global "penpotGridHelpURI" "https://help.penpot.app/user-guide/flexible-layouts/"))
|
||||
(def plugins-list-uri (obj/get global "penpotPluginsListUri" "https://penpot.app/penpothub/plugins"))
|
||||
(def plugins-list-uri (obj/get global "penpotPluginsListURI" "https://penpot.app/penpothub/plugins"))
|
||||
(def plugins-whitelist (into #{} (obj/get global "penpotPluginsWhitelist" [])))
|
||||
(def templates-uri (obj/get global "penpotTemplatesUri" "https://penpot.github.io/penpot-files/"))
|
||||
(def templates-uri (obj/get global "penpotTemplatesURI" "https://penpot.github.io/penpot-files/"))
|
||||
|
||||
;; We set the current parsed flags under common for make
|
||||
;; it available for common code without the need to pass
|
||||
@ -177,7 +177,10 @@
|
||||
public-uri))
|
||||
|
||||
(def worker-uri
|
||||
(obj/get global "penpotWorkerURI" "/js/worker/main.js"))
|
||||
(-> public-uri
|
||||
(u/join "js/worker/main.js")
|
||||
(get :path)
|
||||
(str "?version=" version-tag)))
|
||||
|
||||
(defn external-feature-flag
|
||||
[flag value]
|
||||
|
||||
@ -90,8 +90,8 @@
|
||||
"Return a initialized webworker instance."
|
||||
[path on-error]
|
||||
(let [instance (js/Worker. path)
|
||||
bus (rx/subject)
|
||||
worker (Worker. instance (rx/to-observable bus))
|
||||
bus (rx/subject)
|
||||
worker (Worker. instance (rx/to-observable bus))
|
||||
|
||||
handle-message
|
||||
(fn [event]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user