Skip to content

ci: Report Next.js/RSC and renderToPipeableStream bundle sizes - #4093

Merged
ntucker merged 3 commits into
masterfrom
cursor/sizechange-nextjs-ssr-558b
Sep 18, 2026
Merged

ntucker merged 3 commits into
masterfrom
cursor/sizechange-nextjs-ssr-558b

Conversation

@ntucker

@ntucker ntucker commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

Fixes # .

Motivation

The Bundle Size check only gzip-measured the SPA @data-client/react graph (rdcClient.js). Next.js App Router / RSC (@data-client/react/nextjs) and generic renderToPipeableStream (@data-client/react/ssr) adapter graphs were untracked, so streaming work on those export paths could land without a size comment.

Solution

Same preactjs/compressed-size-action@v2 job, same yarn ci:build:bundlesize / production minify, same gzip PR comment.

examples/test-bundlesize runs three isolated webpack compilations (SPA plus two adapters) and copies only the adapter rdc* chunks into dist/ so the existing glob picks them up:

  • rdcClient.js — SPA (@data-client/react) — unchanged vs master (0 byte gzip delta)
  • rdcNextjs.js — Next.js/RSC (@data-client/react/nextjs)
  • rdcPipeableStream.js — renderToPipeableStream (@data-client/react/ssr)

Local dry-run (zlib.gzipSync, same compression as the action):

Chunk Graph min gzip vs SPA gzip
rdcClient.js SPA 34608 10865 0
rdcNextjs.js Next.js/RSC 39070 12355 +1490
rdcPipeableStream.js renderToPipeableStream 29271 9649 −1216

Master already ships ./nextjs and ./ssr, so this measures what master publishes today. Future streaming on those export paths will show up as deltas on the same two files.

Open questions

N/A

Open in Web Open in Cursor 

Keep the existing SPA rdcClient gzip check and add matching production
webpack measurements for @data-client/react/nextjs and
@data-client/react/ssr.

Co-authored-by: Nathaniel Tucker <me@ntucker.me>
@changeset-bot

changeset-bot Bot commented Sep 18, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: a466c65

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel

vercel Bot commented Sep 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs-site Ignored Ignored Preview Sep 18, 2026 3:06am UTC

Request Review

@github-actions

github-actions Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Size Change: +22 kB (+27.11%) 🚨

Total Size: 103 kB

📦 View Changed
Filename Size Change
examples/test-bundlesize/dist/rdcNextjs.js 12.3 kB +12.3 kB (new file) 🆕
examples/test-bundlesize/dist/rdcPipeableStream.js 9.63 kB +9.63 kB (new file) 🆕
ℹ️ View Unchanged
Filename Size Change
examples/test-bundlesize/dist/App.js 1.46 kB +4 B (+0.27%)
examples/test-bundlesize/dist/polyfill.js 307 B 0 B
examples/test-bundlesize/dist/rdcClient.js 10.9 kB 0 B
examples/test-bundlesize/dist/rdcEndpoint.js 8.07 kB 0 B
examples/test-bundlesize/dist/react.js 59.6 kB 0 B
examples/test-bundlesize/dist/webpack-runtime.js 784 B 0 B

compressed-size-action

@codecov

codecov Bot commented Sep 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.84%. Comparing base (44cb7e6) to head (a466c65).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4093   +/-   ##
=======================================
  Coverage   97.84%   97.84%           
=======================================
  Files         156      156           
  Lines        3057     3057           
  Branches      612      612           
=======================================
  Hits         2991     2991           
  Misses         18       18           
  Partials       48       48           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Drop the workflow comments and extra gitignore. Build adapters into
yarn's cache dir and copy only the rdc chunks into dist/.

Co-authored-by: Nathaniel Tucker <me@ntucker.me>
@ntucker
ntucker marked this pull request as ready for review September 18, 2026 02:59

@ntucker ntucker left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wire the SPA entry through ./ui too.

ui.tsx extracts Doit for the adapter entries, but index.tsx still inlines the same component. That leaves two sources of truth for the fixture that keeps the three package graphs comparable — the next edit to one side will silently skew SPA vs nextjs/ssr.

Please import Doit from ./ui in index.tsx and drop the inlined copy. Leave the existing React.memo / second / renderedElement SPA entry shape alone (nothing else imports those exports; renderedElement is still used locally, and touching them only risks App.js noise in the size comment).

Rest looks good: isolated webpack compiles + cache-dir copy of only rdc* into dist/ is the right shape for per-adapter gzip without double-counting App/react; rdcClient staying flat and the +22 kB new-file comment are expected first-measure noise.

Import Doit from ./ui in index.tsx so SPA, Next.js/RSC, and
renderToPipeableStream keep one fixture source of truth.

Co-authored-by: Nathaniel Tucker <me@ntucker.me>
@cursor

cursor Bot commented Sep 18, 2026

Copy link
Copy Markdown

Staff CHANGE_THIS_PR cleared by sharing Doit from ./ui in the SPA fixture (index.tsx). Inlined duplicate removed; React.memo / second / renderedElement unchanged.

@ntucker
ntucker merged commit 558b16f into master Sep 18, 2026
23 checks passed
@ntucker
ntucker deleted the cursor/sizechange-nextjs-ssr-558b branch September 18, 2026 14:06
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.

2 participants