Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

danielroe
Copy link
Member

@danielroe danielroe commented Mar 21, 2024

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme or JSdoc annotations)
  • 🐞 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)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Spotted this opportunity to improve performance - we deliberately do not tree-shake any other composables in dev mode, but weren't checking before inserting useServerHead.

This should mean we don't need to run that vite plugin at all and it won't be initialised:

if (Object.keys(clientTreeShakeOptions.composables).length) {
addVitePlugin(() => TreeShakeComposablesPlugin.vite(clientTreeShakeOptions), { server: false })
addWebpackPlugin(() => TreeShakeComposablesPlugin.webpack(clientTreeShakeOptions), { server: false })
}

cc: @harlan-zw in case there's a reason we should tree-shake it in dev mode

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have added tests (if possible).
  • I have updated the documentation accordingly.

Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@harlan-zw
Copy link
Contributor

harlan-zw commented Mar 21, 2024

Nice, can't imagine it would be an issue

@danielroe danielroe merged commit 57b8d97 into main Mar 21, 2024
@danielroe danielroe deleted the perf/tree-shake-head-dev branch March 21, 2024 12:17
@github-actions github-actions bot mentioned this pull request Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants