Repository navigation
Conversation
…rves the chunk set, chunk and module numbers
…ip figure stays identical; tests pin it
… Vite app ships it
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
Changes requested: the Rolldown mode is a useful addition and its figures reproduce, but four points need fixing before INV10 reports can rely on it.
modulePreload: false(scripts/measure-reference-pages.mjs:509) leaves out the preload code a default Vite production build ships, 420 B gzip on the menu page and 374 B on the table page, so keep Vite's default or say in the title, the JSDoc and the description that the figures exclude it.rolldownPageStats(:454-462,:469) re-implements the chunk walk and eager-text join thatimportLevelsandeagerTextin.github/scripts/lib/component-size.jsand this file'schunkGraphStatsalready provide, so map Rolldown's chunks to that graph shape and call the shared helpers.- Without
--bundler,--jsonnow prints"bundler": "esbuild"(:609,:613), which contradicts the description's "same text and JSON", so add the key only forrolldownor reword the invariant. - The description credits esbuild's chunk placement with the whole 5–11% gap, but the extra up-front modules account for about half of the minified gap on docs and about a fifth or less on form, menu and table, so reword that sentence.
Smaller notes: in Rolldown mode keptModules also counts Vite's and Rolldown's virtual modules, and build.rollupOptions is a deprecated alias of rolldownOptions in Vite 8.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Claim: the script builds each page with esbuild and code splitting — verified (size helper options,
splitting: true;measurePage). - Claim: esbuild keeps more modules up front than Vite — verified: 10, 4, 1 and 2 more first-load modules on docs, form, menu and table.
- Claim: that placement is why esbuild's figures are 5–11% higher — false in part: those modules carry 11,050 of 20,348 minified bytes of the gap on docs and 581 of 9,549, 2,148 of 10,830 and 2,756 of 13,324 elsewhere.
- Claim: without
--bundler, same build, numbers and text — verified (text output identical to the base script's); same JSON — false (bundlerkey,:609,:613). - Claim: the mode builds each page as a production Vite app, and Vite 8 bundles with Rolldown — verified for Vite 8.3.5 with Rolldown 1.2.16, except that module preload is off (
:509), unlike a default production build. - Claim: same page entry, with React, React DOM and StyleX external — verified (
:491-500,isAppExternalover the shared externals list). - Claim: minification on, preload off, chunks read from memory — verified (
:506-509). - Claim: it measures the entry chunk and its static imports and leaves
import()targets out — verified (:454-462; tests atscripts/measure-reference-pages.test.mjs:179and:196). - Claim: gzip via the shared
gzipBytes; kept modules are modules with rendered code; chunk count and depth — verified (:463-475); kept modules also include bundler-virtual modules. - Claim: esbuild figures stay as a secondary table and under
esbuildinbase,headanddelta— verified (:186-198,:88,:109-116). - Claim: PASS/FAIL and its JSON read the chosen bundler's gzip delta — verified (
:126-128; test atscripts/measure-reference-pages.test.mjs:385). - Claim: modules reached and module depth stay on the input graph — verified (
:534-538). - Claim: no new dependency; the existing
vitedevDependency (catalog^8.1.3, 8.3.5 installed) — verified (rootpackage.json, workspace catalog, lockfile). - Claim: the per-page table of first-load sizes — verified: minified bytes match exactly for both bundlers; gzip within 0.3% on this platform.
- Claim: no package source and no workflow changes, and a Rolldown run adds one Vite build per page and side — verified (two script files;
:539; about 2 s for four pages here). - Claim: stacked on #11994, and #11840 adds
--helptext — verified (base branch is #11994's head; #11840's description). - Claim: no public API, product, visual or policy change, and no internal context — verified.
- Claim: 22 tests pass, covering stats on fixture output, a real Vite build,
--bundlerparsing and the gate — verified (22 passed; tests atscripts/measure-reference-pages.test.mjs:179,:188,:196,:385,:484). - File
scripts/measure-reference-pages.mjs— findings 1–3 above, plus the two smaller notes. - File
scripts/measure-reference-pages.test.mjs— clear; it matches the script's new exports, thoughisAppExternalhas no test of its own.
…rops; chunkGraphStats keeps its doc
…defaults; JSON names the bundler only in Rolldown mode
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet, and it runs once the pull request is ready for review and targets main.
The Rolldown mode now keeps Vite's default module preload, computes its figures through the shared size walks, and leaves the default text and JSON output byte-identical, so the points from the earlier review are resolved. Two small optional follow-ups:
- With module preload counted, chunk placement explains 22% of the minified gap on the menu and table pages (2,148 of 9,764 B and 2,756 of 12,285 B), so "about a fifth" describes it better than "a fifth or less".
isAppExternalstill has no test; importingreact/jsx-runtimein themeasurePageRolldownfixture would catch a pattern that stops matching and silently bundles React.
Claims and files checked
Review mode: incremental; reason: none
- Changed rules (0): none.
- Without
--bundler, the build, numbers, text and JSON are unchanged, with nobundlerkey: verified, byte-identical text and JSON against the base script on one Core build. - Only the Rolldown mode adds
"bundler": "rolldown"to the JSON: verified (scripts/measure-reference-pages.mjs:621-625, a JSON run). - A Vite app built from the same package loads 4–11% less gzip up front on the reference pages: verified, 4.8–11.0% in a run at this head.
- Part of the gap is module placement (about half on docs, a fifth or less elsewhere) and the rest is code generation and minification: verified with a note, 54% on docs, 6% on form, 22% on menu and table.
- The Rolldown build uses the same page entry with React, React DOM and StyleX external: verified (
:507-529, the shared external list). - Vite's production defaults apply, with module preload on: verified, no preload override, and the preload helper is in every page's first load.
- Options go through
build.rolldownOptionsand chunks are read from memory: verified (:522-529). - The figure is the entry chunk plus its static imports, with
import()targets not counted: verified (shared walks over static edges; tests atscripts/measure-reference-pages.test.mjs:180and:197). - Kept modules leave out a bundler's virtual helper modules: verified (
:465-469, test at:180). - Rolldown's chunks are mapped to the esbuild metafile outputs shape with externals marked, so the same shared walks give both builds' figures: verified (
:445-493). - The esbuild figures stay as a secondary table and under
esbuildin base, head and delta: verified (:88,:109-116,:186-198, a JSON run). - The PASS/FAIL gate and its JSON read the chosen bundler's gzip delta: verified (
:126-128, test at:387). - The static module graph is unchanged and comes from the input graph: verified (
:549-553). - No new dependency; the existing Vite 8 devDependency (8.3.5 installed) bundles with Rolldown: verified, root manifest, workspace catalog and lockfile unchanged.
- The per-page figures table: verified, minified bytes match exactly for both bundlers; gzip is within 0.5%.
- No package source or workflow changes: verified, two files under
scripts/. - The 22 tests pass and the new ones cover the listed cases: verified, 22 passed.
- The gate run with the same commit on both sides prints PASS: verified, PASS at +0 B.
- Stacked on #11994 and based on its branch: verified, the base branch's head is that pull request's head.
- Overlap with #11840 is limited to its
--helptext in the argument parser: verified, it touches the same two files and adds the usage text and its tests. - A Rolldown run adds one Vite build per page and side, a few seconds each, with no CI impact: verified, each run finished within seconds and no workflow changes.
- No public API, product behavior, visual direction or policy change: verified.
- Public text contains no internal context: verified.
scripts/measure-reference-pages.mjs: clear, with two non-blocking notes (an untestedisAppExternal, a no-op template literal at:177).scripts/measure-reference-pages.test.mjs: clear; its imports and cases match the script's new exports and output.
…down # Conflicts: # scripts/measure-reference-pages.mjs # scripts/measure-reference-pages.test.mjs
PR Analysis Report
Generated by PR Enrichment workflow | View current CI run |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet; it runs once the pull request is marked ready for review.
The --bundler rolldown mode keeps the default report byte-identical, measures the first load through the shared size walks with Vite's defaults, and --help now lists the flag. Two small optional follow-ups carry over:
- With module preload counted, chunk placement explains 22% of the minified gap on the menu and table pages (2,148 of 9,764 B and 2,756 of 12,285 B), so "about a fifth" describes it better than "a fifth or less".
isAppExternalstill has no test; importingreact/jsx-runtimein themeasurePageRolldownfixture would catch a pattern that stops matching and silently bundles React.
Claims and files checked
Review mode: incremental; reason: none
- Changed rules (0): none.
- Without
--bundler, the build, numbers, text and JSON are unchanged, with nobundlerkey: verified, byte-identical text and JSON against main's script on one Core build. - Only the Rolldown mode adds
"bundler": "rolldown"to the JSON: verified (scripts/measure-reference-pages.mjs:653-657, a JSON run). - A Vite app built from the same package loads 4–11% less gzip up front on the reference pages: verified, 4.8–11.0% on the description's commit and 4.9–10.6% on this head's Core.
- Part of the gap is chunk placement (about half on docs, a fifth or less elsewhere) and the rest is code generation and minification: verified with a note, 54% on docs, 6% on form, 22% on menu and table.
--bundler rolldownbuilds each page as a production Vite app, which bundles with Rolldown: verified (:499-534; Vite 8.3.5 in the lockfile).- The Rolldown build uses the same page entry with React, React DOM and StyleX external: verified (
:507-528, the shared external list throughisAppExternal). - Vite's production defaults apply, with module preload on: verified, no preload override (
:517-531). - Options go through
build.rolldownOptionsand chunks are read from memory: verified (:522-529). - The figure is the entry chunk plus its static imports, with
import()targets, assets, external packages and virtual helper modules not counted: verified (:445-493; tests atscripts/measure-reference-pages.test.mjs:181and:198). - Rolldown's chunks are mapped to the esbuild metafile outputs shape with externals marked, so the same shared walks give both builds' figures: verified (
:445-476,:484-493). - The esbuild figures stay as a secondary table and under
esbuildin base, head and delta: verified (:88,:109-116,:186-198, a JSON run). - The PASS/FAIL gate and its JSON read the chosen bundler's gzip delta: verified (
:119-130; test at:388). - The static module graph is unchanged and comes from the input graph: verified (
:549-553). - No new dependency; the existing Vite devDependency (catalog
^8.1.3, 8.3.5 installed) is used: verified, no manifest, catalog or lockfile change in the pull request. - The per-page figures table on the description's commit: verified, all eight minified figures match exactly; gzip is within 0.5%.
- No package source or workflow changes, and no CI impact: verified, two files under
scripts/. - A Rolldown run adds one Vite build per page and side, a few seconds each: verified, each run finished within seconds.
- Builds on the merged module-graph change and is based on
main: verified, that change is onmainand the base branch ismain. - The branch merges
main, and--helpfrom the merged help change now lists--bundler: verified (:581-583; test atscripts/measure-reference-pages.test.mjs:513). - The 37 tests pass and the new ones cover the listed cases: verified, 37 passed.
- The gate run with the same commit on both sides prints PASS: verified, PASS at +0 B.
- No public API, product behavior, visual direction or policy change: verified.
- Public text contains no internal context: verified.
scripts/measure-reference-pages.mjs: clear, with one non-blocking note (isAppExternalat:429-436is untested).scripts/measure-reference-pages.test.mjs: clear; its imports and cases match the script's new exports, output and help text.
Maintainer impact
A release gate should measure the JavaScript a consumer's app ships.
pnpm size:pagesbuilds each reference page with esbuild and code splitting, and a Vite app built from the same package loads 4–11% less gzip up front on the reference pages. Part of the gap is placement: esbuild puts modules into up-front chunks because unused sibling components reach them throughimport()(about half of the minified gap on the docs page, a fifth or less on the others). The rest is how each bundler generates and minifies code. Either way, the esbuild number is not what a Vite app ships.Intended invariant
Without
--bundler,pnpm size:pagesbehaves as before: same build, same numbers, same text and JSON, with nobundlerkey. The new mode is opt-in, and only it adds"bundler": "rolldown"to the JSON.Change
--bundler rolldownbuilds each reference page as a production Vite app. Vite 8 bundles with Rolldown.build.rolldownOptions, and the chunks are read from memory (write: false).import()targets load later and are not counted. The Rolldown chunks are mapped to an esbuild metafile'soutputsshape (packages left external stay marked external), so the same shared walks give both builds' figures:eagerTextandgzipBytesfrom the size helper, and this script'schunkGraphStatsandkeptModuleCount.esbuildinbase,headanddelta.--unused-on) and its JSON read the chosen bundler's gzip delta.vitedevDependency (the catalog's^8.1.3; 8.3.5 installed), which bundles with Rolldown.Evidence
Failure before the change: only esbuild-split sizes, which overstate what a Vite app ships up front.
Success after the change: on
mainat 88c4e0a, with base and head on the same commit (all deltas 0), first-load minified / gzip bytes:Product/runtime behavior verified unchanged: no package source changes.
CI impact: none; no workflow changes. A Rolldown run adds one Vite build per page and side, a few seconds each.
Scope
Components: none (repository script and its test)
Owner: Code Quality & Guardrails (Table worker). Builds on #11994 (merged); based on main.
Overlap checked: #11994 and #11840, both merged. This branch merges main, and
--help(#11840) now lists--bundler.Testing
vitest run --project node scripts/measure-reference-pages.test.mjs .github/scripts/lib/component-size.test.mjs: 37 tests pass on the merged branch. The new ones cover:rolldownPageStatson fixture output: counts the entry and its static imports, leaves out animport()target, an asset, an external package and a virtual helper module, counts kept modules, and fails without an entry chunk;measurePageRolldown, as a real Vite build of a small fixture dist: one up-front chunk, two kept modules, and the lazy module out of the first load;--bundlerparsing: the esbuild default,rolldown, and an unknown bundler refused;--helplists--bundler;node scripts/measure-reference-pages.mjs --base 88c4e0a8a7 --head 88c4e0a8a7 --bundler rolldown --unused-on table: the numbers above, with PASS.