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

perf(nuxt): cache createClientOnly wrapper using weakmap#7297

Merged
pi0 merged 2 commits intonuxt:mainfrom
huang-julien:perf/createClientOnly
Sep 7, 2022
Merged

perf(nuxt): cache createClientOnly wrapper using weakmap#7297
pi0 merged 2 commits intonuxt:mainfrom
huang-julien:perf/createClientOnly

Conversation

@huang-julien
Copy link
Copy Markdown
Member

🔗 Linked issue

PR #7243

❓ 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

Hi ! this PR is based on PR #7243 and @antfu suggestion to use a WeakMap. This avoid to recreate another client only component when a .client component is called multiple times.

📝 Checklist

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

@netlify
Copy link
Copy Markdown

netlify Bot commented Sep 6, 2022

Deploy Preview for nuxt3-docs canceled.

Name Link
🔨 Latest commit 0875881
🔍 Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/63178a2ce975450008ebce5a

@pi0 pi0 changed the title perf(nuxt): add WeakMap to cache createClientOnly components perf(nuxt): cache createClientOnly wrapper using weakmap Sep 7, 2022
Copy link
Copy Markdown
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice change 💯

@pi0 pi0 merged commit f8f5771 into nuxt:main Sep 7, 2022
This was referenced Sep 9, 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.

4 participants