Issue deprecations for tracked mutation in constructor during rendering #19282
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.
During recent refactors that landed in [email protected] (Glimmer VM version that landed in Ember 3.22) we moved the internal infrastructure to ensure everything was in a tracking frame. This greatly increased the number of locations that would now fall under the standard read + write assertions.
For example, in [email protected] the following would run without error:
Now, obviously this is a bit contrived, but the point is that since component construction was not previously within a tracking frame it would not error due to the read then write of a tracked property.
As of [email protected]+ we do run this within a tracking frame (because nearly everything is automatically within a tracking frame).
This change ensures that the (previously untracked) construction of components, modifiers, and helpers trigger a deprecation not an assertion when mutating a previously read value within the constructor. In order to do that some changes were required in GlimmerVM (primarily glimmerjs/glimmer-vm#1205).
Fixes #19192
Fixes #19272 (by updating glimmer-vm)