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

Migrate from @ungap/structured-clone to native structuredClone #492

Open
alexmuller opened this issue Apr 4, 2023 · 4 comments
Open

Migrate from @ungap/structured-clone to native structuredClone #492

alexmuller opened this issue Apr 4, 2023 · 4 comments
Labels
good introductory issue This issue will be good for a newcomer to Reliability Kit to work on maintenance Work to maintain the repo and stop creeping tech debt

Comments

@alexmuller
Copy link
Member

structuredClone is available natively in Node.js 17+. This means that the earliest we can use it would be when we drop support for Node.js 16. See #490 for when @rowanmanning suggested this.

What problem does this feature solve?

Removes the need for a 3rd party dependency to implement structuredClone.

Ideal solution

Remove all the uses of @ungap/structured-clone and replace them with native structuredClone.

Alternatives

We could leave the dependency in place.

@alexmuller alexmuller added the requires: at-least-node-18 Things that we can add when we drop Node 16 support label Apr 4, 2023
@rowanmanning
Copy link
Member

We should be able to work on this in mid-August when we drop support for Node.js 16 across our packages.

@rowanmanning rowanmanning added the maintenance Work to maintain the repo and stop creeping tech debt label Apr 19, 2023
@rowanmanning
Copy link
Member

We no longer use @ungap/structured-clone, we switched to Lodash deepClone to address #623. We may still be able to switch to native structuredClone though, it's worth trying and seeing if the tests pass. If not then we'll have to stick with Lodash.

@rowanmanning rowanmanning added good introductory issue This issue will be good for a newcomer to Reliability Kit to work on and removed requires: at-least-node-18 Things that we can add when we drop Node 16 support labels Jan 8, 2024
@rowanmanning rowanmanning moved this from 📥 Inbox to 📝 Planned in Reliability Kit Roadmap Jan 8, 2024
@Nazehs
Copy link
Contributor

Nazehs commented Jan 9, 2024

@rowanmanning With Node 18 in use, do we still require lodash? I believe we could eliminate it and adopt a native implementation for deep cloning. This would allow us to reduce third-party dependencies.

@rowanmanning
Copy link
Member

Yep we might be able to! I haven't had time to experiment with it yet but I'm hopeful that structuredClone should be enough. It'd be nice to be able to remove lodash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good introductory issue This issue will be good for a newcomer to Reliability Kit to work on maintenance Work to maintain the repo and stop creeping tech debt
Projects
Status: 📝 Planned
Development

No branches or pull requests

3 participants