-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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-server-runtime): use faster alternative to jsesc
#3889
perf(remix-server-runtime): use faster alternative to jsesc
#3889
Conversation
🦋 Changeset detectedLatest commit: bd3add7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 16 packages
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 |
Hi @redabacha, Welcome, and thank you for contributing to Remix! Before we consider your pull request, we ask that you sign our Contributor License Agreement (CLA). We require this only once. You may review the CLA and sign it by adding your name to contributors.yml. Once the CLA is signed, the If you have already signed the CLA and received this response in error, or if you have any questions, please contact us at hello@remix.run. Thanks! - The Remix team |
Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳 |
jsesc
the single test failure seems unrelated. i'm also seeing it happen in other prs e.g. https://github.com/remix-run/remix/runs/7671223447?check_suite_focus=true |
Going to have to double check, but I believe the serialization method needs to be consistent across machines / runtimes. I.e, |
according to mdn, https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#description:
so my guess is that it would be fine. next.js seem to be getting away with just using JSON.stringify (and JSON.parse on the client). |
@jacob-ebey i've added additional benchmarks with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Just one request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me 👍
Closes: #3854
Testing Strategy:
used a faster version of
jsesc
to serialize the server handoff very much inspired by what next.js has done here. created a benchmark here (which i also included some other libraries in the comparison for additional points of reference).results from my machine: