perf(head): drop @vueuse/head dependency#19519
Merged
Merged
Conversation
|
|
harlan-zw
commented
Mar 8, 2023
danielroe
reviewed
Mar 8, 2023
danielroe
reviewed
Mar 8, 2023
Merged
Member
|
👍 Nice! Unrelated @harlan-zw: Do you think it makes sense to deprecate |
danielroe
reviewed
Mar 8, 2023
danielroe
reviewed
Mar 8, 2023
Contributor
Author
Yup! This is planned once I sort out a couple more outstanding issues. |
@vueuse/head dependency@vueuse/head dependency
danielroe
approved these changes
Mar 8, 2023
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 Linked issue
❓ Type of change
📚 Description
Related: #19302
Switching to using Unhead directly allows for better tree-shaking (i.e @unhead/dom from server build), simplifies the code, and minimizes dependencies.
The issue with dropping the dependency is any modules or third-party code which used the pre-v1 API @vueuse/head and/or directly imported from it may break. The scope of that is quite hard to determine.
We can solve issue using a polyfill and an alias. If we're okay with potentially breaking code for some codebases relying on old low level @vueuse/head code, then we could ship without the polyfill enabled by default.
Without the polyfill, there's a 0.47kB client bundle improvement, otherwise, it's only 0.1kB. This unlocks further optimizations.
📝 Checklist