-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUGFIX release] Use deprecation for mutation in constructor during r…
…endering 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: ```js import Component from '@glimmer/component'; import { tracked } from '@glimmer/tracking'; export default class extends Component { @Tracked counter = 0; constructor() { super(...arguments); this.counter++; } } ``` 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.
- Loading branch information
Showing
9 changed files
with
196 additions
and
16 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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