Repository navigation
build(dev): add opt-in ORCA_DEV_BUNDLED=1 for Vite bundled renderer dev mode - #33433
Merged
Merged
Conversation
…ev mode Serves the renderer through Vite's experimental bundled dev mode when the variable is set. Strict execution order keeps the React Refresh preamble ahead of chunks shared by the four HTML entries. Default dev behavior is unchanged.
nwparker
marked this pull request as ready for review
October 25, 2026 06:23
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 1 minute. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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
This adds an opt-in
ORCA_DEV_BUNDLED=1setting forpnpm dev. It runs the renderer in Vite's experimental bundled dev mode (experimental.bundledDev, available in the installed Vite 8.3.4). In this mode the renderer loads as a few bundled chunks instead of ~2–3k separate module requests. It is off by default, so normalpnpm devis unchanged.config/build-plugins/renderer-bundled-dev.ts: when the variable is set, enablesexperimental.bundledDevon the renderer config and setsbuild.rollupOptions.output.strictExecutionOrder: true.config/build-plugins/dev-serve-config.ts: applies it on the serve path only. Production builds are unaffected..github/CONTRIBUTING.md: how to use it, plus known caveats.Why
strictExecutionOrderIf you enable bundled dev alone, the renderer never mounts. It throws
@vitejs/plugin-react can't detect preamble. The React Refresh preamble is inlined into theindexentry chunk, but the four HTML entries (index,popout,space,web) share chunks, and those chunks run before the entry's preamble. Strict execution order keeps the original module order, and the app renders normally.Measurements
How it was measured: full Electron dev app, launched in the background with
ORCA_BACKGROUND_LAUNCH=1, a fresh profile each run, and timing over CDP. "Ready" meansworkspaceSessionReadyplus a rendered#root. The timer starts when Electron's renderer target appears, which excludes the main/preload build that is the same in both modes. The machine was heavily loaded (load average 35–60), so the numbers are noisy. Medians of 4 interleaved warm runs:ORCA_DEV_BUNDLED=1performance.now())In bundled mode the first reload after start takes ~3.5 s, because the server regenerates the bundle. Later reloads take 0.5–0.7 s.
Validation in bundled mode
Landing.tsx) updated the DOM in 0.9–1.8 s and keptwindowstate (no full reload). Amain.cssedit applied in 1.7–3.1 s and also kept state. Default mode took 2.2–3.2 s and 4.3–4.8 s for the same edits.standard_fontsreturns 200..tsfile, andeditor.workerandts.workerloaded.popout.html,space.html, andweb-index.htmlserve their bundled entries with 200.Known caveats (documented in CONTRIBUTING)
Checks
pnpm tcpasses.pnpm run check:code-quality:changedpasses.oxfmtis clean.