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

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

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

perf(nuxt): cache createClientOnly wrapper using weakmap#7297
pi0 merged 2 commits into
nuxt: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

netlifyBot commented Sep 6, 2022

Copy link
Copy Markdown

Deploy Preview for nuxt3-docs canceled.

NameLink
🔨 Latest commit0875881
🔍 Latest deploy loghttps://app.netlify.com/sites/nuxt3-docs/deploys/63178a2ce975450008ebce5a

@pi0pi0 changed the title perf(nuxt): add WeakMap to cache createClientOnly componentsperf(nuxt): cache createClientOnly wrapper using weakmapSep 7, 2022
pi0
pi0 approved these changes Sep 7, 2022

@pi0pi0 left a comment

Copy link
Copy Markdown
Member

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:mainSep 7, 2022
This was referenced Sep 9, 2022
Sign up for freeto 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

@huang-julien@pi0@antfu@danielroe