Repository navigation
fix(@angular-devkit/core): only invoke smart default provider when value is undefined - #34537
Conversation
…lue is undefined Previously, `CoreSchemaRegistry._applySmartDefaults` invoked the smart default provider unconditionally before `CoreSchemaRegistry._set` checked whether the target property already had a defined value. This caused smart default providers to be evaluated even when an option was explicitly provided.
There was a problem hiding this comment.
Code Review
This pull request refactors the CoreSchemaRegistry to defer the execution of smart default providers. Instead of immediately invoking the provider, a lazy function is passed to _set, which is only evaluated and resolved (including handling Observables) if the target property is actually undefined or forced. This prevents unnecessary provider calls when a value is already explicitly defined. A corresponding unit test has been added to verify this behavior. There are no review comments to address.
|
This pull request has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Previously,
CoreSchemaRegistry._applySmartDefaultsinvoked the smart default provider unconditionally beforeCoreSchemaRegistry._setchecked whether the target property already had a defined value. This caused smart default providers to be evaluated even when an option was explicitly provided.