-
Notifications
You must be signed in to change notification settings - Fork 86
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
remove ember-copy dependency #387
Conversation
@@ -18,7 +20,7 @@ export default class BarBasic extends Component { | |||
} | |||
}; | |||
|
|||
chartData = copy(stockData, true); | |||
chartData = clone(stockData); |
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.
@Gaurav0 I know this is an old PR, but is there any chance there is anything structuredClone
doesn't support in this chart data? I know it won't copy functions for example.
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.
While many things don't work with structuredClone, it is faster and better than ember-copy in what it does support.
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.
Sure, but is there anything we will break by making the switch?
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.
Anything that uses copy or the Copyable mixin, without directly adding ember-copy as a dependency, maybe?
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.
Keep in mind that functions, DOM nodes, etc. cannot really be "cloned" in JavaScript. ember-copy creates a reference in the new object to the original, which "silently works" in some cases, but breaks when you actually switch JavaScript contexts. IMO, an error is better. And chart data shouldn't contain these anyway. However, it is up to you to decide whether this is a "bugfix" or a "breaking change". My 2 cents is document it and call it a bugfix.
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'm fine with that. Just wanted to double check. Thanks!
555aab6
to
e107c70
Compare
@RobbieTheWagner rebased. |
Removes unnecessary dependency on ember-copy, simplifying maintainability.