@nuxt/docs-nightly 5.0.0-29745181.e6d3afa3 → 5.0.0-29745236.03b5deeb
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.
|
@@ -65,6 +65,7 @@ When you set your `future.compatibilityVersion` to `5`, defaults throughout your
|
|
|
65
65
|
- **Non-async `callHook`**: [`callHook` may return `void`](/docs/4.x/getting-started/upgrade#non-async-callhook) instead of always returning a `Promise`
|
|
66
66
|
- **Comment node placeholders**: Client-only components use [comment nodes instead of `<div>`](/docs/4.x/getting-started/upgrade#client-only-comment-placeholders) as SSR placeholders, fixing a scoped styles hydration issue
|
|
67
67
|
- **Stricter side-effect imports**: The generated `tsconfig.json` enables [`noUncheckedSideEffectImports`](/docs/4.x/getting-started/upgrade#stricter-side-effect-imports) to match the TypeScript 7 default
|
|
68
|
+
- **Vue Options API disabled**: The [Options API is compiled out of the client bundle](/docs/4.x/getting-started/upgrade#vue-options-api-disabled-by-default) to reduce its size
|
|
68
69
|
- Other Nuxt 5 improvements and changes as they become available
|
|
69
70
|
|
|
70
71
|
::note
|
|
@@ -588,3 +589,31 @@ export default defineNuxtConfig({
|
|
|
588
589
|
})
|
|
589
590
|
```
|
|
590
591
|
::
|
|
592
|
+
|
|
593
|
+
### Vue Options API Disabled by Default
|
|
594
|
+
|
|
595
|
+
🚦 **Impact Level**: Minimal
|
|
596
|
+
|
|
597
|
+
#### What Changed
|
|
598
|
+
|
|
599
|
+
With `compatibilityVersion: 5`, Nuxt sets Vue's [`__VUE_OPTIONS_API__`](https://vuejs.org/api/compile-time-flags#VUE_OPTIONS_API) feature flag to `false`, which compiles Vue's Options API runtime out of the client bundle.
|
|
600
|
+
|
|
601
|
+
#### Reasons for Change
|
|
602
|
+
|
|
603
|
+
The Options API runtime ships in every client bundle even though most Nuxt applications are written with the Composition API and `<script setup>`. Dropping it shrinks the client bundle (around 6 kB minified / 2 kB gzipped on a minimal app).
|
|
604
|
+
|
|
605
|
+
#### Migration Steps
|
|
606
|
+
|
|
607
|
+
If any of your components (or a dependency's components) use the Options API (`export default { data() {}, methods: {}, ... }`), re-enable it in your `nuxt.config`:
|
|
608
|
+
|
|
609
|
+
```ts twoslash [nuxt.config.ts]
|
|
610
|
+
export default defineNuxtConfig({
|
|
611
|
+
vue: {
|
|
612
|
+
optionsApi: true,
|
|
613
|
+
},
|
|
614
|
+
})
|
|
615
|
+
```
|
|
616
|
+
|
|
617
|
+
::note
|
|
618
|
+
`defineNuxtComponent` is unaffected: its `asyncData` and `head` options are handled through `setup()` rather than the Vue Options API, so it works regardless of this flag.
|
|
619
|
+
::
|