@nuxt/docs-nightly 5.0.0-2611010245-9bacfea → 5.0.0-2611021907-7fdffb7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -48,7 +48,9 @@ export default defineNuxtConfig({
48
48
 
49
49
  To speed up client-side navigation, Nuxt adds resource hints for the JavaScript and CSS chunks a request resolves. `<link rel="preload">` (or `modulepreload`) marks the chunks the page itself needs, while `<link rel="prefetch">` marks the chunks the entry point and the rendered components lazy-import, so they are warm if the user later navigates to them.
50
50
 
51
- On a large app the prefetched set can grow past what a page actually needs. A public page and the signed-in app often share an entry chunk, so a prerendered public page can prefetch chunks that only the signed-in app uses. Prefetch hints have low download priority, but in volume they can still compete with the blocking stylesheet and delay first paint on a slow connection.
51
+ Preload hints take effect as soon as the HTML is parsed. Prefetch hints are rendered with `data-href` in place of `href`, so the browser ignores them until Nuxt activates them once the app is ready (see [`onNuxtReady`](/docs/api/utils/on-nuxt-ready)). That way they do not compete with the page's own resources while it loads. You can turn this off with [`experimental.deferPrefetchHints`](/docs/guide/going-further/experimental-features#deferprefetchhints). On a connection with data saver enabled, or a 2G connection, they are not activated at all. Routes served with [`noScripts`](/docs/guide/going-further/features#noscripts) have no client to activate them, so their non-script prefetch hints are rendered with `href`.
52
+
53
+ On a large app the prefetched set can grow past what a page actually needs. A public page and the signed-in app often share an entry chunk, so a prerendered public page can prefetch chunks that only the signed-in app uses, spending bandwidth on chunks the visitor never loads.
52
54
 
53
55
  To stop a chunk from being prefetched, set `prefetch` to `false` on its manifest entry in the [`build:manifest`](/docs/api/advanced/hooks#nuxt-hooks-build-time) hook:
54
56
 
@@ -339,6 +339,22 @@ export default defineNuxtConfig({
339
339
  Read more about the **Speculation Rules API**.
340
340
  ::
341
341
 
342
+ ## deferPrefetchHints
343
+
344
+ By default, Nuxt renders the `<link rel="prefetch">` hints for lazily imported chunks with `data-href` in place of `href`, and activates them once the app is ready (see [`onNuxtReady`](/docs/api/utils/on-nuxt-ready)). This keeps them from competing with the page's own resources while it loads.
345
+
346
+ If you need the browser to start prefetching these chunks as soon as the HTML is parsed, you can disable this feature:
347
+
348
+ ```ts twoslash [nuxt.config.ts]
349
+ export default defineNuxtConfig({
350
+ experimental: {
351
+ deferPrefetchHints: false,
352
+ },
353
+ })
354
+ ```
355
+
356
+ :read-more{to="/docs/guide/best-practices/performance#resource-hints"}
357
+
342
358
  ## viewTransition
343
359
 
344
360
  Enables View Transition API integration with client-side router.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt/docs-nightly",
3
- "version": "5.0.0-2611010245-9bacfea",
3
+ "version": "5.0.0-2611021907-7fdffb7",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/nuxt/nuxt.git",