-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
feat(nuxt): render all head tags on server with unhead
#22179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
unhead
unhead
unhead
unhead
Related: #21793 Will cause a conflict, should merge the other one first probably. |
I was thinking this PR would close that one. But maybe I misunderstood? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lovely.
unhead
unhead
Just to add that in my testing, this is slightly faster than our existing implementation. New approach (basic fixture)
Old approach (basic fixture)
New approach (minimal fixture)
Old approach (minimal fixture)
|
Awesome! π |
π Linked issue
resolves #22082
unjs/unhead#116
β Type of change
π Description
Currently, Nuxt users will modify their pages using
useHead
or nuxt.config appHead This appears to be stable and working well.The Nuxt core itself though does not rely on this same API, instead opting for building head output using strings and hardcoding output ordering.
By migrating all head output to go through Unhead we get the following:
This comes at a likely very small performance cost for SSR. A benchmark would be useful.
Performance Improvement
While these changes should be mostly safe, it will require a delicate eye over the migration to make sure I haven't omitted any previous tags or changed the order. I don't think it's safe to implement app-wide head re-ordering just yet.
ssrContext.renderMeta
won't work anymore, afaik this was internal and shouldn't really be used in any production apps?#head-static
, shouldn't be usedπ Checklist