Repository navigation
perf(desktop): unblock frontend assets and defer archive readers - #3915
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Move packaged frontend file resolution off the WebView callback thread, load the appearance and visual-skin ZIP readers only when importing a package, and add an opt-out for native window material when comparing compositing cost.
Packaged hashed assets use content ETags with mandatory revalidation. Legacy customizations share these URLs, so long-lived immutable caching would serve stale scripts after preview, activation or rollback. Editable assets, bootstrap pages and failures retain
no-store.The related embedded Relay path now grants immutable caching only to successful hashed build assets (and their 304 responses). Unversioned files, HTML and missing chunks no longer receive a one-year cache lifetime.
Type and Areas
Type: performance improvement and regression prevention.
Areas: desktop/Tauri, Web UI appearance and visual-skin imports.
Motivation / Impact
Lazy chunk loads no longer perform filesystem reads and canonicalization on the WebView callback thread. Archive dependencies leave the initial loading path.
OPENBITFUN_NATIVE_WINDOW_MATERIAL=0selects the existing opaque fallback on macOS and Windows for controlled performance comparisons; normal behavior is unchanged.Verification
All local checks passed on macOS:
pnpm run check:webandpnpm run build:web: type-check, appearance/theme gates, generated API bindings, Monaco assets and WebKit compatibility.cargo test --locked -p openbitfun-desktop --no-default-features --lib frontend_: 37 tests, including legacy state, upgrades, controller-local/Peer admission and cache behavior. The 31frontend_workbenchtests were rerun after the final response-header correction.cargo test --locked -p openbitfun-desktop --no-default-features --lib embedded_relay_host: 3 tests, including real loopback HTTP for mutable assets, hashed assets, 304s and 404s.cargo test --locked -p openbitfun-desktop --no-default-features --lib window_material::tests: 4 tests, with both default settings andOPENBITFUN_NATIVE_WINDOW_MATERIAL=0; 2appearance::startup_appearance_testsalso passed.cargo check --locked -p openbitfun-desktop --no-default-features --libandcargo build --locked -p openbitfun-desktop --features devtools.node tests/e2e/scripts/run-creation-runtime.mjs, with default material,OPENBITFUN_NATIVE_WINDOW_MATERIAL=0, and--suspended-paint: real packaged WebView loading, custom frontend activation, reload persistence and MiniApp create/open/render/update/delete all passed on the final build.no-store.pnpm run fmt:rs,git diff --check, andnode scripts/check-git-object-sizes.mjs --base upstream/main --head HEAD.Production output confirms that JSZip and zip.js are dynamically imported chunks: 257,577 bytes total (101,679 bytes gzip). This measures deferred bundle bytes, not end-to-end startup latency.
Reviewer Notes
AI-assisted; testing level: fully tested for the stated local macOS scope. Cross-platform CI passed on commit
8bb93e31a: 11 checks succeeded and 2 impact-selected jobs were skipped. The CI workflow is successful. No persisted shape or wire protocol changes. Remote Control's embedded static HTTP path is covered by loopback fixtures; Peer/controller admission is covered by local fixtures. No live Remote Workspace, Remote Control device, Peer Device Mode or Detached Dispatch scenario was exercised. Native Windows/Linux rendering and end-to-end performance timing remain outside local verification.Checklist