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

feat(nuxt): tree-shake client and server-only composables - #5749

Merged
pi0 merged 5 commits into
mainfrom
feat/shake-composables
Jul 7, 2022
Merged

feat(nuxt): tree-shake client and server-only composables#5749
pi0 merged 5 commits into
mainfrom
feat/shake-composables

Conversation

@danielroe

Copy link
Copy Markdown
Member

🔗 Linked issue

nuxt/nuxt#14192

❓ 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

Certain vue composables are only called in a given context, and we can optimise our builds be extracting them. For example, a dynamic import in onMounted doesn't need to create a chunk (or worse, be inlined - see #5506) in the server build.

📝 Checklist

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

@danielroedanielroe added enhancement New feature or request 🍰 p2-nice-to-have Priority 2: nothing is broken but it's worth addressing labels Jul 6, 2022
@danielroe
danielroe requested a review from antfuJuly 6, 2022 13:54
@danielroedanielroe self-assigned this Jul 6, 2022
@netlify

netlifyBot commented Jul 6, 2022

Copy link
Copy Markdown

Deploy Preview for nuxt3-docs ready!

NameLink
🔨 Latest commit5287250
🔍 Latest deploy loghttps://app.netlify.com/sites/nuxt3-docs/deploys/62c59405a9d5720008a549f0
😎 Deploy Previewhttps://deploy-preview-5749--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.

@netlify

netlifyBot commented Jul 6, 2022

Copy link
Copy Markdown

Deploy Preview for nuxt3-docs ready!

NameLink
🔨 Latest commit37d6823
🔍 Latest deploy loghttps://app.netlify.com/sites/nuxt3-docs/deploys/62c6bde0f7b25d0008ef067d
😎 Deploy Previewhttps://deploy-preview-5749--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.

Comment threadpackages/nuxt/src/core/nuxt.ts Outdated
Comment threadpackages/nuxt/src/core/plugins/tree-shake.ts
Comment threadpackages/nuxt/src/core/plugins/tree-shake.ts Outdated
Comment threadpackages/nuxt/src/core/nuxt.ts Outdated
Comment threadpackages/nuxt/src/core/nuxt.ts Outdated
@pi0pi0 changed the title feat(nuxt): add plugin to tree-shake composablesfeat(nuxt): tree-shake client and server-only composablesJul 6, 2022
@danielroe
danielroeforce-pushed the feat/shake-composables branch from 7270a45 to 37d6823CompareJuly 7, 2022 11:05
@danielroe
danielroe requested a review from pi0July 7, 2022 11:11
pi0
pi0 approved these changes Jul 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.

LGTM! Nice work (didn't tried locally)

@pi0
pi0 merged commit 4d60708 into mainJul 7, 2022
@pi0
pi0 deleted the feat/shake-composables branch July 7, 2022 16:04
@pi0pi0 mentioned this pull request Jul 11, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

3.xenhancementNew feature or request🍰 p2-nice-to-havePriority 2: nothing is broken but it's worth addressing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@danielroe@pi0@antfu