Repository navigation
perf(workbench): load route views on first visit - #2392
Merged
Merged
Conversation
The eight rail pages were statically imported into the entry chunk, so every boot downloaded agents/settings/projects/contacts/tasks/docs even when the user only read chat. - wrap each route view in React.lazy with a shared Suspense boundary; hooks stay mounted in WorkbenchRoutes so drafts and caches survive navigation - replace the 40-line rationale block with a two-line invariant - drop leftover blank lines in the web i18n bootstrap - tests navigate through a new openRailPage helper that flushes the lazy chunk inside act(), so assertions stay synchronous Web build (raw / gzip): entry 1401 KB / 412 KB -> 1117 KB / 347 KB routes now load on demand: agents 191 KB, contacts 28 KB, settings 25 KB, projects 25 KB, tasks 22 KB, docs 11 KB, devices 6 KB, usage 5 KB Co-authored-by: Codex <codex@delicious233.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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
Rail pages (
agents / contacts / projects / runs / docs / devices / usage / settings) were statically imported into the workbench entry chunk, so every boot paid for all eight even when the user only used chat. They are nowReact.lazychunks behind a singleSuspenseboundary; route hooks stay mounted inWorkbenchRoutes, so in-progress drafts and project caches still survive navigation.Also removes the 40-line rationale block that had grown above the route gates (the invariant is one sentence) and drops leftover blank lines in the web i18n bootstrap.
Bundle (web,
vite build --sourcemap)Test harness
Rail navigation in tests goes through a new
openRailPage()helper that warms the route modules inbeforeAlland flushes the lazy chunk insideact(), so existing synchronous assertions stay valid without weakening them.Verification
workbenchvitest: 163 files / 1605 tests passdesktopvitest: 365 files / 4881 tests passwebvitest: 33 files / 275 tests passtsc -b(shared, workbench, web) andtsc --noEmit(workbench): cleanpnpm lint:css+ workbench eslint: 0 errorspython scripts/verify/verify-doc-ssot.py: okscripts/visual-qa-shell.mjs: 4 shots,overflow=false/tasksroute renders the board shellNot covered:
scripts/visual-qa-tasks-board.mjsfails onmasteras well — the script still pins real-data mode and expects fixture board columns; unrelated to code splitting (the page itself renders).