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

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

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

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

Conversation

@danielroe
Copy link
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.

@danielroe danielroe 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 antfu July 6, 2022 13:54
@danielroe danielroe self-assigned this Jul 6, 2022
@netlify
Copy link

netlify bot commented Jul 6, 2022

Deploy Preview for nuxt3-docs ready!

Name Link
🔨 Latest commit 5287250
🔍 Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/62c59405a9d5720008a549f0
😎 Deploy Preview https://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
Copy link

netlify bot commented Jul 6, 2022

Deploy Preview for nuxt3-docs ready!

Name Link
🔨 Latest commit 37d6823
🔍 Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/62c6bde0f7b25d0008ef067d
😎 Deploy Preview https://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.

@pi0 pi0 changed the title feat(nuxt): add plugin to tree-shake composables feat(nuxt): tree-shake client and server-only composables Jul 6, 2022
@danielroe danielroe force-pushed the feat/shake-composables branch from 7270a45 to 37d6823 Compare July 7, 2022 11:05
@danielroe danielroe requested a review from pi0 July 7, 2022 11:11
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.

LGTM! Nice work (didn't tried locally)

@pi0 pi0 merged commit 4d60708 into main Jul 7, 2022
@pi0 pi0 deleted the feat/shake-composables branch July 7, 2022 16:04
@pi0 pi0 mentioned this pull request Jul 11, 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

3.x enhancement New feature or request 🍰 p2-nice-to-have Priority 2: nothing is broken but it's worth addressing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants