fix(forms/signals): make extractValue reactive for compat AbstractControl values#68202
Open
volkanfilazi wants to merge 2 commits intoangular:mainfrom
Open
fix(forms/signals): make extractValue reactive for compat AbstractControl values#68202volkanfilazi wants to merge 2 commits intoangular:mainfrom
volkanfilazi wants to merge 2 commits intoangular:mainfrom
Conversation
50cb495 to
58ae7a0
Compare
Contributor
|
@volkanfilazi Thanks for the contribution. I'm going to discuss this fix in the original issue. |
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.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
extractValue no longer uses untracked, allowing signal reads during traversal to be tracked.
result:
computed(() => extractValue(...)) becomes reactive
effect re-runs when underlying AbstractControl values change
compat form values behave consistently with signal-based expectations
Reactive consumers are now correctly notified when control values update.
Issue Number: #68097
What is the new behavior?
Does this PR introduce a breaking change?
This change makes extractValue reactive, which may cause additional re-computations in cases where it was previously used as a purely imperative helper. However, this aligns better with expected signal behavior, especially in compatForm scenarios.
Other information
The issue was traced to the use of untracked in extractValue, which prevents dependency tracking. Removing it restores the reactive chain.
It is possible that extractValue was originally intended to be non-reactive. If so, an alternative approach could be to introduce a separate reactive API. However, this change fixes the current inconsistency where compat form values do not propagate updates through the signal graph.
A new test has been added to verify that reactive consumers are notified when AbstractControl values change.