Repository navigation
perf(cli): a project with no integration skips the integration issue passes - #9965
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
There was a problem hiding this comment.
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 templateandastryx searchstill import all 749 with no integration loaded (onlycomponentanddiscoverdrop 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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
7766485 to
2249496
Compare
There was a problem hiding this comment.
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 componentnow imports none of the Core template docs, but with no integration loadedastryx component <Name> --showcaseand--blocksstill 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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
2249496 to
94171b9
Compare
There was a problem hiding this comment.
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]
Maintainer impact
astryx component,template,search,discoverandthemeprint a one-line integration warning on standard error. To find it, every run calledProject.issues(), which imported all 749 Core template docs, even with no integration loaded. With this change the check imports none of them.astryx discover, andastryx componentwithout--showcaseor--blocks, then import no template doc at all;template,searchand those two flags still read them for their own output. For example,astryx component Buttonoutside 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, andresolveComponentReplacementsreads only the integrations it is given. Issues recorded while the project loaded are still returned.Change
foundation/config/project.mjs:issues()skipstemplates(),componentReplacements()and the per-integration collection when#loadedIntegrationsis empty. Loaded integrations include the configured, autolinked, computer and local ones, so any of them keeps the passes.project.issues.test.mjscounts template doc imports with a wrappedimportTemplateModule.api/doctor/doctor.test.mjs: the carried-Core case (spec:AST-081FR3) asserted that doctor calledProject.coreDir(). Its only call came fromissues(). The case now proves the claim by doctor's own Core check: with nothing installed,core-installedfails, and the carried Core would pass it.Evidence
main,issues()in a project with no integration imports 749 template docs. With this change it imports 0.invalid_templateissue fromissues()alone, with no discovery call first.mainastryx component Buttnastryx component Button --detail briefastryx discoverastryx template --list(reads templates itself)astryx docs --json(no warning)Scope
Testing
At 94171b9 on
mained9b75b:vitest run --project node packages/cli/foundation/config/project.issues.test.mjs: 2 passed, in file order and shuffled. Withmain'sproject.mjs, the first case fails with "expected 749 to be +0" in either order.vitest run --project nodeonfoundation/config,foundation/integrations,host,api/doctor,api/theme/_adapter,api/upgrade, thecomponent,template,discover,searchandthemecommands, anddoc-loads: 65 files, 1,523 tests passed.pnpm lint,eslint(CI=true) andcheck:changesetspass on the changed files.pnpm review:pre: 0 findings.