Reduce the workspace checkout preload below 500 KB - #1233
Closed
SawyerHood wants to merge 1 commit into
Closed
Conversation
Collaborator
Author
|
Closing this for now. We cannot take this change yet. Nothing here is wrong. The branch is kept, CI was green, and the measurements Recorded so the next attempt does not repeat the investigation:
#1072 stays open. Branch: |
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.
Results
The raw
workspace-checkout-displaychunk fell from 2,147,954 bytes to 323,524 bytes. After the rebase, the production build reports 316.4 KB raw, below the issue's 500 KB target.The browser transfer fell from 649,358 bytes to 102,973 bytes. First paint occurred at 128 ms. The checkout chunk started at 603 ms. The browser requested no prompt, diff, or file-editor chunk during the measured initial load.
Root cause and fix
The issue hypothesis was partly wrong.
workspace-checkout-display.tsdid not import an editor. Rolldown named a shared 713-module chunk after that small helper. Static route imports pulled in the worker pool, timeline rows, file preview, and diff renderer.This change adds lazy boundaries for the prompt editor, timeline rows, file preview, diff renderer, diff panel, and worker-pool provider. It also moves shared constants into small leaf modules so route code does not cross heavy component seams.
Guardrails
The bundle check now measures the exact checkout chunk and the workspace route's static chunk closure.
bundle-budget.jsonadds a 500 KB per-chunk cap andforbiddenWorkspaceRoutePackagesfor editor and renderer packages.I rewrote the file's rationale comment because it previously said there was deliberately no per-chunk limit. The checkout chunk now needs a focused limit because its shared ownership hid this regression.
Rebase
The rebase resolved a conflict with the iPadOS Magic Keyboard work in
PromptBoxInternal.tsx. This change renames that implementation toPromptBoxInternalImpl.tsx, and the merged implementation preserves the iPadOS behavior and tests.Validation
Fixes #1072