Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(@angular/cli): avoid implicit undefined array defaults for @angular/build builders #29960

Merged
merged 1 commit into from
Mar 28, 2025

Conversation

clydin
Copy link
Member

@clydin clydin commented Mar 27, 2025

Previously, all builder options that were of type array were set to a default empty array even if there was no explicit default defined within the schema. This can be problematic for options that have differing behavior based on their presence such as runtime calculated defaults. The implicit defaulting behavior was also not aligned with the generated schema types which resulted in additional type safety and initialization regardless. As a result, the implicit behavior was effectively redundant in most cases. Since this change could be breaking for third-party builders, the removal of this behavior is currently limited to the @angular/build package.

@clydin clydin added the target: major This PR is targeted for the next major release label Mar 27, 2025
@clydin clydin force-pushed the builders/limit-undefined-defaults branch from 021a826 to a8c9f80 Compare March 27, 2025 21:09
@clydin clydin changed the title refactor(@angular/cli): avoid implicit undefined defaults for @angular/build builders refactor(@angular/cli): avoid implicit undefined array defaults for @angular/build builders Mar 27, 2025
@clydin clydin force-pushed the builders/limit-undefined-defaults branch from a8c9f80 to 8980cee Compare March 27, 2025 21:32
@clydin clydin marked this pull request as ready for review March 27, 2025 21:38
@clydin clydin force-pushed the builders/limit-undefined-defaults branch 2 times, most recently from 4bb408e to ec62715 Compare March 27, 2025 21:47
…@angular/build` builders

Previously, all builder options that were of type array were
set to a default empty array even if there was no explicit default defined
within the schema. This can be problematic for options that have differing
behavior based on their presence such as runtime calculated defaults. The
implicit defaulting behavior was also not aligned with the generated schema
types which resulted in additional type safety and initialization regardless.
As a result, the implicit behavior was effectively redundant in most cases.
Since this change could be breaking for third-party builders, the removal of
this behavior is currently limited to the `@angular/build` package.
@clydin clydin force-pushed the builders/limit-undefined-defaults branch from ec62715 to 22e1aad Compare March 28, 2025 11:39
@clydin clydin requested a review from alan-agius4 March 28, 2025 11:39
@clydin clydin added the action: merge The PR is ready for merge by the caretaker label Mar 28, 2025
@clydin clydin merged commit a9aa317 into angular:main Mar 28, 2025
31 checks passed
@clydin clydin deleted the builders/limit-undefined-defaults branch March 28, 2025 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action: merge The PR is ready for merge by the caretaker area: @angular/cli target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants