Replies: 6 comments 10 replies
-
Wow, great work! Counting the days until Nuxt 3.7 release to test |
Beta Was this translation helpful? Give feedback.
-
FYI the Hash Hydration Plugin will no longer be included with this flag. While it will be useful for some sites, there are certain limitations that have been discovered while testing in production that make it not worth including in the scope of this flag. I plan to introduce some more features on this flag once 3.7 is out. |
Beta Was this translation helpful? Give feedback.
-
Hi, thanks for the great work! I have an issue with naiveui on this new release The existing server plugin is used to override FYI, naiveui style tags are returned from the Is there a way to inject these styles without overriding Edit: I just have figured out how to solve this nuxtApp.ssrContext?.head.hooks.hook("ssr:rendered", (ctx) => {
ctx.html.headTags += collect();
}); |
Beta Was this translation helpful? Give feedback.
-
After the update, |
Beta Was this translation helpful? Give feedback.
-
Hello, I would like to ask if I should use the nuxt-capo module for now or just enable the headNext option in the settings. These two approaches will have different results. |
Beta Was this translation helpful? Give feedback.
-
Hello, I've enable headNext for unjs/website, see unjs/website#254, but the head does not seems to be ordered. |
Beta Was this translation helpful? Give feedback.
-
Introduction
In v3.7.0 we introduce an experimental flag
headNext
(#22620) that aims to improve the DX and performance of your head.We need help testing these features on a wider set of sites with the goal of enabling these by default in a future Nuxt release (v3.8.0).
If you opt-in to this experimental feature, we would love to get your feedback! Sharing your web vitals pre and post-flag would be appreciated.
Optimizations
Currently, the improvements are scoped to two core Unhead plugins.
Capo.js
When rendering your head tags, we render them as they are registered, except for some critical tags.
For example, a
<title>
and<meta viewport...>
tag will always be first in your<head>
This can give you some predictability in terms of where and when you're registering your head data.
However, it never guarantees that the tags are in the best position for performance. It only guarantees that tags will be in the right position, so as not to break your site.
In Nuxt 3.7.0, we have moved all head tags to be rendered with Unhead, giving us the ability to re-order all tags, including your apps tags alongside Nuxt core tags.
When using the
headNext
flag, Capo.js ordering will be applied. Capo.js is an awesome project trying to bring some structure to the head, making sure tags are rendered in the best order for performance.We hope to see some performance improvements with this, especially for large sites that may have many third-party styles and scripts.
We're teaming up with the Google Aurora team to track the performance of this new ordering. The attribute (
<html data-capo>
) is added to make that tracking easier.See the CapoPlugin to learn more.
Beta Was this translation helpful? Give feedback.
All reactions