Skip to content

chore: land 3 reviewed pull requests together (batch 71) - #12964

Open
josephfarina wants to merge 8 commits into
mainfrom
josephfarina/land-batch-71
Open

josephfarina wants to merge 8 commits into
mainfrom
josephfarina/land-batch-71

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Merges three reviewed pull requests onto current main, each as its own --no-ff merge, in this order. #12345 → #12752 → #12761 form a stack, each layer built on the one before it. Each member keeps its own description, tests and review history; the stack's pass line is on every layer.

Scope

Tests: a copy of the main-red fix #13001 (a lab__MediaPlayer swizzle sample), so this batch's test shards run green on today's main.

Components: CLI experimental export. The exported file's script reads an image shown through src, srcset or poster from the first paint when the page's code names it as a whole string, so the file holds such an image one time fewer (#12345). The first paint names each repeated list of Astryx's StyleX classes by one short alias, only for classes that the kept CSS of Core or @astryxdesign/* stylesheets names; a page's own classes and any class an attribute selector on class can match keep their names; render() gains the experimental keepClassNames option, refused with reverse (#12752). The page's script is a module script (#12761). Every test page the stack adds imports Core's stylesheet or a Core component.

Records

None beyond the owner decisions recorded on #12345 and #12752, and the /approve-spec at each layer's head and at this head.

Writing rubric results

No record changes, so R1–R7 do not apply.

When this merges, each pull request above is closed with a note that names this one.

@vercel

vercel Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 19, 2026 9:15pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 19, 2026
@astracat-bot

astracat-bot Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🔄 In progress (for maintainers only) Nov 19, 2026, 9:11 PM UTC

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 063d91d
Covers the owner decisions on #12345 (the script reads each carried image from the first paint, one copy fewer) and #12752 (class aliases for Astryx package classes only; experimental keepClassNames, refused with reverse, no CLI flag), and #12761's module script.

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 063d91d

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes requested for one false sentence in the description. The code, tests and changesets check out.

  • The description says every test page the stack adds imports Core's stylesheet, but the new keep-class-names page and the 400-button alias page in packages/cli/api/render/render.interactive.test.mjs (lines 1248 and 1273) and the new page in apps/docsite/src/__tests__/landing-template-previews.test.ts (line 165) import only Core's Button, so please reword it (for example "imports Core's stylesheet or a Core component") or add the stylesheet import to those pages.

Two test notes do not block: packages/cli/api/render/render.test.mjs:1217 still finds the page script with lastIndexOf('<script>'), which on a module page lands on a string inside the bundle, and the pageDom() header promises a strict mode that JSDOM does not enforce. Exported pages look identical before and after, with scripts blocked and running, while a 400-card page shrinks by about 42% and a photo page by one copy of its image.

Claims and files checked

Review mode: full; reason: no-earlier-review

  • Claim: three reviewed pull requests merge onto current main as separate merges, in stack order. Verified: each merge is a clean merge of that member's head.
  • Claim: the three form a stack, each built on the one below, with the preflight pass line on every layer. Verified.
  • Claim: the script reads a first-paint image the code names as a whole string, so the file holds it one time fewer. Verified by the tests and a photo page that drops by one copy of its image.
  • Claim: aliases apply only to classes the kept Core or official package stylesheets name, and page classes and attribute-selected classes keep their names. Verified in the code and tests.
  • Claim: the experimental render function gains a keep-class-names option that reverse refuses. Verified.
  • Claim: the page's script is a module script. Verified, with the changeset's exception for sloppy CommonJS and current-script readers.
  • Claim: every test page the stack adds imports Core's stylesheet. False: three pages import only Core's Button.
  • Claim: no records change beyond the owner decisions and the spec approvals at each layer and this head. Verified.
  • Claim: the writing rubric does not apply because no record changes. Verified.
  • Claim: each member closes with a note when this merges. A later step, not checkable at this head.
  • Changeset (one copy fewer): an image shown through src, srcset or poster and named whole is read from the first paint, an https image is held once, and the first paint is unchanged with scripts blocked. Verified by tests, sizes and identical frames; the quoted megabyte figures are the author's page.
  • Changeset (class aliases): repeated package class lists become one short class once they add up to 16 KB, page classes keep their names, the look is unchanged with scripts blocked, the script draws with the real classes, reverse is exact, and restyling callers can keep the names. Verified; the 10,000-row grid figure is the author's.
  • Changeset (module script): the script is a module when it runs the same in strict mode, and sloppy CommonJS or current-script pages keep a classic script. Verified; the phone timing is the author's measurement.
  • File .changeset/render-class-aliases.md: clear.
  • File .changeset/render-image-once-markup.md: clear.
  • File .changeset/render-module-script.md: clear.
  • File apps/docsite/scripts/generate-landing-template-previews.mjs: clear.
  • File apps/docsite/src/__tests__/landing-template-previews.test.ts: its new page imports only Core's Button (the description claim).
  • File packages/cli/api/render/_adapter.mjs: clear.
  • File packages/cli/api/render/render.doc.mjs: clear.
  • File packages/cli/api/render/render.interactive.test.mjs: two new pages import only Core's Button (the description claim).
  • File packages/cli/api/render/render.mjs: clear.
  • File packages/cli/api/render/render.notes.test.mjs: clear.
  • File packages/cli/api/render/render.test.mjs: non-blocking (line 1217 no longer finds the page's script tag).
  • File packages/cli/api/render/render.type.mjs: clear.
  • File packages/cli/foundation/doc-compiler/doc-loads.test.mjs: clear.
  • File packages/cli/foundation/render/class-alias.mjs: clear.
  • File packages/cli/foundation/render/class-alias.test.mjs: clear.
  • File packages/cli/foundation/render/client-bundle.mjs: clear.
  • File packages/cli/foundation/render/html-reader.mjs: clear.
  • File packages/cli/foundation/render/page-worker.mjs: clear.
  • File packages/cli/foundation/render/remote-images.test.mjs: clear.
  • File packages/cli/foundation/render/render-page.mjs: clear.
  • File packages/cli/foundation/render/render.test.mjs: clear.
  • File packages/cli/test-utils/page-dom.mjs: non-blocking (its strict-mode promise does not hold under JSDOM).

Automated review (maintainer link)

* runs them. JSDOM runs classic scripts but not module scripts, and a
* rendered page's script is an inline module: this runs each inline module
* once the document is parsed (readyState interactive, before
* DOMContentLoaded), in strict mode, with no `this` at its top

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Non-blocking: under JSDOM this wrapper does not enforce strict mode. A module that runs undeclaredName = 1 finishes with no error event and the name lands on window. So a test using pageDom() cannot catch a sloppy module that gets a module script; the header could say that.

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec f242b86
Covers the owner decisions on #12345 (the script reads each carried image from the first paint, one copy fewer) and #12752 (class aliases for Astryx package classes only; experimental keepClassNames, refused with reverse, no CLI flag), and #12761's module script.

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec f242b86

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved pending CI: CI has not finished on this head yet.

The one blocking point from the last review is fixed: the description now says every test page the stack adds imports Core's stylesheet or a Core component, and all 32 pages do. The code is unchanged since that review, and the changed render tests pass on this head. Two test notes still do not block: packages/cli/api/render/render.test.mjs:1217 finds the page script with lastIndexOf('<script>'), which on a module page lands on a string inside the bundle, and the pageDom() header in packages/cli/test-utils/page-dom.mjs promises a strict mode that JSDOM does not enforce for an undeclared write.

Claims and files checked

Review mode: incremental; reason: none

  • Claim: three reviewed pull requests merge onto main as separate merges, in stack order. Verified: each merge commit's parent is that member's head, and the head still merges cleanly into the newest main.
  • Claim: the three form a stack, each built on the one below, with the pass line on every layer. Verified from the member pull requests and their commits.
  • Claim: the bullet titles are the member titles. Verified.
  • Claim: the script reads a first-paint image the code names as a whole string, so the file holds it one time fewer. Verified by the tests and a photo page that drops by one copy of its image.
  • Claim: aliases apply only to classes the kept Core or official package stylesheets name, and page classes and attribute-selected classes keep their names. Verified in the code and tests.
  • Claim: the experimental render function gains a keep-class-names option that reverse refuses. Verified.
  • Claim: the page's script is a module script. Verified, with the changeset's exception for sloppy CommonJS and current-script readers.
  • Claim: every test page the stack adds imports Core's stylesheet or a Core component. Verified: 29 of the 32 pages import the stylesheet and 3 import Core's Button.
  • Claim: no records change beyond the owner decisions and the spec approvals at each layer and this head. Verified.
  • Claim: the writing rubric does not apply because no record changes. Verified.
  • Claim: each member closes with a note when this merges. A later step, not checkable at this head.
  • Changeset (one copy fewer): an image shown through src, srcset or poster and named whole is read from the first paint, an https image is held once, and the first paint is unchanged with scripts blocked. Verified by tests, sizes and identical frames; the quoted megabyte figures are the author's page.
  • Changeset (class aliases): repeated package class lists become one short class once they add up to 16 KB, page classes keep their names, the look is unchanged with scripts blocked, the script draws with the real classes, reverse is exact, and restyling callers can keep the names. Verified; the 10,000-row grid figure is the author's.
  • Changeset (module script): the script is a module when it runs the same in strict mode, and sloppy CommonJS or current-script pages keep a classic script. Verified; the phone timing is the author's measurement.
  • File .changeset/render-class-aliases.md: clear.
  • File .changeset/render-image-once-markup.md: clear.
  • File .changeset/render-module-script.md: clear.
  • File apps/docsite/scripts/generate-landing-template-previews.mjs: clear.
  • File apps/docsite/src/__tests__/landing-template-previews.test.ts: clear.
  • File packages/cli/api/render/_adapter.mjs: clear.
  • File packages/cli/api/render/render.doc.mjs: clear.
  • File packages/cli/api/render/render.interactive.test.mjs: clear.
  • File packages/cli/api/render/render.mjs: clear.
  • File packages/cli/api/render/render.notes.test.mjs: clear.
  • File packages/cli/api/render/render.test.mjs: non-blocking (line 1217 no longer finds the page's script tag).
  • File packages/cli/api/render/render.type.mjs: clear.
  • File packages/cli/foundation/doc-compiler/doc-loads.test.mjs: clear.
  • File packages/cli/foundation/render/class-alias.mjs: clear.
  • File packages/cli/foundation/render/class-alias.test.mjs: clear.
  • File packages/cli/foundation/render/client-bundle.mjs: clear.
  • File packages/cli/foundation/render/html-reader.mjs: clear.
  • File packages/cli/foundation/render/page-worker.mjs: clear.
  • File packages/cli/foundation/render/remote-images.test.mjs: clear.
  • File packages/cli/foundation/render/render-page.mjs: clear.
  • File packages/cli/foundation/render/render.test.mjs: clear.
  • File packages/cli/test-utils/page-dom.mjs: non-blocking (its strict-mode promise does not hold for an undeclared write under JSDOM).

Automated review (maintainer link)

@josephfarina
josephfarina force-pushed the josephfarina/land-batch-71 branch from f242b86 to 0801b09 Compare November 19, 2026 19:12
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 0801b09
Covers the owner decisions on #12345 (the script reads each carried image from the first paint, one copy fewer) and #12752 (class aliases for Astryx package classes only; experimental keepClassNames, refused with reverse, no CLI flag), and #12761's module script.

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 0801b09

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved pending CI: CI has not finished on this head yet.

This head rebuilds the batch on current main with the same changes as before, and nothing blocks. Each change is covered by the engineering owner's decisions and the /approve-spec at this head, and the render tests, the render browser cases and the template round trips pass here. One small test cleanup is worth doing, but it does not block:

  • packages/cli/api/render/render.test.mjs:1217 slices from lastIndexOf('<script>'), which now lands inside React DOM's "<script><\/script>" string rather than at the page's <script type="module"> tag, so that check skips the start of the script; slicing from '-->\n<script', as scriptOf in render.interactive.test.mjs does, would fix it.
Claims and files checked

Review mode: full; reason: rebase

  • Claim: three reviewed pull requests merged onto current main, each as its own merge, in stack order: verified from the merge commits.
  • Claim: the three members form a stack, each built on the one before: verified from the commit parents and the members' Stack line.
  • Claim: each member keeps its description and pass line: verified on all three (the pass line names the member's head before this rebuild).
  • Claim: the script reads an image shown through src, srcset or poster from the first paint, one copy fewer: verified (render-page.mjs, interactive and remote-image tests, a photo page with one data URI).
  • Claim: aliases only for Core and official package classes, never for page classes or classes an attribute selector can match: verified (class-alias.mjs, class-alias.test.mjs).
  • Claim: render() gains experimental keepClassNames, refused with reverse: verified (render.mjs:33, :59, interactive test).
  • Claim: the page's script is a module script: verified, with the changeset's classic-script exceptions.
  • Claim: every test page the stack adds imports Core's stylesheet or a Core component: verified over all 22 added page sources.
  • Claim: no records beyond the owner decisions and the spec approvals at each layer's head and this head: verified.
  • Changesets (aliases, first-paint images, module script): verified; the MB and timing figures are the author's measurements.
  • Files clear: .changeset/render-class-aliases.md, .changeset/render-image-once-markup.md, .changeset/render-module-script.md, apps/docsite/scripts/generate-landing-template-previews.mjs, apps/docsite/src/__tests__/landing-template-previews.test.ts, packages/cli/api/render/_adapter.mjs, packages/cli/api/render/render.doc.mjs, packages/cli/api/render/render.interactive.test.mjs, packages/cli/api/render/render.mjs, packages/cli/api/render/render.notes.test.mjs, packages/cli/api/render/render.type.mjs, packages/cli/foundation/doc-compiler/doc-loads.test.mjs, packages/cli/foundation/render/class-alias.mjs, packages/cli/foundation/render/class-alias.test.mjs, packages/cli/foundation/render/client-bundle.mjs, packages/cli/foundation/render/html-reader.mjs, packages/cli/foundation/render/page-worker.mjs, packages/cli/foundation/render/remote-images.test.mjs, packages/cli/foundation/render/render-page.mjs, packages/cli/foundation/render/render.test.mjs.
  • Files with a non-blocking note: packages/cli/api/render/render.test.mjs (line 1217, above); packages/cli/test-utils/page-dom.mjs (its header says it runs module scripts in strict mode, but under JSDOM an undeclared write still does not throw).

Automated review (maintainer link)

@github-actions

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 0801b09

Storybook · Sandbox · built from this PR's head

Package size: @astryxdesign/cli 5.68 MB packed (+16.5 kB); no new dependencies.

API changes: cli +1 · ~0 · −0

1 API change (advisory)
Package Where Signature Usage
+ cli ./api/experimental · Types · type RenderOptions keepClassNames?: boolean | undefined import type {RenderOptions} from '@astryxdesign/cli/api/experimental'; const x: RenderOptions = {keepClassNames: …}

Not run on this PR: add ci:run-visual for Visual, ci:run-a11y for Accessibility, ci:run-rtl for RTL.


Generated by PR Enrichment workflow | View full report

…m the first paint

A file carried each image its first paint shows twice: as a data: URI in
the markup and again in the page's script. The markup now numbers each
value it carries (data-astryx-carried, written once per img, source,
input or video element after its last attribute), and the script reads
those values from the first paint before the page mounts. A local path
the script holds as a whole string becomes that read; an https address
stays as the page wrote it, and the image sinks read its data from the
first paint instead of holding a second copy.

Only elements a browser builds carry anything the script reads. The HTML
scanner reads raw text, comments, CDATA, tag names, self-closing tags,
and svg and MathML content as the HTML tokenizer and tree builder do;
noscript, template and select content marks nothing; and the first
markup shape a serializer never writes (a mis-nested end tag, CDATA, a
bogus comment, a comment holding --!>, a non-void self-closing tag,
plaintext, frameset, or a stray tag in a select) stops the marks for the
rest of the text, so every later image keeps its own copy.

[skip ci]
…tryx's StyleX classes by one alias

A page that repeats an element repeats its StyleX class list each time,
and those lists are most of a large page's markup. Each repeated list of
the StyleX classes Astryx's packages write becomes one short alias class
in the first paint (the page's own classes keep their names), and
every rule that names one of its classes also names the alias in the same
place, so the alias matches exactly where the classes match. Only the
first paint changes; the page's script draws its own elements with the
classes StyleX wrote, and the page comes back exactly.

[skip ci]
@josephfarina
josephfarina force-pushed the josephfarina/land-batch-71 branch from 0801b09 to fd10096 Compare November 19, 2026 20:20
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec fd10096
Covers the owner decisions on #12345 (the script reads each carried image from the first paint, one copy fewer) and #12752 (class aliases for Astryx package classes only; experimental keepClassNames, refused with reverse, no CLI flag), and #12761's module script.

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec fd10096

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved pending CI: CI has not finished on this head yet.

This head rebuilds the batch on a newer main, and the only new lines fit it to main's one-colour-mode themes; nothing blocks. Each change is covered by the engineering owner's decisions and the /approve-spec at this head, and the render tests, the render browser cases (including main's colour-mode cases) and the template round trips pass here. One small test cleanup is worth doing, but it does not block:

  • packages/cli/api/render/render.test.mjs:1406 slices from lastIndexOf('<script>'), which now lands inside React DOM's "<script><\/script>" string rather than at the page's <script type="module"> tag, so that check skips the start of the script; slicing from '-->\n<script', as scriptOf in render.interactive.test.mjs does, would fix it.
Claims and files checked

Review mode: full; reason: rebase

  • Claim: three reviewed pull requests merged onto current main, each as its own merge, in stack order: verified from the merge commits.
  • Claim: the three members form a stack, each built on the one before: verified from the commit parents and the members' Stack line.
  • Claim: each member keeps its description and pass line: verified on all three (the pass line names an older head of the top member).
  • Claim: the script reads an image shown through src, srcset or poster from the first paint, one copy fewer: verified (render-page.mjs, interactive and remote-image tests, a photo page with one data URI).
  • Claim: aliases only for Core and official package classes, never for page classes or classes an attribute selector can match: verified (class-alias.mjs, class-alias.test.mjs).
  • Claim: render() gains experimental keepClassNames, refused with reverse: verified (render.mjs:33, :58, interactive test).
  • Claim: the page's script is a module script: verified, with the changeset's classic-script exceptions.
  • Claim: every test page the stack adds imports Core's stylesheet or a Core component: verified over all 22 added page sources.
  • Claim: no records beyond the owner decisions and the spec approvals at each layer's head and this head: verified.
  • Changesets (aliases, first-paint images, module script): verified; the MB and timing figures are the author's measurements.
  • Files clear: .changeset/render-class-aliases.md, .changeset/render-image-once-markup.md, .changeset/render-module-script.md, apps/docsite/scripts/generate-landing-template-previews.mjs, apps/docsite/src/__tests__/landing-template-previews.test.ts, packages/cli/api/render/_adapter.mjs, packages/cli/api/render/render.doc.mjs, packages/cli/api/render/render.interactive.test.mjs, packages/cli/api/render/render.mjs, packages/cli/api/render/render.notes.test.mjs, packages/cli/api/render/render.type.mjs, packages/cli/foundation/doc-compiler/doc-loads.test.mjs, packages/cli/foundation/render/class-alias.mjs, packages/cli/foundation/render/class-alias.test.mjs, packages/cli/foundation/render/client-bundle.mjs, packages/cli/foundation/render/html-reader.mjs, packages/cli/foundation/render/page-worker.mjs, packages/cli/foundation/render/remote-images.test.mjs, packages/cli/foundation/render/render-page.mjs (its style line now fits main's colour-mode code), packages/cli/foundation/render/render.test.mjs.
  • Files with a non-blocking note: packages/cli/api/render/render.test.mjs (line 1406, above); packages/cli/test-utils/page-dom.mjs (its header says it runs module scripts in strict mode, but under JSDOM an undeclared write still does not throw).

Automated review (maintainer link)

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 86e947e

A classic script at the end of the body runs as soon as the parser
reaches it. On a page small enough to arrive at once, that is before the
browser first paints, so the first paint waited for the script. A module
script runs once the document is parsed, so the browser paints the
markup first.

A module script runs in strict mode, so the script is one only when it
runs the same there: a module parse accepts it, and every file in it
that is not an ES module asks for strict mode itself. A page that
bundles a CommonJS package written for sloppy mode keeps a classic
script. The tests run a page's module script with a JSDOM helper in
test-utils (JSDOM runs only classic scripts); the docsite's landing
previews strip either script.

[skip ci]
@josephfarina
josephfarina force-pushed the josephfarina/land-batch-71 branch from 86e947e to 89e9241 Compare November 19, 2026 21:03
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 89e9241

This branch was successfully deployed

1 active deployment
Preview — 89e92414 Deployed Nov 19, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant