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

perf(remix-dev/vite): use structuredClone instead of JSON.parse(JSON.stringify()) #9968

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from

Conversation

xSyki
Copy link

@xSyki xSyki commented Sep 10, 2024

JSON.parse(JSON.stringify( is not a recommended method for doing deepCopy. I suggest changing it to native structuredClone

https://developer.mozilla.org/en-US/docs/Web/API/structuredClone

https://web.dev/articles/structured-clone

Benchmarks

https://jsperf.app/watawu

Support

https://caniuse.com/?search=structuredClone

Testing Strategy:

Called function directly

Copy link

changeset-bot bot commented Sep 10, 2024

🦋 Changeset detected

Latest commit: 36a7de8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 16 packages
Name Type
@remix-run/dev Patch
create-remix Patch
remix Patch
@remix-run/architect Patch
@remix-run/cloudflare Patch
@remix-run/cloudflare-pages Patch
@remix-run/cloudflare-workers Patch
@remix-run/css-bundle Patch
@remix-run/deno Patch
@remix-run/eslint-config Patch
@remix-run/express Patch
@remix-run/node Patch
@remix-run/react Patch
@remix-run/serve Patch
@remix-run/server-runtime Patch
@remix-run/testing Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@remix-cla-bot
Copy link
Contributor

remix-cla-bot bot commented Sep 10, 2024

Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳

@MichaelDeBoey MichaelDeBoey changed the title perf: change JSON.parse(JSON.stringify()) to structuredClone perf(remix-dev/vite): use structuredClone instead of JSON.parse(JSON.stringify()) Sep 10, 2024
.changeset/tall-jars-destroy.md Outdated Show resolved Hide resolved
.changeset/tall-jars-destroy.md Outdated Show resolved Hide resolved
@xSyki
Copy link
Author

xSyki commented Sep 11, 2024

@MichaelDeBoey Thanks for review, fixed

@xSyki xSyki requested a review from MichaelDeBoey September 11, 2024 13:27
@xSyki
Copy link
Author

xSyki commented Sep 17, 2024

@MichaelDeBoey Thanks for approve

@xSyki
Copy link
Author

xSyki commented Sep 24, 2024

@MichaelDeBoey Can we merge that one?

@brophdawg11 brophdawg11 requested review from pcattori and brophdawg11 and removed request for machour, brophdawg11 and brookslybrand September 30, 2024 18:21
@xSyki xSyki requested a review from brophdawg11 October 3, 2024 12:39
@xSyki
Copy link
Author

xSyki commented Oct 7, 2024

@brophdawg11 I changed it to what you suggested

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