Status: bundle + code audit complete. Production Lighthouse baseline and post-deploy compare captured.
This report tracks the impact of moving markdown-heavy and code-heavy surfaces to React Server Components and server-rendered code highlighting.
Pages explicitly covered:
/blog/react-server-components/router/latest/docs/overview/router/latest/docs/framework/react/examples/basic/query/latest/router/latest/form/latest/table/latest/virtual/latest
Bundle analysis:
- Baseline: clean
HEADworktree at/tmp/tanstack-bundle-baseline - Current: this branch/worktree
- Metric: transitive built client JS graph per representative route from production build assets
- Unit: bytes and gzip bytes
Production baseline metrics:
- Captured against live
https://tanstack.com - Tool: Lighthouse via
npx lighthouse - Category:
performance - Strategy: default Lighthouse mobile simulation
Notes:
- Bundle numbers are the most trustworthy pre-ship metric here
- Lighthouse should be compared on the same production domain before and after deploy
- Production Lighthouse is noisy; treat single-run numbers as directional until we rerun after deploy
Gzipped client JS, before vs after.
| Page | Before | After | Delta |
|---|---|---|---|
/blog/react-server-components |
547,196 B | 394,207 B | -152,989 B |
/router/latest/docs/overview |
563,295 B | 410,644 B | -152,651 B |
/router/latest/docs/framework/react/examples/basic |
421,421 B | 381,079 B | -40,342 B |
/table/latest |
451,744 B | 409,455 B | -42,289 B |
/query/latest |
405,185 B | 412,671 B | +7,486 B |
/router/latest |
403,281 B | 411,259 B | +7,978 B |
/form/latest |
401,951 B | 409,389 B | +7,438 B |
/virtual/latest |
401,535 B | 409,044 B | +7,509 B |
- Big wins on markdown-heavy pages:
- blog: about
-153 KB gz - docs page: about
-153 KB gz
- blog: about
- Clear win on docs example page: about
-40 KB gz - Clear win on table landing: about
-42 KB gz - Slight regressions on most other landing pages: about
+7-8 KB gz
Interpretation:
- The pages dominated by markdown parsing and client-side highlighting improved materially
- Most landing pages are now architecturally cleaner, but not smaller yet
- The likely reason for the small landing regressions is that the old landing code-example path had more lazy/client indirection, while the new server-rendered example shell is part of the initial experience
Verified absent from current dist/client/assets:
shiki@shikijs/*createHighlightercodeToHtmlhtml-react-parserremark-*rehype-*rehype-react- old client markdown renderer files
- old landing example card files
- representative raw example-source snippets
Implications:
- Markdown rendering pipeline is out of the client build
- Syntax highlighting pipeline is out of the client build
- Landing example source strings are out of the client build
Runtime spot checks also confirmed:
- docs/example pages no longer request Shiki/highlighting assets
- landing pages no longer hit the old client
CodeBlockpath
Nuance:
- Client sourcemaps still reference some server-fn stub names like
fetchRenderedCodeFileandfetchLandingCodeExample - Those are stubs, not the rendering/highlighting pipeline itself
Git diff summary:
46 files changed1,017 insertions2,038 deletions- Net: about
-1,021lines
Deleted legacy client-heavy files:
src/components/CodeExampleCard.tsxsrc/components/LazyCodeExampleCard.tsxsrc/components/SimpleMarkdown.tsxsrc/components/markdown/Markdown.tsxsrc/components/markdown/MarkdownFrameworkHandler.tsxsrc/components/markdown/MarkdownTabsHandler.tsxsrc/utils/markdown/processor.ts
New server-focused structure:
src/components/markdown/renderCodeBlock.server.tsxsrc/components/markdown/CodeBlock.server.tsxsrc/utils/markdown/processor.rsc.tsxsrc/utils/markdown/renderRsc.tsxsrc/components/landing/codeExamples.server.tsxsrc/components/landing/LandingCodeExampleCard.server.tsx
Dependency cleanup:
- Removed
html-react-parser - Removed
rehype-stringify
Architectural simplifications:
- One server markdown pipeline instead of mixed client/server rendering
- One server code-highlighting pipeline instead of client Shiki
- One server landing-example registry instead of repeating large inline code maps across landing pages
- Example pages now use URL-driven server-rendered code panes instead of client raw source + client highlighting
Captured before shipping these changes.
| Page | Score | FCP | LCP | Speed Index | TBT | CLS | Interactive | Bytes | Requests |
|---|---|---|---|---|---|---|---|---|---|
/query/latest |
80 | 2.8s | 3.4s | 3.4s | 300ms | 0.001 | 6.1s | 765 KiB | 89 |
/blog/react-server-components |
52 | 3.3s | 3.7s | 3.6s | 1,200ms | 0.15 | 7.8s | 1,101 KiB | 60 |
/router/latest/docs/overview |
78 | 3.0s | 3.6s | 3.9s | 280ms | 0.002 | 7.5s | 917 KiB | 81 |
Notes:
- These are single-run live production baselines, so expect some noise
- Blog is the most likely page to show strong post-deploy Lighthouse improvement because it had the largest client-bundle reduction
- Docs should also improve meaningfully
- Landing-page Lighthouse changes may be neutral or mixed except for table, based on current bundle data
| Page | Before Score | After Score | Before LCP | After LCP | Before TBT | After TBT | Before Bytes | After Bytes | Notes |
|---|---|---|---|---|---|---|---|---|---|
/query/latest |
80 | 77 | 3.4s | 3.8s | 300ms | 250ms | 765 KiB | 784 KiB | Roughly flat. Slightly worse score/LCP on this run, slightly better TBT. |
/blog/react-server-components |
52 | 74 | 3.7s | 3.6s | 1,200ms | 260ms | 1,101 KiB | 785 KiB | Clear win. Huge TBT and transfer-size drop, major score improvement. |
/router/latest/docs/overview |
78 | 81 | 3.6s | 3.6s | 280ms | 200ms | 917 KiB | 777 KiB | Modest win. Better score, lower TBT, lower transfer size. |
- Strong technical wins on markdown-heavy and code-heavy content pages
- Clear reduction in client responsibility and code complexity
- Clear removal of markdown parsing and syntax highlighting from the client bundle
- Not a universal bundle win across all landing pages yet
- Best pages to watch post-deploy: blog and docs
- Blog got the clearest real-world benefit.
- Lighthouse score improved from
52to74 - TBT dropped from
1,200msto260ms - transfer size dropped from
1,101 KiBto785 KiB
- Lighthouse score improved from
- Docs improved, but less dramatically.
- Lighthouse score improved from
78to81 - TBT dropped from
280msto200ms - transfer size dropped from
917 KiBto777 KiB
- Lighthouse score improved from
- Query landing did not show a Lighthouse win on this run.
- Score went from
80to77 - LCP worsened slightly from
3.4sto3.8s - TBT improved slightly from
300msto250ms
- Score went from
Interpretation:
- The bundle-side story predicted this fairly well.
- The strongest wins landed on markdown-heavy pages where we removed the client markdown/highlighting pipeline.
- The landing-page story remains mixed because those pages were not dominated by markdown and some of the server-rendered example-shell work traded complexity reduction for slightly more initial shell work.
- If we want broader Lighthouse wins on library landings, the next work is probably not more RSC conversion. It is targeted landing-page performance work.