Skip to content
This repository was archived by the owner on Apr 6, 2023. It is now read-only.

perf(nuxt): use simple JSON.stringify to compare params#8340

Merged
pi0 merged 1 commit intomainfrom
perf/no-hash
Oct 19, 2022
Merged

perf(nuxt): use simple JSON.stringify to compare params#8340
pi0 merged 1 commit intomainfrom
perf/no-hash

Conversation

@pi0
Copy link
Member

@pi0 pi0 commented Oct 19, 2022

🔗 Linked issue

#8327

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

Using JSON.stringify to compare two route params as suggested by @atinux. It saves 1.53Kb gzip (~1.6%) bundle size when pages are enabled by not importing ohash. Difference is that we assume order of params remains same.

Note: we probably need this library in other places in the future such as useFetch if depending on URL again (#6632).

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@codesandbox
Copy link

codesandbox bot commented Oct 19, 2022

CodeSandbox logoCodeSandbox logo  Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

@netlify
Copy link

netlify bot commented Oct 19, 2022

Deploy Preview for nuxt3-docs ready!

Name Link
🔨 Latest commit 3213cfd
🔍 Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/635016563fc2b50008cb1c76
😎 Deploy Preview https://deploy-preview-8340--nuxt3-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@pi0 pi0 merged commit 0f2ef5d into main Oct 19, 2022
@pi0 pi0 deleted the perf/no-hash branch October 19, 2022 15:31
@pi0 pi0 mentioned this pull request Nov 3, 2022
@danielroe danielroe added the 3.x label Jan 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants