-
-
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
arrayContentDidChange/arrayContentWillChange can no longer be overriden #14114
Comments
Thank you for taking the time to open this! |
In general, one should assume that framework provided methods are not overridable unless explicitly documented so. In other words, borrowing from Java, they are Nevertheless, as 2.8 is an LTS we should fix this. It may be sufficient to restore the old behaviour only for classes that implement the Array mixin, like ArrayProxy in this case. |
Yea I can certainly understand this. I'm definitely not asserting that the right solution is to restore old functionality (though admittedly it would make my life easier). More than anything else I wanted to bring this up and kick off a discussion. I think the reason I brought this up to begin with was because it impacts a data structure / interfact that is often extended. If we step back and look, this specific case is not unique. Along with The answer is simply because It feels arbitrary to me to say that it's okay to override |
@workmanw This is because the work is only partially complete. The goal is to be able to avoid putting anything on the native I doubt that anyone is reopening the NativeArray/MutableArray mixins or the |
and yes, ArrayProxy would have to reimplement all those methods as you said if it wanted to remain "calling behaviour compatible". We might not want to bother doing that in 2.9. But for 2.8 LTS I'd like to avoid the breaking to this addon. |
Provides some temporary relief for emberjs#14114.
I think this was fixed by #14117, can someone confirm against canary builds? |
@rwjblue WOOT 🙌 . Confirmed fixed with: |
Provides some temporary relief for emberjs#14114.
Provides some temporary relief for emberjs#14114.
Carry over from this PR: #13534
In that PR,
arrayContentDidChange
andarrayContentWillChange
were modified to make them implemented and invoked as pure functions (as opposed to object-oriented methods). That PR is problematic for ember-data-model-fragments. The root of the problem is that becausereplace
(and others) no longer callthis.arrayContentDidChange(...)
, instead callingarrayContentDidChange(this, ...)
, we are unable to override this function in our subclasses array. See here: array/stateful.js#L178-L190.There was some discussion about about whether or not this was a breaking change because the API is not changing, just the behavior of a function.
If possible, we should try to sort this out before Ember 2.8 ships, otherwise we'll have an upgrade blocker to resolve in ember-data-model-fragments.
The text was updated successfully, but these errors were encountered: