Skip to content

fix(core): remove signal equality check short-circuit#53446

Closed
pkozlowski-opensource wants to merge 1 commit intoangular:mainfrom
pkozlowski-opensource:signals_equal_short_circuit
Closed

fix(core): remove signal equality check short-circuit#53446
pkozlowski-opensource wants to merge 1 commit intoangular:mainfrom
pkozlowski-opensource:signals_equal_short_circuit

Conversation

@pkozlowski-opensource
Copy link
Copy Markdown
Member

The PR #52465 introduced short-circuit for the signal equality invocation - with the reasoning that the equality function should never return false for arguments with the same references. In practice it turned out that it is rather surprising and the subsequent PR #52532 added a warning when the short-circuit was taking priority over the equality function.

Still, the presence of the short-circuit prevents people from mutating objects in place and based on #52735 this is a common and desired scenario. This change removes the short-circuit altogether and thus fixes the mentioned issue.

We do recognize that removing short-circuit exposes developers to the potentially surprising logic where mutated in-place change won't be propagated through the reactivity graph (due to the default equality function). But we assume that this might be less surprising / more desirable as compared to the short-circuit logic.

Fixes #52735

The PR angular#52465 introduced short-circuit for
the signal equality invocation - with the reasoning that the equality function
should never return false for arguments with the same references. In practice it
turned out that it is rather surprising and the subsequent PR
angular#52532 added a warning when the short-circuit
was taking priority over the equality function.

Still, the presence of the short-circuit prevents people from mutating objects in
place and based on angular#52735 this is a common
and desired scenario. This change removes the short-circuit altogether and thus
fixes the mentioned issue.

We do recognize that removing short-circuit exposes developers to the potentially
surprising logic where mutated in-place change won't be propagated throug the
reactivity graph (due to the deault equality function). But we assume that this might
be less surprising / more desirable as compared to the short-circuit logic.

Fixes angular#52735
@pkozlowski-opensource pkozlowski-opensource added action: review The PR is still awaiting reviews from at least one requested reviewer area: core Issues related to the framework runtime labels Dec 8, 2023
@ngbot ngbot bot added this to the Backlog milestone Dec 8, 2023
@pkozlowski-opensource pkozlowski-opensource added the target: patch This PR is targeted for the next patch release label Dec 8, 2023
@alxhub alxhub added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Dec 8, 2023
@alxhub
Copy link
Copy Markdown
Member

alxhub commented Dec 8, 2023

This PR was merged into the repository by commit 42f4f70.

@alxhub alxhub closed this in 42f4f70 Dec 8, 2023
alxhub pushed a commit that referenced this pull request Dec 8, 2023
The PR #52465 introduced short-circuit for
the signal equality invocation - with the reasoning that the equality function
should never return false for arguments with the same references. In practice it
turned out that it is rather surprising and the subsequent PR
#52532 added a warning when the short-circuit
was taking priority over the equality function.

Still, the presence of the short-circuit prevents people from mutating objects in
place and based on #52735 this is a common
and desired scenario. This change removes the short-circuit altogether and thus
fixes the mentioned issue.

We do recognize that removing short-circuit exposes developers to the potentially
surprising logic where mutated in-place change won't be propagated throug the
reactivity graph (due to the deault equality function). But we assume that this might
be less surprising / more desirable as compared to the short-circuit logic.

Fixes #52735

PR Close #53446
@angular-automatic-lock-bot
Copy link
Copy Markdown

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 Jan 8, 2024
ChellappanRajan pushed a commit to ChellappanRajan/angular that referenced this pull request Jan 23, 2024
The PR angular#52465 introduced short-circuit for
the signal equality invocation - with the reasoning that the equality function
should never return false for arguments with the same references. In practice it
turned out that it is rather surprising and the subsequent PR
angular#52532 added a warning when the short-circuit
was taking priority over the equality function.

Still, the presence of the short-circuit prevents people from mutating objects in
place and based on angular#52735 this is a common
and desired scenario. This change removes the short-circuit altogether and thus
fixes the mentioned issue.

We do recognize that removing short-circuit exposes developers to the potentially
surprising logic where mutated in-place change won't be propagated throug the
reactivity graph (due to the deault equality function). But we assume that this might
be less surprising / more desirable as compared to the short-circuit logic.

Fixes angular#52735

PR Close angular#53446
rlmestre pushed a commit to rlmestre/angular that referenced this pull request Jan 26, 2024
The PR angular#52465 introduced short-circuit for
the signal equality invocation - with the reasoning that the equality function
should never return false for arguments with the same references. In practice it
turned out that it is rather surprising and the subsequent PR
angular#52532 added a warning when the short-circuit
was taking priority over the equality function.

Still, the presence of the short-circuit prevents people from mutating objects in
place and based on angular#52735 this is a common
and desired scenario. This change removes the short-circuit altogether and thus
fixes the mentioned issue.

We do recognize that removing short-circuit exposes developers to the potentially
surprising logic where mutated in-place change won't be propagated throug the
reactivity graph (due to the deault equality function). But we assume that this might
be less surprising / more desirable as compared to the short-circuit logic.

Fixes angular#52735

PR Close angular#53446
amilamen pushed a commit to amilamen/angular that referenced this pull request Jan 26, 2024
The PR angular#52465 introduced short-circuit for
the signal equality invocation - with the reasoning that the equality function
should never return false for arguments with the same references. In practice it
turned out that it is rather surprising and the subsequent PR
angular#52532 added a warning when the short-circuit
was taking priority over the equality function.

Still, the presence of the short-circuit prevents people from mutating objects in
place and based on angular#52735 this is a common
and desired scenario. This change removes the short-circuit altogether and thus
fixes the mentioned issue.

We do recognize that removing short-circuit exposes developers to the potentially
surprising logic where mutated in-place change won't be propagated throug the
reactivity graph (due to the deault equality function). But we assume that this might
be less surprising / more desirable as compared to the short-circuit logic.

Fixes angular#52735

PR Close angular#53446
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: core Issues related to the framework runtime target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Angular 17 - Mutable signals are not supported

2 participants