Skip to content

ci: typecheck lab, charts, rich text and Vega with their tests, like core - #8318

Merged
cixzhang merged 2 commits into
meta:mainfrom
vjeux:uikit/f3-ci-typecheck-gates
Oct 25, 2026
Merged

cixzhang merged 2 commits into
meta:mainfrom
vjeux:uikit/f3-ci-typecheck-gates

Conversation

@vjeux

@vjeux vjeux commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Depends on #8313: until it merges, this branch carries its commit, and lab's typecheck needs it. Review the last commit.

Maintainer impact

A type error in the sources or tests of @astryxdesign/lab, charts, richtext or vega merges without a red check. CI's typecheck job and the push gate's typecheck lane run only these packages' typecheck:docs, which covers their .doc.mjs files; core alone also runs its full typecheck. Lab's MobileTokenizer.test.tsx merged with an error this way (TS2348, fixed in #8313), and anyone running pnpm -F @astryxdesign/lab typecheck hit it on main.

Intended invariant

Every component package's own sources and tests typecheck in both typecheck lanes, as core's do since #3197: a type error fails the required build join (and the release check) instead of landing on main.

Change

  • ci.yml typecheck job: Typecheck lab / charts / rich text / Vega (including tests) after Typecheck core (including tests), with the same specialized-lane guard. No new job, scope or join: typecheck already runs for every non-specialized change and feeds build.
  • deploy.yml typecheck lane: the same four gates after core's.
  • ci-test-routing.test.mjs: both workflows must run pnpm -F @astryxdesign/<package> typecheck (the exact command, so typecheck:docs does not count) for core, lab, charts, richtext and vega, guarded like core's.

Cost: 1–8 s per package on a large machine. The typecheck job (about 4.5 min, mostly the build) runs beside build-storybook and stays off the critical path.

Evidence

  • Failure before the change: the new routing cases fail on main's workflows ("ci.yml does not typecheck lab", and the same for deploy.yml). On main, pnpm -F @astryxdesign/lab typecheck exits 2.
  • Success after the change: with test(lab): MobileTokenizer's create harness types its spy as a callable #8313, all four typechecks pass after pnpm build (lab 8 s, charts 2 s, rich text 5 s, Vega 1 s); the routing cases pass.
  • Product/runtime behavior verified unchanged: workflow and test files only.

Scope

  • No intended public API, product behavior, visual direction, or policy change.
  • Product changes discovered during the work were removed or split.
  • Public text and artifacts contain no internal Meta context.

Testing

  • pnpm exec vitest run .github/scripts: 1,229 passed; with the workflow edits reverted, the two new cases fail.
  • pnpm build, then pnpm -F @astryxdesign/{lab,charts,richtext,vega} typecheck: all exit 0.
  • Prettier on the touched files and the pre-commit repo checks: clean.

vjeux added 2 commits October 24, 2026 15:13
`pnpm -F @astryxdesign/lab typecheck` failed on main: the create harness
typed its spy as `ReturnType<typeof vi.fn>`, which vitest 4.1 types as
`Mock<Procedure | Constructable>`, a mock TypeScript won't call
(`spy(items, change)`: TS2348). The harness now takes the same callable
type as the file's other harness; `vi.fn()` still fits it.
…core

CI and the push gate ran only these packages' typecheck:docs, which covers
their .doc.mjs files, so a type error in their sources or tests merged
unseen (lab's MobileTokenizer.test.tsx). Both typecheck lanes now run each
package's full typecheck after the build, with core's specialized-lane guard
in ci.yml, and a routing test requires every component package's full
typecheck in both workflows.
@vercel

vercel Bot commented Oct 24, 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 Oct 24, 2026 10:46pm UTC

Request Review

@astracat-bot

astracat-bot Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Oct 24, 2026, 11:32 PM UTC

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

@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.

This change looks ready to merge: the four new full typechecks join the existing typecheck job and push-gate lane without adding a lane or required check, they pass on this head, and the new routing case fails if any of them is removed or loses core's guard. One optional follow-up: take the routing case's package list from COMPONENT_PACKAGE_NAMES, which the file already imports, so a future component package is covered automatically. The branch carries #8313's commit, so either pull request can merge first.

[Automated review]

// Each component package's own sources and tests, in both typecheck lanes:
// typecheck:docs covers only its .doc.mjs files, so a type error in a test
// otherwise lands on main unseen (lab's MobileTokenizer.test.tsx did).
const packages = ['core', 'lab', 'charts', 'richtext', 'vega'];

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.

Optional hardening: this list duplicates COMPONENT_PACKAGE_NAMES, which this file already imports (line 30) and uses to require an RTL shard for every package. Taking it from the registry keeps this case's "every component package" promise true when a package is added:

const packages = COMPONENT_PACKAGE_NAMES;

@github-actions

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR

🧪 Sandbox Preview

View Sandbox for this PR

Modified Components

MobileTokenizer (@astryxdesign/lab) · View in Storybook
Metric Before After Delta
Entry File (ESM) 328B 328B 0B
Lines of Code 598 598 -
Complexity Very High Very High (64) -

Bundle Size Summary

Gzip figures measure each package's entry file, not the code an import pulls in.

Package Entry (ESM) Entry gzip before Entry gzip after Delta
@astryxdesign/lab 4.6KB 1.9KB 1.9KB 0B

Accessibility Audit

Status: No accessibility violations detected.

Visual Regression

46 of 502 shot(s) changed.

A change here is a question, not a failure: check whether the after is the
picture you intended. Record that review on the PR. Baseline maintenance is an
explicit dispatch of CI; this report never rewrites the baseline or adds a release gate.

component story theme mode pixels
Selector Indicator Space Bottom Sheet Narrow End RTL neutral light 753,933
Selector Indicator Space Bottom Sheet Wide Start neutral light 740,072
RichTextEditor Markdown parity: side by side probe dark 556,900
RichTextEditor Markdown parity: side by side probe light 538,816
Chat Full AI Chat probe light 230,823
Chat Full AI Chat probe dark 229,805
Collapsible Dividers probe dark 66,445
Collapsible Dividers probe light 66,445
Chat Default neutral dark 36,304
Chat Default neutral light 35,767
Chat Empty State probe light 23,531
Chat Empty State probe dark 22,622
ChatAutoScroll Scroll Behavior Comparison neutral dark 15,378
ChatAutoScroll Scroll Behavior Comparison neutral light 14,107
Chat With Attachments probe light 13,406
Chat With Attachments probe dark 11,232
ProgressBar With Target Mark probe dark 7,895
ProgressBar With Target Mark probe light 7,895
Markdown Default neutral dark 7,573
Markdown Default neutral light 7,566

and 26 more.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@cixzhang
cixzhang merged commit 0a9814a into meta:main Oct 25, 2026
64 checks passed
@vjeux
vjeux deleted the uikit/f3-ci-typecheck-gates branch October 25, 2026 02:57

This branch was successfully deployed

1 active deployment
Preview — 9863dff7 Deployed Oct 24, 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.

2 participants