Skip to content
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

Merged
merged 1 commit into from
May 22, 2024

Conversation

Gaurav0
Copy link
Contributor

@Gaurav0 Gaurav0 commented Aug 21, 2022

Removes unnecessary dependency on ember-copy, simplifying maintainability.

@@ -18,7 +20,7 @@ export default class BarBasic extends Component {
}
};

chartData = copy(stockData, true);
chartData = clone(stockData);
Copy link
Collaborator

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.

Copy link
Contributor Author

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.

Copy link
Collaborator

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?

Copy link
Contributor Author

@Gaurav0 Gaurav0 May 16, 2024

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?

Copy link
Contributor Author

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.

Copy link
Collaborator

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!

@Gaurav0 Gaurav0 force-pushed the remove_ember_copy branch from 555aab6 to e107c70 Compare May 15, 2024 13:13
@Gaurav0
Copy link
Contributor Author

Gaurav0 commented May 15, 2024

@RobbieTheWagner rebased.

@RobbieTheWagner RobbieTheWagner merged commit 72b33d7 into ahmadsoe:master May 22, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants