Merge pull request #10312 from penpot/elenatorro-load-rulers-fast

 Improve rulers loading time
This commit is contained in:
Alejandro Alonso 2026-06-18 16:12:36 +02:00 committed by GitHub
commit 6f558bad2a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 14 additions and 1 deletions

View File

@ -17,7 +17,10 @@
(defn initialize
[enabled?]
(if enabled?
(set! app.common.types.path/wasm:calc-bool-content wasm.api/calculate-bool)
(do
(set! app.common.types.path/wasm:calc-bool-content wasm.api/calculate-bool)
;; Preload the WASM engine at boot so it's ready when a file opens.
(wasm.api/preload-module!))
(set! app.common.types.path/wasm:calc-bool-content nil))
(set! app.common.types.shape/wasm-enabled? enabled?)
(set! app.common.types.shape/wasm-create-shape wasm.shape/create-shape))

View File

@ -2555,4 +2555,10 @@
(p/resolved false)))))
(p/resolved false))))
(defn preload-module!
"Starts downloading + compiling the WASM engine now instead of on first
viewport mount. Idempotent: the `delay` caches its in-flight promise."
[]
@module)

View File

@ -2234,6 +2234,10 @@ impl RenderState {
} else {
self.reset_canvas();
self.interactive_target_seeded = false;
// Paint rulers/frame now so they survive the progressive frames
// instead of blanking until the first full `present_frame`.
ui::render(self, tree);
self.flush_and_submit();
}
let surface_ids = SurfaceId::Strokes as u32