-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modifier Managers should not re-consume their args on destroy #19162
Comments
re: discord thread: https://discordapp.com/channels/480462759797063690/608346628163633192/743822662681493504 @pzuraq says that wrapping in a proxy so that args are only consumed when used has been a potential solution. that would solve this! :D |
Thanks for writing this up @NullVoxPopuli. This problem is currently biting us at Yapp and had broken my brain for the last couple days. |
I agree that the current behavior, at the very least, feels like a bug, and the resulting problems are very hard to pinpoint, and unintuitive. So any solution to this would be greatly appreciated! Thanks for writing this up! |
IMHO, this is a bug. It's basically the reason that we use an args proxy for component managers, and a recent PR by @chancancode made that a bit more generic so that we could use it for our modifier managers. I'm going to move this into an issue on the emberjs/ember.js repo, so we can work on a fix (instead of an RFCs issue). |
The path forward here is to make this code sharable between the various manager types (modifier and component now, but soon helpers): ember.js/packages/@ember/-internals/glimmer/lib/component-managers/custom.ts Lines 159 to 238 in 984e69c
ember.js/packages/@ember/-internals/glimmer/lib/component-managers/custom.ts Lines 284 to 289 in 984e69c
Instead of always reifying:
|
I've pushed up a quick stab of this over in #19163 |
BREAKING CHANGE: destruction behavior changed to use new args proxy from 3.22 Resolves the issue described by: emberjs/ember.js#19162 fixed by: emberjs/ember.js#19163
BREAKING CHANGE: destruction behavior changed to use new args proxy from 3.22 Resolves the issue described by: emberjs/ember.js#19162 fixed by: emberjs/ember.js#19163
BREAKING CHANGE: destruction behavior changed to use new args proxy from 3.22 Resolves the issue described by: emberjs/ember.js#19162 fixed by: emberjs/ember.js#19163
BREAKING CHANGE: destruction behavior changed to use new args proxy from 3.22 Resolves the issue described by: emberjs/ember.js#19162 fixed by: emberjs/ember.js#19163 Ember apps < 3.22 are unaffected. This also adds Ember Try support for LTS 3.8 through 3.20
BREAKING CHANGE: destruction behavior changed to use new args proxy from 3.22 Resolves the issue described by: emberjs/ember.js#19162 fixed by: emberjs/ember.js#19163
BREAKING CHANGE: destruction behavior changed to use new args proxy from 3.22 Resolves the issue described by: emberjs/ember.js#19162 fixed by: emberjs/ember.js#19163
BREAKING CHANGE: destruction behavior changed to use new args proxy from 3.22 Resolves the issue described by: emberjs/ember.js#19162 fixed by: emberjs/ember.js#19163
BREAKING CHANGE: destruction behavior changed to use new args proxy from 3.22 Resolves the issue described by: emberjs/ember.js#19162 fixed by: emberjs/ember.js#19163
BREAKING CHANGE: destruction behavior changed to use new args proxy from 3.22 Resolves the issue described by: emberjs/ember.js#19162 fixed by: emberjs/ember.js#19163 Ember apps < 3.22 are unaffected. This also adds Ember Try support for LTS 3.8 through 3.20
BREAKING CHANGE: destruction behavior changed to use new args proxy from 3.22 Resolves the issue described by: emberjs/ember.js#19162 fixed by: emberjs/ember.js#19163
BREAKING CHANGE: destruction behavior changed to use new args proxy from 3.22 Resolves the issue described by: emberjs/ember.js#19162 fixed by: emberjs/ember.js#19163
BREAKING CHANGE: destruction behavior changed to use new args proxy from 3.22 Resolves the issue described by: emberjs/ember.js#19162 fixed by: emberjs/ember.js#19163
BREAKING CHANGE: destruction behavior changed to use new args proxy from 3.22 Resolves the issue described by: emberjs/ember.js#19162 fixed by: emberjs/ember.js#19163
BREAKING CHANGE: destruction behavior changed to use new args proxy from 3.22 Resolves the issue described by: emberjs/ember.js#19162 fixed by: emberjs/ember.js#19163
BREAKING CHANGE: destruction behavior changed to use new args proxy from 3.22 Resolves the issue described by: emberjs/ember.js#19162 fixed by: emberjs/ember.js#19163
BREAKING CHANGE: destruction behavior changed to use new args proxy from 3.22 Resolves the issue described by: emberjs/ember.js#19162 fixed by: emberjs/ember.js#19163
BREAKING CHANGE: destruction behavior changed to use new args proxy from 3.22 Resolves the issue described by: emberjs/ember.js#19162 fixed by: emberjs/ember.js#19163
BREAKING CHANGE: destruction behavior changed to use new args proxy from 3.22. This is only a breaking change for Ember 3.22+. Ember < 3.22 is unaffected. Resolves the issue described by: emberjs/ember.js#19162 fixed by: emberjs/ember.js#19163
BREAKING CHANGE: destruction behavior changed to use new args proxy from 3.22 Resolves the issue described by: emberjs/ember.js#19162 fixed by: emberjs/ember.js#19163
According to the current modifier manager spec:
then, in the following code example:
args are passed to
destroyModifier
.I think this is a bug because:
if
guards in templates no longer can guarantee the safety of the shape of datafoo?.bar?.bax
everywhere (this generates a lot of boilerplate)I propose we remove
args
from thedestroyModifier
hook so thatFor example, today, the following isn't safe:
Minimal Reproduction / Description of the Problem: https://ember-twiddle.com/5a3fa797b26e8807869340792219a5ee?openFiles=components.demo%5C.hbs%2Ccomponents.demo%5C.hbs
Relevant Discord Threads:
The text was updated successfully, but these errors were encountered: