Skip to content

perf(cli): a project with no integration skips the integration issue passes - #9965

Merged
cixzhang merged 1 commit into
meta:mainfrom
vjeux:c04/issues-without-integrations
Nov 5, 2026
Merged

cixzhang merged 1 commit into
meta:mainfrom
vjeux:c04/issues-without-integrations

Conversation

@vjeux

@vjeux vjeux commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Maintainer impact

astryx component, template, search, discover and theme print a one-line integration warning on standard error. To find it, every run called Project.issues(), which imported all 749 Core template docs, even with no integration loaded. With this change the check imports none of them. astryx discover, and astryx component without --showcase or --blocks, then import no template doc at all; template, search and those two flags still read them for their own output. For example, astryx component Button outside a project goes from 1,008 to 259 ES modules and from 0.63 to 0.40 s of CPU. Output and exit codes are unchanged.

Intended invariant

Project.issues() runs its template and component replacement passes only when an integration is loaded. Every issue those passes can find belongs to an integration: Core templates declare no replacements, and resolveComponentReplacements reads only the integrations it is given. Issues recorded while the project loaded are still returned.

Change

  • foundation/config/project.mjs: issues() skips templates(), componentReplacements() and the per-integration collection when #loadedIntegrations is empty. Loaded integrations include the configured, autolinked, computer and local ones, so any of them keeps the passes.
  • New project.issues.test.mjs counts template doc imports with a wrapped importTemplateModule.
  • api/doctor/doctor.test.mjs: the carried-Core case (spec:AST-081 FR3) asserted that doctor called Project.coreDir(). Its only call came from issues(). The case now proves the claim by doctor's own Core check: with nothing installed, core-installed fails, and the carried Core would pass it.

Evidence

  • Red first: on main, issues() in a project with no integration imports 749 template docs. With this change it imports 0.
  • An integration whose template has no source still gets its invalid_template issue from issues() alone, with no discovery call first.
  • Local probe, not part of this change (module loads counted by a loader hook, CPU as user plus system time, 3 runs):
Command, outside a project main This change
astryx component Buttn 1,104 modules, 0.83–0.84 s 355 modules, 0.58–0.60 s
astryx component Button --detail brief 1,008 modules, 0.62–0.63 s 259 modules, 0.39–0.40 s
astryx discover 975 modules 226 modules
astryx template --list (reads templates itself) 969 modules 969 modules
astryx docs --json (no warning) 485 modules, 0.58–0.61 s 485 modules, 0.60–0.61 s

Scope

  • No public API, output or record change.
  • One cause: the warning's issue check in a project with no integration.

Testing

At 94171b9 on main ed9b75b:

  • vitest run --project node packages/cli/foundation/config/project.issues.test.mjs: 2 passed, in file order and shuffled. With main's project.mjs, the first case fails with "expected 749 to be +0" in either order.
  • vitest run --project node on foundation/config, foundation/integrations, host, api/doctor, api/theme/_adapter, api/upgrade, the component, template, discover, search and theme commands, and doc-loads: 65 files, 1,523 tests passed.
  • pnpm lint, eslint (CI=true) and check:changesets pass on the changed files. pnpm review:pre: 0 findings.

@vercel

vercel Bot commented Nov 4, 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 4, 2026 4:26pm UTC

Request Review

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

astracat-bot Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 4, 2026, 4:32 PM UTC

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 94171b9

Storybook · Sandbox · built from this PR's head

Package size: @astryxdesign/cli 3.34 MB packed (+61 B); no new dependencies.

API changes: none in this pull request

Committed API report behind this build: cli 8 rows, core 2 rows; run pnpm api:report.

Not run on this PR: add ci:run-visual, ci:run-a11y or ci:run-rtl to run them.


Generated by PR Enrichment workflow | View full report

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

Requesting changes for one wording fix in the changeset; the code change itself looks right.

Gating Project.issues() on loaded integrations keeps every issue it can report, because only integrations can declare template or component replacements. Command output and exit codes are unchanged, and the new test fails on main with 749 template doc imports and passes here with 0.

Blocking

  • The changeset says commands that check integration issues no longer import every Core template doc, but astryx template and astryx search still import all 749 with no integration loaded (only component and discover drop to 0), so the release note overstates the change.

Suggested wording:

[perf] With no integration loaded, the integration-issue check that everyday commands run no longer imports every Core template doc, so `astryx component` and `astryx discover` import none of them.

[Automated review]

'@astryxdesign/cli': patch
---

[perf] Commands that check integration issues, such as `astryx component`, no longer import every Core template doc when no integration is loaded.

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 reads as true for every command that checks integration issues, but with no integration loaded astryx template (--list, or a template by name) and astryx search still import all 749 Core template docs, because their own output reads them. Only astryx component and astryx discover drop to 0. Suggested wording:

[perf] With no integration loaded, the integration-issue check that everyday commands run no longer imports every Core template doc, so `astryx component` and `astryx discover` import none of them.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in 2249496: the changeset now names only astryx component and astryx discover, split into two sentences. Counted outside a project, template --list and search still import the 749 docs for their own output.

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

Requesting changes for one more wording fix in the changeset; the code change itself looks right.

Gating Project.issues() on loaded integrations keeps every issue it can report, because only integrations declare template or component replacements, and command output and exit codes are unchanged. The new test fails on main with 749 template doc imports and passes here with 0.

Blocking

  • Miss: the changeset says astryx component now imports none of the Core template docs, but with no integration loaded astryx component <Name> --showcase and --blocks still import all 692 block docs, which the wording suggested in the last review overlooked.

Suggested wording:

[perf] With no integration loaded, the integration-issue check no longer imports every Core template doc. `astryx discover`, and `astryx component` without `--showcase` or `--blocks`, now import none of them.

[Automated review]

'@astryxdesign/cli': patch
---

[perf] With no integration loaded, the integration-issue check no longer imports every Core template doc. `astryx component` and `astryx discover` now import none of them.

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.

With no integration loaded, astryx component <Name> --showcase and --blocks still import all 692 Core block docs, because they read every block for their own output, so "astryx component ... now import none of them" is too broad. The wording suggested in the last review overlooked those two flags. Suggested:

[perf] With no integration loaded, the integration-issue check no longer imports every Core template doc. `astryx discover`, and `astryx component` without `--showcase` or `--blocks`, now import none of them.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in 94171b9: the changeset now excludes --showcase and --blocks, which read the 692 block docs for their own output (950 and 951 modules counted outside a project).

Project.issues() resolved templates and component replacements before
it returned, to settle replacement issues. Every issue those passes
find belongs to an integration, but they also ran with none loaded.
The stderr nudge of astryx component, template, search, discover and
theme calls issues() on each run, so each such run imported all 749
Core template docs. issues() now skips the passes when no integration
is loaded. Doctor's carried-Core test now proves its claim by the Core
check: with nothing installed that check fails, and the carried Core
would pass it.

@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 run on this head yet.

Gating Project.issues() on loaded integrations keeps every issue it can report, since only integrations declare template or component replacements, and command output and exit codes are unchanged. The changeset now matches what changes: with no integration loaded, astryx discover and astryx component without --showcase or --blocks import no Core template doc, while those two flags, template and search still read them for their own output.

Next step: this is a draft from a fork, so CI runs once it is marked ready for review and a maintainer adds the ci:run label.

[Automated review]

@vjeux
vjeux marked this pull request as ready for review November 4, 2026 16:37
@cixzhang cixzhang added the ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) label Nov 4, 2026
@cixzhang
cixzhang marked this pull request as draft November 4, 2026 16:55
@cixzhang
cixzhang marked this pull request as ready for review November 4, 2026 16:55
@cixzhang
cixzhang merged commit e2b522f into meta:main Nov 5, 2026
147 of 152 checks passed
@vjeux
vjeux deleted the c04/issues-without-integrations branch November 5, 2026 02:52

This branch was successfully deployed

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

Labels

ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) 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