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

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

Merged
merged 2 commits into from
Sep 7, 2022

Conversation

huang-julien
Copy link
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

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
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.

None yet

4 participants