feat(compiler-cli): Adapt the compiler to use standalone by default. #58169
feat(compiler-cli): Adapt the compiler to use standalone by default. #58169JeanMeche wants to merge 9 commits intoangular:mainfrom
Conversation
480c7f9 to
408084f
Compare
408084f to
5c327a2
Compare
4c1af50 to
2d8b834
Compare
2d8b834 to
d225472
Compare
With this commit directives, components & pipes are standalone by default. To be declared in an `NgModule`, those require now `standalone: false`.
Use `semver` in the partial compiler to decide on a default value Co-authored-by: Alex Rickabaugh <alxhub@users.noreply.github.com>
`UpgradeComponent` is meant to be used as a subclass, it doesn't need to disable `standalone`.
After flipping the standalone default value, this is reflected in the partial output result.
… default This commit is part of the migration to standalone by default.
With this commit, the standalone migration will only migrate code with `standalone: false` to standalone by default (without the standalone attribute)
| ); | ||
| } | ||
|
|
||
| const STANDALONE_IS_DEFAULT_RANGE = new semver.Range('>= 19.0.0', { |
There was a problem hiding this comment.
We should make sure that 0.0.0-PLACEHOLDER is also considered to pass.
packages/compiler/src/util.ts
Outdated
| } | ||
|
|
||
| const SINGLE_DIGIT_VERSIONS = /^\d\./; | ||
| const V11_V18 = /1[12345678]\./; |
There was a problem hiding this comment.
Nit: Could probably combine this into a single Regex. e.g. V1_TO_18 = ^([1-9]|1[0-8])\.
|
This change has currently an issue in our compliance tests. Edit: fixed |
jelbourn
left a comment
There was a problem hiding this comment.
LGTM
Reviewed-for: global-approvers
|
Caretaker note: presubmit failure looks like a flake to me; I ran a TGP for these changes yesterday and it was green |
|
This PR was merged into the repository by commit 9ab663e. The changes were merged into the following branches: main |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
On top of #58160 & #58175
This PR flips the default for standalone from
falsetotruefor components, directives and pipes.This PR also includes the necessary changes for the impacted tests as well as other targets that dependens on them (adev, benchmarks etc).