Skip to content

Commit

Permalink
perf: change JSON.parse(JSON.stringify()) to structuredClone
Browse files Browse the repository at this point in the history
  • Loading branch information
xSyki authored and MichaelDeBoey committed Oct 7, 2024
1 parent 6ee69c1 commit 82844e1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -707,3 +707,4 @@
- zayenz
- zhe
- zwhitchcox
- xSyki
2 changes: 1 addition & 1 deletion packages/remix-dev/vite/static/refresh-utils.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function debounce(fn, delay) {
const enqueueUpdate = debounce(async () => {
let manifest;
if (routeUpdates.size > 0) {
manifest = JSON.parse(JSON.stringify(__remixManifest));
manifest = structuredClone(__remixManifest);

for (let route of routeUpdates.values()) {
manifest.routes[route.id] = route;
Expand Down

0 comments on commit 82844e1

Please sign in to comment.