Skip to content

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
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Apr 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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