-
-
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
[BUGFIX] Restore mixin based EmberArray detection #20219
Conversation
I'd be willing to add an ember-version dependent workaround if we don't want to restore the detect API, but there needs to be a mechanism for preventing what A can do to an object for EmberData to be able to help folks pave a path away from A. |
@jrjohnson what part of #20092 changed this? The definitions of both |
@wagenet Sorry, I got lost in the git history with the move it was changed in #20086 in 8c6a159#diff-e5990a64605f374bfcd716f56aa0cd3c06573d6f48ebf05a245cfbf875a2c700L1805-L1809 |
@jrjohnson darn, my attempt to shift blame failed 😄 That said, I believe this is reasonable, I'll see if I can get someone else to second it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable to me, too. DIAF mixins and EmberArray
… but until then yeah, let's do this to avoid breaking folks.
I'm not sure how to fix the test failures here, I think it maybe has to do with typescript and using the EmberArray import for the type and in code, but I don't know enough about typescript to fix this. I've tried various syntax and tried to figure out the difference between import type and import as well as looking around for other examples of something like this in the ember source, but I think I don't have enough of an idea on how typescript works to figure this out. |
Annoyingly, I couldn't reproduce them locally either. I've been pretty busy as well 😕 |
I'm surprised this doesn't fail for you locally @wagenet, it certainly does for me. Maybe we can connect on discord and pair on debugging? I think maybe this is a circular dependency issue. |
@jrjohnson pairing would make sense. Are you on the Ember Discord? Maybe we can connect there. |
This is needed for ember-data to tap into and masquerade as an EmberArray to avoid being clobbered by Ember.A().
This allows ember data to both display a useful deprecation message when a user runs Ember.A on a RecordArray and also to prevent it.
8d02d3b
to
fdbed46
Compare
@wagenet / @runspired I'm not sure if this is the right way to go, but wanted to put some strawman code up for discussion. Calls |
That's definitely one option. I think also, we want to change the behavior of Ember.A to not mutate anymore. The docs say that it doesn't (which we know is not true). I've talked with others on the core team about this. I'll try to look into it more this week. |
This is needed for ember-data to tap into and masquerade as an EmberArray to avoid being clobbered by Ember.A().
Refs emberjs/data#8202
This functionality was dropped in
#20092#20086I couldn't figure out where a test for this would go, but opening a PR as a starting place for discussion and happy to update as needed.