Skip to content

test(node): prebuilt Core and the docs modules load natively in the node project - #8752

Merged
cixzhang merged 2 commits into
meta:mainfrom
vjeux:uikit/f1-node-core-native
Oct 27, 2026
Merged

cixzhang merged 2 commits into
meta:mainfrom
vjeux:uikit/f1-node-core-native

Conversation

@vjeux

@vjeux vjeux commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Review only this PR's change: vjeux/astryx@3ffb646...c20d7ca

Maintainer impact

Two node-project cases time out at their 30 s budget in loaded full runs and pass alone, for one reason: Vitest inlines, through its transform, modules that Node loads as they are.

  • resolve-theme.test.mjs › "loads a real built local default with an icon registry" (about 10.6 s alone): its theme build imports Core's root entry, all of Core and React. Node loads it in 0.9 s; the test took 4.5 s, because the workspace link resolves Core's dist/ outside node_modules, so every file of the bundle went through the transform.
  • doctor.test.mjs › "returns a doctor envelope with checks + summary": doctor over the repository imports the .doc.mjs documentation modules by the hundred, each inlined: about 4.7 s alone against 0.7 s for the same call in Node.

Both costs grow several times over on a loaded machine.

Intended invariant

A test's time goes to what it checks; prebuilt and plain-data modules load as they do for the CLI.

Change

The node project leaves packages/core/dist/ and .doc.mjs files to Node (server.deps.external). The theme case runs in about 7.4 s alone and doctor's in about 2.2 s; the whole doctor file drops from about 64 s to 15 s, search from 36 s to 23 s, and docs-homes from 44 s to 16 s.

Evidence

  • Failure before the change: with the theme case's budget cut to 8.5 s and doctor's to 3.5 s, each timed out.
  • Success after the change: each passes within that budget.
  • Mocks of @astryxdesign/core/theme in the theme build suites still apply from their inlined callers: build.test.mjs (54) and build.adaptation-core-compat.test.mjs (18) pass.
  • Product/runtime behavior verified unchanged: test configuration 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

  • The node project at this head, on an idle machine: every suite passes but two files that fail the same way on main there; 18 of the 21 files that time out or fail on main under the same run now pass.
  • resolve-theme.test.mjs (30), doctor.test.mjs (86), search.test.mjs (77) and docs-homes.test.mjs (3) pass.

vjeux added 2 commits October 27, 2026 14:10
resolve-theme.test.mjs's "loads a real built local default with an
icon registry" timed out at its 30 s budget in loaded full runs and
passed alone in about 10.6 s. Its theme build imports Core's root entry,
all of Core and React, as the CLI does: 0.9 s in Node, 4.5 s in the test,
because the workspace link resolves Core's dist outside node_modules and
Vitest inlined every file of it through its transform. The node project
now leaves Core's dist to Node, so the case runs in about 7.4 s alone.

Before, with the case's budget cut to 8.5 s, it timed out; after, it
passes in that budget. Mocks of @astryxdesign/core/theme in the theme
build suites still apply from their inlined callers (build.test.mjs 54,
build.adaptation-core-compat.test.mjs 18 pass).
doctor.test.mjs's first case, "returns a doctor envelope with checks +
summary", timed out at 30 s in a loaded full run. It runs doctor over the
repository, whose docs catalog imports the .doc.mjs documentation modules
by the hundred; Vitest inlined each one through its transform: the case
took about 4.7 s alone against 0.7 s for the same call in Node. The node
project now leaves .doc.mjs files to Node as well, and the case takes
about 2.2 s; the whole doctor file drops from about 64 s to 15 s, search
from 36 s to 23 s and docs-homes from 44 s to 16 s.

Before, with the case's budget cut to 3.5 s, it timed out; after, it
passes in that budget.
@vercel

vercel Bot commented Oct 27, 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 27, 2026 9:57pm UTC

Request Review

@astracat-bot

astracat-bot Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

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

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 27, 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 is ready to approve: letting Node load Core's prebuilt dist/ and the .doc.mjs modules in the node project keeps the affected suites passing and cuts the doctor and docs-homes suites to roughly a third of their time. No changes are needed, and scoped CI runs still select the tests of a changed .doc.mjs, so no coverage is lost. Worth knowing for future tests: a vi.mock of a Core subpath no longer reaches Core's own re-exports, such as @astryxdesign/core re-exporting ./theme, so a test that needs the root entry mocked should mock @astryxdesign/core directly.

[Automated review]

@cixzhang
cixzhang merged commit d087a4e into meta:main Oct 27, 2026
61 checks passed
@vjeux
vjeux deleted the uikit/f1-node-core-native branch October 27, 2026 22:51
vjeux added a commit to vjeux/astryx that referenced this pull request Oct 27, 2026
Main brings meta#8752, meta#8568 (useAnimatedLayout) and meta#8604 (INV11). The only
conflict, internal/shadcn-registry/routes.lock.json, is regenerated with
UPDATE_SHADCN_ROUTE_LOCK=1 node apps/docsite/scripts/generate-data.mjs:
main's lock plus this pull request's four routes.

This branch was successfully deployed

1 active deployment
Preview — c20d7ca4 Deployed Oct 27, 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