Repository navigation
fix(webviews): keep react-dom's server renderer out of the shared vendor chunk - #18332
Conversation
…dor chunk 8eef484 renders the markdown editor's read-only task checkbox with react-dom/server. The chunk rules put all of react-dom into `vendor`, which every viewer page evaluates on open, so the diff, diff page and code editor pages each grew by ~188 KB and went over their eager budgets. The server renderer now stays with its one importer, the markdown page. That page's budget rises to 1.4 MB for it, with the reason next to it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 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 |
…s-server-renderer-chunk
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Unclear: CI failed on
Not re-run automatically: Written by |
Summary
feat-cmux-next's react-apps-check fails the diff viewer's eager-JS budget (1,612,988 bytes against 1,500,000), which blocks every web PR.
The cause is 8eef484. It renders the markdown editor's read-only task checkbox with
react-dom/server. The chunk rules put all ofreact-dominto the sharedvendorchunk, sovendor.mjsgrew from 271,798 to 459,433 bytes. Every viewer page loads that chunk on open.webviews/vite.config.ts:react-dom's server renderer is no longer pinned tovendor, so it stays with its one importer, the markdown page.scripts/check-webviews-diff-budget.mjs: the markdown page's budget goes from 1.2 MB to 1.4 MB. That page does evaluate the server renderer, and the reason is written next to the budget.Resources/markdown-viewer/webviews-app: regenerated withbuild-webviews-app.sh.Testing
node scripts/check-webviews-diff-budget.mjsis the regression check. It is red on base (before this PR) and green with this PR:Also passing locally on bun 1.4.2:
build-webviews-app.sh --checkbuild-agent-pane-web.sh --checkbuild-web-bundles.sh, whose output matches the committed bundles byte for byte.The webviews unit tests were not run locally; CI runs them.
Changelog
none
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Keeps
react-dom's server renderer out of the sharedvendorchunk. The markdown editor renders its read-only task checkbox withreact-dom/server, and the chunk rules previously put the whole package invendor, which every viewer page evaluates on open. That pushed the diff viewer over its 1.5 MB eager JS budget.scripts/check-webviews-diff-budget.mjs.feat-cmux-nextbase.Written for commit 606e368. Summary will update on new commits.
Note
Low Risk
Bundling and CI budget changes only; no runtime auth, data, or API behavior beyond smaller eager loads for diff/editor pages.
Overview
Fixes diff and editor webview pages failing the 1.5 MB eager JS budget after the markdown editor started using
react-dom/serverto render read-only task checkboxes as static markup for ProseMirror decorations.Vite chunking now returns
nullforreact-dom/serverpaths so that ~190 KB stays on the markdown page instead of being folded into the sharedvendorchunk every viewer loads on open. The markdown page budget incheck-webviews-diff-budget.mjsis raised from 1.2 MB to 1.4 MB, with a comment tying the headroom to that server renderer.Committed
Resources/markdown-viewer/webviews-appchunks are regenerated from the new split (smaller sharedvendor, server code colocated with markdown).Reviewed by Cursor Bugbot for commit 606e368. Bugbot is set up for automated code reviews on this repo. Configure here.