Repository navigation
feat(vite): default angularVersion to the installed @angular/core version - #672
Merged
Merged
Conversation
…sion Without the option the compiler targeted the latest Angular, so an Angular 22.1 project got error 1010 for the array form of `deferredImports`, which its runtime still expects. The plugin now reads @angular/core's version from node_modules, up from `workspaceRoot`; a `0.0.0-...` build or no package keeps the latest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The app's own @angular/core can sit under Vite's root in a workspace that hoists another version, and a relative path stopped the upward search at `.`. The linker now reads the version for the same root. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #654 / #669.
Problem
When the Vite plugin's
angularVersionoption is unset, the compiler targets the latest Angular. Since #669, the latest (≥ 22.2) rejects the array form of@Component.deferredImportswith error 1010. A project on Angular 22.1 or older that never setangularVersionhits that error, even though its runtime still expects the array form.Change
root, notworkspaceRoot/cwd, so an app that has its own@angular/coreunder a workspace with another hoisted version gets the version it actually imports.createRequire. Otherwise it walksnode_moduleslike the existing zone.js check, which avoids pnpm'sNODE_PATH.Only the Vite plugin changes. The programmatic
transformAngularFileAPI still defaults to latest.Visible effect for projects that leave
angularVersionunsetThe compiler now targets the installed version, so everything gated on that version follows the runtime:
deferredImports?.lowered to the legacy== null ? null :form?., like ngtsc's v22 defaultTests
test/angular-version.test.ts(10 tests):+build,0.0.0-PLACEHOLDER, invalid.inside a hoisted workspace, an unreadable packageThe key tests fail without the change. Full
pnpm test(429) andpnpm checkpass.🤖 Generated with Claude Code