Skip to content

fix(webviews): keep react-dom's server renderer out of the shared vendor chunk - #18332

Merged
teamleaderleo merged 3 commits into
feat-cmux-nextfrom
fix/webviews-server-renderer-chunk
Oct 7, 2026
Merged

teamleaderleo merged 3 commits into
feat-cmux-nextfrom
fix/webviews-server-renderer-chunk

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

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 of react-dom into the shared vendor chunk, so vendor.mjs grew 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 to vendor, 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 with build-webviews-app.sh.

Testing

node scripts/check-webviews-diff-budget.mjs is the regression check. It is red on base (before this PR) and green with this PR:

Eager JS Base This PR Budget
diff surface 1,612,988 1,425,353 1,500,000
diff page 1,610,019 1,422,384 1,500,000
markdown page 1,354,749 1,354,897 1,200,000 to 1,400,000
editor page 619,728 432,093 500,000

Also passing locally on bun 1.4.2:

  • build-webviews-app.sh --check
  • build-agent-pane-web.sh --check
  • build-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


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Summary by cubic

Keeps react-dom's server renderer out of the shared vendor chunk. The markdown editor renders its read-only task checkbox with react-dom/server, and the chunk rules previously put the whole package in vendor, which every viewer page evaluates on open. That pushed the diff viewer over its 1.5 MB eager JS budget.

  • The server renderer now stays with its single importer, the markdown page.
  • The markdown page's budget rises to 1.4 MB, with the reason documented in scripts/check-webviews-diff-budget.mjs.
  • Regenerates the committed webviews app bundles on the merged feat-cmux-next base.

Written for commit 606e368. Summary will update on new commits.

Review in cubic Turn on auto-fix


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/server to render read-only task checkboxes as static markup for ProseMirror decorations.

Vite chunking now returns null for react-dom/server paths so that ~190 KB stays on the markdown page instead of being folded into the shared vendor chunk every viewer loads on open. The markdown page budget in check-webviews-diff-budget.mjs is raised from 1.2 MB to 1.4 MB, with a comment tying the headroom to that server renderer.

Committed Resources/markdown-viewer/webviews-app chunks are regenerated from the new split (smaller shared vendor, 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.

…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>
@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: manaflow-ai/cmux/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: f7f22ebe-49fb-4f8d-ad82-d76f00c5daf6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Unclear: web / react-apps-check failed: no known signature; failed step: Check webviews (Oxlint, Oxfmt, type check).

CI failed on 606e3684cb (run 37603987505 attempt 1): 1 unknown.

Job Verdict Why
web / react-apps-check unknown no known signature; failed step: Check webviews (Oxlint, Oxfmt, type check)

Not re-run automatically: web / react-apps-check is not a machine failure.

Written by scripts/ci/classify_failures.py (ci-failure-attribution.yml); signatures are its SIGNATURES table. A machine verdict is the runner's fault, not this PR's; yours means the failing file is one this PR changes, also red on main that main's latest full suite fails the same way, seen on other PRs that it failed on another pull request's run lately.

@teamleaderleo
teamleaderleo merged commit ad726cf into feat-cmux-next Oct 7, 2026
50 of 54 checks passed
@teamleaderleo
teamleaderleo deleted the fix/webviews-server-renderer-chunk branch October 7, 2026 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant