diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml index 8723dc6692..e781898a7a 100644 --- a/.github/workflows/dependency-review.yml +++ b/.github/workflows/dependency-review.yml @@ -19,4 +19,4 @@ jobs: - name: 'Checkout Repository' uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: 'Dependency Review' - uses: actions/dependency-review-action@0fa40c3c10055986a88de3baa0d6ec17c5a894b3 # v4.2.3 + uses: actions/dependency-review-action@733dd5d4a5203f238c33806593ec0f5fc5343d8c # v4.2.4 diff --git a/docs/2.guide/2.directory-structure/1.components.md b/docs/2.guide/2.directory-structure/1.components.md index a33a0cbff8..0685a3389c 100644 --- a/docs/2.guide/2.directory-structure/1.components.md +++ b/docs/2.guide/2.directory-structure/1.components.md @@ -299,6 +299,10 @@ Now you can register server-only components with the `.server` suffix and use th Server-only components use [``](/docs/api/components/nuxt-island) under the hood, meaning that `lazy` prop and `#fallback` slot are both passed down to it. +::alert{type=warning} +Server components (and islands) must have a single root element. (HTML comments are considered elements as well.) +:: + ::alert{type=warning} Most features for server-only components and island components, such as slots and client components, are only available for single file components. :: diff --git a/docs/2.guide/2.directory-structure/1.pages.md b/docs/2.guide/2.directory-structure/1.pages.md index bef7ad02d2..6ebd687bb1 100644 --- a/docs/2.guide/2.directory-structure/1.pages.md +++ b/docs/2.guide/2.directory-structure/1.pages.md @@ -57,7 +57,7 @@ If you are using [`app.vue`](/docs/guide/directory-structure/app), make sure to ``` -Pages **must have a single root element** to allow [route transitions](/docs/getting-started/transitions) between pages, HTML comments are considered elements as well. +Pages **must have a single root element** to allow [route transitions](/docs/getting-started/transitions) between pages. HTML comments are considered elements as well. This means that when the route is server-rendered, or statically generated, you will be able to see its contents correctly, but when you navigate towards that route during client-side navigation the transition between routes will fail and you'll see that the route will not be rendered. @@ -365,6 +365,10 @@ You can define a page as [client only](/docs/guide/directory-structure/component You can define a page as [server only](/docs/guide/directory-structure/components#server-components) by giving it a `.server.vue` suffix. While you will be able to navigate to the page using client-side navigation, controlled by `vue-router`, it will be rendered with a server component automatically, meaning the code required to render the page will not be in your client-side bundle. +::alert{type=warning} +Server-only pages must have a single root element. (HTML comments are considered elements as well.) +:: + ## Custom Routing As your app gets bigger and more complex, your routing might require more flexibility. For this reason, Nuxt directly exposes the router, routes and router options for customization in different ways. diff --git a/package.json b/package.json index 1f59ebf7c9..fbe4a76551 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@nuxt/webpack-builder": "workspace:*", "rollup": "^4.13.0", "nuxt": "workspace:*", - "vite": "5.2.5", + "vite": "5.2.6", "vue": "3.4.21", "magic-string": "^0.30.8" }, @@ -68,7 +68,7 @@ "fs-extra": "11.2.0", "globby": "14.0.1", "h3": "1.11.1", - "happy-dom": "14.3.3", + "happy-dom": "14.3.6", "jiti": "1.21.0", "markdownlint-cli": "0.39.0", "nitropack": "2.9.4", diff --git a/packages/kit/package.json b/packages/kit/package.json index 000c6294b0..20af6be35a 100644 --- a/packages/kit/package.json +++ b/packages/kit/package.json @@ -52,7 +52,7 @@ "lodash-es": "4.17.21", "nitropack": "2.9.4", "unbuild": "latest", - "vite": "5.2.5", + "vite": "5.2.6", "vitest": "1.4.0", "webpack": "5.91.0" }, diff --git a/packages/nuxt/package.json b/packages/nuxt/package.json index 2a5e672358..40a162f6b8 100644 --- a/packages/nuxt/package.json +++ b/packages/nuxt/package.json @@ -66,9 +66,9 @@ "@nuxt/telemetry": "^2.5.3", "@nuxt/ui-templates": "^1.3.1", "@nuxt/vite-builder": "workspace:*", - "@unhead/dom": "^1.8.20", - "@unhead/ssr": "^1.8.20", - "@unhead/vue": "^1.8.20", + "@unhead/dom": "^1.9.1", + "@unhead/ssr": "^1.9.1", + "@unhead/vue": "^1.9.1", "@vue/shared": "^3.4.21", "acorn": "8.11.3", "c12": "^1.10.0", @@ -122,7 +122,7 @@ "@types/fs-extra": "11.0.4", "@vitejs/plugin-vue": "5.0.4", "unbuild": "latest", - "vite": "5.2.5", + "vite": "5.2.6", "vitest": "1.4.0" }, "peerDependencies": { diff --git a/packages/nuxt/src/components/islandsTransform.ts b/packages/nuxt/src/components/islandsTransform.ts index 5d4f452508..da41e693df 100644 --- a/packages/nuxt/src/components/islandsTransform.ts +++ b/packages/nuxt/src/components/islandsTransform.ts @@ -34,6 +34,7 @@ const HAS_SLOT_OR_CLIENT_RE = /(]*>)|(nuxt-client)/ const TEMPLATE_RE = /