Repository navigation
chore(scripts): one measurer for INV10's reference pages (pnpm size:pages) - #11731
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
| Before | After | Change | |
|---|---|---|---|
| Job-minutes per PR update | 173.3 | 173.3 | 0 |
| Runner pool, runner-minutes a day | 69,333 | 69,333 | 0 (0%) |
| Average concurrent jobs | 48.1 | 48.1 | 0 |
| Time to green (median → this run) | 22.3 min | 19.1 min | −3.2 min |
| Runs a day | 400 | 400 | 0 |
Not measured (the jobs that use these keep their recent minutes above): .github/scripts/lib/component-size.js.
Assumptions: before is each job's average over the last 20 pull-request runs; after keeps that for unchanged jobs and uses this run's minutes for added or changed ones, weighted by how often each changed job ran in those runs; runs a day averages the seven whole days before today; time to green compares this run with the median of those runs that ran the same jobs.
Generated by PR Enrichment workflow | View full report
|
/approve-spec 600e4c5 |
There was a problem hiding this comment.
Changes requested. pnpm size:pages gives INV10's reference pages one shared measurer, and its page list, Babel build and 307 B limit check out. Three things need fixing first:
- Gzip deltas depend on the build directory name, not only the code. With identical Core on both sides (
--base <ref>against the working tree), the per-page gzip delta ranged from −7 to +4 B, because esbuild's chunk names hash thedist-<ref>anddist-working-treepaths (scripts/measure-reference-pages.mjs:197-199). Building both sides under the same relative layout should make unchanged code read 0 B. exportSourceand theexternallist copyextractBaseSourceandbuildOptionsfromscripts/check-component-import-boundaries.mjsline for line. Move them into.github/scripts/lib/component-size.jsand call them from both scripts, so the two measurers cannot drift apart.- The description's "all three print comparable numbers" is not true. On this head, the boundaries check prints eager gzip of 12.4 KB for Text, 61.2 KB for Button and 134.2 KB for Table, while size:pages prints 10.3 KB, 59.8 KB and 133.5 KB (raw source against Babel output, and the size report bundles React), so please reword it.
Two smaller notes: a ref side compiles with the working tree's Babel config, and a --base/--head dist must hold package.json beside <Name>/index.js, which Core's own dist/ does not.
Claims and files checked
- Pages come from INV10's own sentence, and
--pageadds one: verified (real-record test; parser at lines 43-62). - Core compiles with its Babel config and the
build:esmignore list, andpackage.jsonis copied sosideEffectsapplies: verified (lines 193-234). A ref side uses the working tree's Babel config (note above). - Any Babel error stops the run: verified (lines 223-228).
- Untracked generated source comes from the working tree, as in the boundaries check: verified (lines 153-175, the same logic as that check).
- Pages are bundled with
sizeBuildOptions,eagerTextandgzipBytes, with React, React DOM and StyleX external: verified (lines 248-295). - PASS or FAIL against 307 B (KB of 1,024 bytes), exit 1 on a failure, and
--json: verified (lines 37, 88 and 355, and the tests). - No CI job: verified (no workflow change).
- INV10 gains the unit clause, and its verification row names
pnpm size:pages: verified. - All three tools print comparable numbers: false (see above).
- The same commit on both sides gives 0 B: true only with the same ref on both sides. A ref against the working tree gives −7 to +4 B.
- The Selector and DropdownMenu measurements and the 5 KB measurer disagreement: not reproduced (no refs given).
- 9 tests pass, and Prettier and ESLint pass: verified on this head.
- Files:
scripts/measure-reference-pages.mjs(three blocking findings, two notes);scripts/measure-reference-pages.test.mjs,package.jsonanddocs/architecture/component-import-boundaries.md(clear).
…th sides build in one layout
|
/approve-spec f2dbe49 |
There was a problem hiding this comment.
Changes requested. pnpm size:pages gives INV10's reference pages one shared measurer, and unchanged Core reads 0 B when both sides are refs or the working tree. One thing remains:
- A built-dist side such as
--base packages/core/distis bundled from its own parent instead of the shared<side>/distlayout (scripts/measure-reference-pages.mjs:176-186), so identical Core reads +1 B gzip on the menu and table pages, against the description's andbuildCore's "unchanged code bundles to the same bytes"; copy the dist into<side>/distwith itspackage.jsonbeside it, or narrow both sentences to ref and working-tree sides.
A non-blocking suggestion sits inline on measurePage.
Claims and files checked
- Pages come from INV10's sentence, and
--pageadds one: verified (lines 45-64 and the real-record test). - Each side compiles Core with that ref's Babel config and
build:esmignore list: verified for ref and working-tree sides (lines 131-165, 199-215). - Both sides build under the same layout, so unchanged code bundles to the same bytes: true for refs and the working tree (0 B measured); false for a built dist directory (finding above).
package.jsonsits beside the output sosideEffectsapplies: verified (lines 223-226); a dist side uses the one above it.- Any Babel error stops the run: verified (lines 217-222).
- Untracked generated source comes from the working tree: verified (
extractAtRef). - Pages bundle with the shared esbuild options, eager-chunk walk and gzip, with React, React DOM and StyleX external: verified (lines 242-283).
- PASS or FAIL against 307 B, exit 1 on a failure, and
--json: verified (lines 39, 70-94, 349 and the tests). extractAtRefandAPP_EXTERNALSare shared, and the import-boundaries check's output is unchanged: verified (identical output before and after).- Totals differ by tool by design, so compare deltas from one tool: verified.
- No CI job: verified (no workflow change).
- INV10 states its unit, and its verification row names
pnpm size:pages: verified. - Same Core on both sides gives 0 B, for one ref twice and for a ref against the working tree: verified.
- The Selector and DropdownMenu measurements and the earlier 5 KB disagreement: not reproduced (no refs given).
- The 9 new tests, the boundaries and size-helper suites, and Prettier pass: verified; ESLint exits 0, but the ESLint config ignores
scripts/**and.github/scripts/**. - No package source changes: verified.
- Files:
scripts/measure-reference-pages.mjs(finding above, plus a non-blocking note);.github/scripts/lib/component-size.js,scripts/check-component-import-boundaries.mjs,scripts/measure-reference-pages.test.mjs,package.jsonanddocs/architecture/component-import-boundaries.md(clear).
|
/approve-spec d54c9c2 |
There was a problem hiding this comment.
Approved pending CI. CI has not run on this head yet: every job skips while the pull request is a draft, so marking it ready for review runs it.
pnpm size:pages now reads 0 B on identical Core for ref, working-tree and built-dist/ sides alike, and both record edits carry an engineering owner's approval for this head. No blocking findings remain; one non-blocking suggestion sits inline on measurePage.
Claims and files checked
- Pages are read from INV10's sentence and
--pageadds one: verified (parser at lines 45-64, the real-record test, an extra-page run). - Each side compiles Core with that ref's Babel config and
build:esmignore list: verified (lines 131-165, 202-218). - Every side, a built
dist/included, sits in one layout, so unchanged code bundles to the same bytes: verified (lines 179-191; 0 B on every page for every pairing). package.jsonsits beside the output sosideEffectsapplies: verified (lines 189-190, 226-229).- Any Babel error stops the run: verified (lines 220-225).
- Untracked generated source comes from the working tree: verified (
extractAtRef). - Pages bundle with the shared esbuild options, eager-chunk walk and gzip, with React, React DOM and StyleX external: verified (lines 245-286).
- PASS or FAIL against 307 B with exit 1 on a failure, and
--json: verified (lines 39, 70-94, 352 and the tests). extractAtRefandAPP_EXTERNALSare shared, and the import-boundaries check's output is unchanged: verified (same output before and after, apart from its elapsed time).- Totals differ by tool by design, so compare deltas from one tool: verified.
- No CI job and no workflow change: verified.
- INV10 states its unit, and its verification row names
pnpm size:pages: verified. - Identical Core reads 0 B for one ref twice, a ref against the working tree, and
dist/on either or both sides: verified. - The Selector, DropdownMenu, independent-build and earlier 5 KB measurements: not reproducible here (no refs given).
- The 9 new tests, the boundaries and size-helper suites, the portable-scripts check and Prettier pass: verified; ESLint exits 0, but its config ignores
scripts/**and.github/scripts/**. - No package source or product behaviour changes: verified.
- Files:
scripts/measure-reference-pages.mjs(non-blocking note);.github/scripts/lib/component-size.js,scripts/check-component-import-boundaries.mjs,scripts/measure-reference-pages.test.mjs,package.jsonanddocs/architecture/component-import-boundaries.md(clear).
| const ENTRY_SOURCE = '__astryx-reference-page__.mjs'; | ||
|
|
||
| /** One page as a production app bundle: what it loads before first paint. */ | ||
| export async function measurePage(distDir, components) { |
There was a problem hiding this comment.
Non-blocking: this repeats measureEntry's stdin build, entry-output lookup, textByPath map and eagerText/gzipBytes step in scripts/check-component-import-boundaries.mjs (lines 383-447). The options, externals and eager-chunk walk are already shared, so the two agree today; a build-and-measure helper in .github/scripts/lib/component-size.js that takes a list of exports would keep that glue in one place too.
…ce-pages # Conflicts: # docs/architecture/component-import-boundaries.md
|
/approve-spec 11a3fec |
There was a problem hiding this comment.
Changes requested. pnpm size:pages reads 0 B on identical Core and both record edits carry an engineering owner's approval for this head, but the merge of main broke the import-boundaries check.
- Regression: removing
import {execFileSync} from 'node:child_process'fromscripts/check-component-import-boundaries.mjsnow leaves the base-record read thatmainadded (line 1056) unbound, so every--base-refrun, the Lint workflow's included, prints "Must-not-reach base skipped" and never lists a "Must not reach" row a pull request removes, which INV9 requires; keeping the import fixes it.
The inline comment on that import line explains the reproduction, and the non-blocking suggestion on measurePage stays open inline. CI has not run on this draft head.
Claims and files checked
Review mode: same-head; reason: none
- Pages are read from INV10's sentence and
--pageadds one: verified (parseReferencePages, lines 45-64, and the real-record test). - Each side compiles Core with that ref's Babel config and
build:esmignore list: verified (lines 131-165, 202-218). - Every side sits in one layout, so unchanged code bundles to the same bytes: verified (lines 176-192; the base commit against the working tree reads +0 / +0 on all four pages).
package.jsonsits beside the output sosideEffectsapplies: verified (lines 190, 226-229).- Any Babel error stops the run: verified (lines 219-225).
- Untracked generated source comes from the working tree: verified (
extractAtRefin the shared helper; the working-tree side copies its ownsrc). - Pages bundle with the shared esbuild options, eager-chunk walk and gzip, with React, React DOM and StyleX external: verified (lines 245-286).
- PASS or FAIL against 307 B with exit 1 on a failure, and
--json: verified (lines 39, 70-94, 352 and the tests). extractAtRefandAPP_EXTERNALSare shared by both scripts: verified.- The boundaries check's output is unchanged, including with
--base-ref: false at this head (it now prints a skip line and drops the removed-row report; see the finding above). - Totals differ by tool by design, so compare deltas from one tool: verified.
- No CI job and no workflow change: verified.
- INV10 states its unit, and its verification row names
pnpm size:pages: verified. - Identical Core reads 0 B: verified for a ref against the working tree at this head; the built-
dist/path is unchanged since it was verified. - The Selector, DropdownMenu, independent-build and earlier 5 KB measurements: not reproducible here (no refs given).
- The 9 new tests and the boundaries and size-helper suites pass: verified (55 of 55); Prettier is clean; ESLint ignores
scripts/**and.github/scripts/**. - No package source or product behaviour changes: verified.
- Files:
scripts/check-component-import-boundaries.mjs(blocking);scripts/measure-reference-pages.mjs(non-blocking note);.github/scripts/lib/component-size.js,scripts/measure-reference-pages.test.mjs,package.jsonanddocs/architecture/component-import-boundaries.md(clear).
|
/approve-spec a7912b1 |
…cord read main added
|
/approve-spec 433878b |
There was a problem hiding this comment.
Approved pending CI. CI has not run on this head yet: every job skips while the pull request is a draft, so marking it ready for review runs it. pnpm size:pages reads +0 / +0 on identical Core for ref, working-tree and built dist/ sides, the import-boundaries check again prints the same report as on the base (removed "Must not reach" rows included), and both record edits carry an engineering owner's approval for this head.
One non-blocking suggestion stays open inline: measurePage could share the boundaries check's build-and-measure glue through the size helper.
Claims and files checked
Review mode: full; reason: merge-touches-pr-files
- The pages are read from INV10's sentence, and
--pageadds one: verified (parseReferencePages, lines 45-64, and the real-record test). - Each side compiles Core with that ref's Babel config and
build:esmignore list: verified (lines 131-165, 202-218; the arguments match Core'sbuild:esm). - Every side sits in one layout, so unchanged code bundles to the same bytes: verified (lines 176-192; +0 / +0 for ref, working-tree and
dist/sides). - Core's
package.jsonsits beside the output sosideEffectsapplies: verified (lines 190, 226-229; Core's globs all start with**/). - Any Babel error stops the run: verified (lines 219-225).
- Untracked generated source comes from the working tree: verified (
extractAtRefin the shared helper). - Pages bundle with the shared esbuild options, eager-chunk walk and gzip, with React, React DOM and StyleX external: verified (lines 245-286).
- The report prints minified and gzip bytes, base, head and delta: verified (
formatComparisonand the runs). - PASS or FAIL against 307 B (1 KB = 1,024 B, as the boundaries check prints KB), exit 1 on a failure, and
--json: verified (lines 39, 70-94, 352 and the tests). extractAtRefandAPP_EXTERNALSare shared by both scripts: verified.- The boundaries check's output is unchanged: verified (identical to the base revision of the check, with and without a removed "Must not reach" row).
- Totals differ by tool by design, so compare deltas from one tool: verified.
- No CI job and no workflow change: verified.
- INV10 states its unit, and its verification row names
pnpm size:pages: verified. - Identical Core reads 0 B, and Core's built
dist/matches a fresh build of the same commit: verified. - The Selector, DropdownMenu, independent-build and earlier 5 KB measurements: not reproducible here (no refs given).
- The 9 new tests and the boundaries and size-helper suites pass: verified (55 of 55); Prettier is clean; the portable-scripts rule finds no offence in the root scripts; ESLint ignores
scripts/**and.github/scripts/**. - No package source or product behaviour changes: verified.
- Files:
scripts/measure-reference-pages.mjs(non-blocking note);scripts/measure-reference-pages.test.mjs,.github/scripts/lib/component-size.js,scripts/check-component-import-boundaries.mjs,package.jsonanddocs/architecture/component-import-boundaries.md(clear).
Maintainer impact
architecture:component-import-boundariesINV10 asks a pull request to report first-load gzip deltas on four reference pages (docs, form, menu, table). Until now each author or reviewer built their own measurer. The numbers then disagree by build method: whether Core is compiled as published, whether itssideEffectsapplies, the gzip level, and which packages stay external. A pull request near INV10's 0.3 KB limit can pass with one measurer and fail with another.Intended invariant
.github/scripts/lib/component-size.js. This script uses the same helper: its esbuild options, its externals (React, React DOM and StyleX, as the boundaries check) and its extraction of a ref's source. Totals still differ by design: the boundaries check bundles Core's raw source, this script bundles Babel output as published (INV10's "built packages"), and the size report also bundles React. So compare deltas from one tool, not totals across tools.Change
pnpm size:pages(scripts/measure-reference-pages.mjs):--page name=A,Badds a page, for a shared module none of the four reaches, as INV10 allows.dist/), it compiles Core'ssrcwith that ref's Babel config andbuild:esm's ignore list (read from that ref's package.json), so StyleX compiles as published. Both sides build (or, for a dist directory, are copied with their package.json) under the same relative layout, so unchanged code bundles to the same bytes. It copies Core'spackage.jsoninto the dist, sosideEffectsapplies as it does for an app. Any Babel error stops the run, because a partial build gives plausible but wrong sizes. Generated source that git does not track comes from the working tree, as in the import-boundaries check.sizeBuildOptionsandeagerText/gzipBytesfrom the shared helper, with React, React DOM and StyleX external as in the boundaries check. It prints first-load minified and gzip bytes, base and head, and the delta per page.--unused-on <page,…>prints PASS or FAIL per named page against the 0.3 KB limit (307 B, KB = 1024 B, as the boundaries check prints KB) and exits 1 on a failure.--jsonprints the same as JSON.extractAtRef) and the app externals (APP_EXTERNALS) move from the boundaries check intocomponent-size.js, and both scripts call them, so the two measurers cannot drift apart. The boundaries check's output is unchanged.pnpm size:pagesas the source of the per-page report, and INV10 states its unit: "0.3 KB gzip (KB as the boundary check prints it, 1,024 bytes)".Evidence
sideEffects.dist/on both sides. Core's builtdist/and a fresh build of the same commit print the same sizes.--page typeahead=Typeahead --page tokenizer=Tokenizer: Typeahead +902 / +343 B, Tokenizer +927 / +303 B, the four reference pages 0 to +3 B.Scope
Components: none (repository script and its test;
package.jsonscript entry; the shared size helper and the boundaries check's use of it; the INV10 record's verification row and unit clause)Writing rubric results
Record changed:
architecture:component-import-boundaries. INV10 gains one clause stating its unit ("KB as the boundary check prints it, 1,024 bytes"). The INV10 verification row's evidence now namespnpm size:pagesas the report's source.Testing
vitest run --project node scripts/measure-reference-pages.test.mjs: 9 tests. They cover the parser against the real record and a synthetic one, the missing-INV10 and no-page errors, the delta math, the 307 B boundary (pass at 307, fail at 308), the report line, and argument parsing.pnpm size:pages --base HEAD --head .(identical Core): 0 B on every page.vitest run --project node scripts/check-component-import-boundaries.test.mjs .github/scripts/lib/component-size.test.mjs: pass;pnpm check:component-import-boundaries --base-ref HEAD: unchanged output, boundaries hold.check:portable-scripts, Prettier, ESLint: pass.