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

clonedeep vs structuredClone #328

Closed
jimmywarting opened this issue Oct 27, 2023 · 2 comments
Closed

clonedeep vs structuredClone #328

jimmywarting opened this issue Oct 27, 2023 · 2 comments

Comments

@jimmywarting
Copy link

Just want to point out that there is a structuredClone natively that dose not require any dependencies...

"lodash.clonedeep": "^4.5.0"

maybe consider doing a conditional top level import or something like that?

const clone = globalThis.structuredClone || await import('lodash.clonedeep')

or let the user know that it requires support for structuredClone and it needs to be polyfilled

@jonluca
Copy link
Collaborator

jonluca commented Mar 5, 2024

We still support node 16, and structuredClone was introduced in 17. Once we drop support for 16 we'll get rid of the lodash dependency

@jonluca jonluca closed this as completed Mar 5, 2024
@jonluca
Copy link
Collaborator

jonluca commented Mar 5, 2024

Turns out we didnt need cloneDeep or any dependency at all

52ab2f8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants