Repository navigation
Keep shiki and the empty state off the markdown page's first load - #22127
Conversation
Bugbot needs on-demand usage enabledBugbot uses usage-based billing for this team and requires on-demand usage to be enabled. A team admin can enable on-demand usage in the Cursor dashboard. |
|
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 |
713c63d to
06a17e2
Compare
[Medium impact] The PR appears safe to merge; no blocking issues were found. SummaryMoves shared text utilities out of the Shiki chunk and loads the markdown empty state through
No actionable issues were found. The merge-base checks differed, so the full PR diff was reviewed as the change since the last review. No previous review threads were supplied. Builds and browser tests were not run. Reviews (2) · Last reviewed commit: "Keep shiki and the empty state off the m..." · Reviewed by Greptile |
|
Bead |
The markdown page evaluated shiki-core (~222 KB) and the viewer pages' pickerModel chunk (~93 KB) before it drew, which put its eager JS over the 1.4 MB budget and made ci-web skip the webview tests. - ccount and zwitch (used by both shiki's hast serializer and the markdown serializer) get their own tiny text-utils chunk, so shiki-core is no longer a static import of the markdown page. Shiki already loaded lazily; the page now prewarms its core at boot so code colors arrive as fast as before. - The shared viewer chunk splits into pageShared (appearance, page client, i18n, ops, cx) and pickerModel (the empty states, picker model and their string table). The markdown page imports its empty state lazily, requested at boot beside the host's config round trip, behind Suspense. - ci-web: a budget miss no longer skips the checks and tests after it; the job fails on it in a final step instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
06a17e2 to
dbcf70e
Compare
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
Unclear: CI failed on
Not re-run automatically: Written by red: web / Web status; do not merge until green; see lane-rules
Agents: |
|
Found 1 test failure on Blacksmith runners: Failure
|
|
Merging at dbcf70e over base reds only (merge hub, projects-70). This PR touches only webviews/src/pages/markdown/{highlight.ts,main.tsx}, webviews/vite.config.ts and .github/workflows/ci-web.yml, and its budget step passes (1,407,890 → 1,118,864). Every red check also fails on feat-cmux-next, in files this PR doesn't touch:
|
…st a budget red) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…st a budget red) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…st a budget red) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Shipped in:
|
Fixes the base red in
scripts/check-webviews-diff-budget.mjs: the markdown page's eager JS was over its 1,400,000-byte budget at 1,407,890 bytes, so ci-web skipped every step after the budget check, including the webview and browser tests. The budget stays the same.Byte counts (
node scripts/check-webviews-diff-budget.mjs, local build)The markdown page drops 289,026 bytes.
shiki-core.mjs(222,504) andpickerModel.mjs(93,379) are gone from its eager set. The new chunkspageShared.mjs(27,403) andtext-utils.mjs(463) are added. The diff pages also stop loadingpickerModeleagerly, sincecxwas the only thing they needed from it.What changed
import(). It was eager only becauseccountandzwitch, which both shiki's hast serializer and the markdown serializer use, had been pulled intoshiki-core. They now have their owntext-utilschunk (463 B). The page starts fetching Shiki's core and its JS regex engine at boot, without waiting on them, so they are ready before a code block asks for colors.pageSharedholds appearance, the page client, i18n, ops andcx, and stays eager.pickerModelholds the empty states, the picker model and their ~60 KB string table. The markdown page imports its empty state withReact.lazy. The import starts at boot, alongside the host's config round trip that decides between a file and the empty state, so the chunk is in hand before the empty phase renders. Suspense covers the rare case where it is not.react-apps-check-shard). The budget step now usescontinue-on-error. A new final step,Fail on the eager JS budget(if: !cancelled() && steps.eager-js-budget.outcome == 'failure'), fails the job when the budget fails. A budget miss no longer skips React Compiler,bun run check, the engine install, the PR-scoped rules orTest webviews. A failed bundle build still stops everything after it.First paint
Measured on the production-built latency harness page (
test/latency/markdown.html, the real markdown page on the mock host), headless, median of 15 loads, two interleaved rounds:There is no new plain-to-colored step: highlighting was already asynchronous per grammar, and the prewarmed core keeps it as fast as before. CLS is unchanged.
Verification
node scripts/check-webviews-diff-budget.mjspasses. Numbers are above.vp lint --type-aware --type-check) are clean, andvp fmtis clean on the touched files.bun run checkfails on base for reasons unrelated to this PR:check:type-scale(syncMotion.gallery.css) and the formatting of settings/icons.tsx. The same holds forsubtle-elevationandui-rulesinbun test.check-webviews-react-compiler.mjspasses.test_pr_scoped_webviews_checks.pypasses.bun testpasses: diff-worker-bundle, diff-label-bundle, path-picker-model, caret-selection, code-pages-terminal-font, render-fence.editor-csppasses withCMUX_BROWSER_TESTS=1, including Monaco staying lazy on the markdown page.actionlintonci-web.ymlis clean.🤖 Generated with Claude Code