Improve rulers loading time

This commit is contained in:
Elena Torro 2026-06-18 14:38:30 +02:00
parent 94119159d8
commit bfef6ea089
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