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

Test and use native structuredClone if it exists. #10

Open
jdalton opened this issue Oct 22, 2021 · 2 comments
Open

Test and use native structuredClone if it exists. #10

jdalton opened this issue Oct 22, 2021 · 2 comments

Comments

@jdalton
Copy link

jdalton commented Oct 22, 2021

Native structuredClone is landing in browsers. It would be great if this forked to use that if it exists.

@dumbmatter
Copy link
Owner

That is a good point. I might wait until Node.js does a release including it, since this library is mostly used in Node.js and that would give me a chance to make sure nothing funny happens with the switch.

@dumbmatter
Copy link
Owner

Wow things happen fast. structuredClone is in the latest version of Node. It actually fails one of the tests here, since now Error objects are structured clonable but that was not always true.

But thinking about this issue again... is it actually better for this library to handle if we can use the native structuredClone, or would it be better to let the application decide? I feel like letting the application decide is the least confusing way? I guess it probably matters for very few people, since basically everyone using this library is using it as a dependency of another library I wrote (fake-indexeddb), so everyone using that will get the change regardless of if I make it here or there :)

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