-
Notifications
You must be signed in to change notification settings - Fork 286
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
replace all uses of Ember.copy, Ember.merge w/ Object.assign #835
replace all uses of Ember.copy, Ember.merge w/ Object.assign #835
Conversation
FYI, these same test failures appear to also happen on |
@@ -6,8 +6,9 @@ | |||
*/ | |||
|
|||
import Promise from 'ember-debug/models/promise'; | |||
import { copy } from 'ember-copy'; |
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.
@teddyzeenny should this import work here?
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.
I don't think it would, no. Not unless the app being debugged has ember-copy
installed as an addon.
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.
So what is your recommendation here?
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.
There's no way to use Ember addons in ember-debug
at the moment. We may be able to eventually work this out by custom-building and including the addons in the ember-debug
final build, but I doubt it's going to be simple.
For the sake of this PR, my recommendation would just be to not use Ember.copy
in this file as it's not even doing a deep clone. So either properties = {...properties}
if our Babel setup supports it, or a simple manual shallow copy by iterating over the properties. Either way, I don't think this function requires an Ember addon.
Would Obect.assign do the trick?
|
@bgentry yes |
@teddyzeenny with that in mind, does that work everywhere? Could we completely remove |
|
965ed76
to
03423a6
Compare
I updated this PR. It no longer uses ember-copy, instead just using |
@bgentry sorry to keep making you change things, but I think we should keep |
As I was typing that, Teddy approved the PR 😂. Let me sync with him offline. |
@teddyzeenny thinks this is good to go, and we don't need deep copies, so works for me 👍 |
Attempted fix of #834. Not sure if I have to do something weird for the import in
ember_debug/libs/promise-assembler.js
or not…