Skip to content
This repository was archived by the owner on Apr 6, 2023. It is now read-only.

Commit 4f953e8

Browse files
authored
Merge branch 'main' into fix/vite-node-cache
2 parents 57fb1e5 + 71b40a1 commit 4f953e8

File tree

11 files changed

+121
-46
lines changed

11 files changed

+121
-46
lines changed

docs/content/3.api/1.composables/use-head.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
Nuxt provides a composable to update the head properties of your page with an [`MetaObject`](/api/composables/use-head/#metaobject) of meta properties with keys corresponding to meta tags:
66

7-
`title`, `base`, `script`, `style`, `meta` and `link`, as well as `htmlAttrs` and `bodyAttrs`. Alternatively, you can pass a function returning the object for reactive metadata.
7+
`title`, `base`, `script`, `noscript`, `style`, `meta` and `link`, as well as `htmlAttrs` and `bodyAttrs`. Alternatively, you can pass a function returning the object for reactive metadata.
88

99
```js
1010
useHead(options: MetaObject)
@@ -43,5 +43,6 @@ export default {
4343
* **link**: array, each item maps to a newly-created `<link>` element, where object properties map to attributes.
4444
* **style**: array, each item maps to a newly-created `<style>` element, where object properties map to attributes.
4545
* **script**: array, each item maps to a newly-created `<script>` element, where object properties map to attributes.
46+
* **noscript**: array, each item maps to a newly-created `<noscript>` element, where object properties map to attributes.
4647

4748
All elements in the meta object are optional. You can also pass only single values.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@
5959
"globby": "^13.1.2",
6060
"jiti": "^1.14.0",
6161
"lerna": "^5.2.0",
62-
"markdownlint-cli": "^0.32.0",
62+
"markdownlint-cli": "^0.32.1",
6363
"pathe": "^0.3.2",
6464
"rimraf": "^3.0.2",
6565
"typescript": "^4.7.4",
6666
"unbuild": "^0.7.6",
67-
"vitest": "^0.19.0",
67+
"vitest": "^0.19.1",
6868
"vue-tsc": "^0.39.0"
6969
},
7070
"packageManager": "[email protected]",

packages/nuxt/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"unctx": "^1.1.4",
6565
"unenv": "^0.5.2",
6666
"unimport": "^0.6.3",
67-
"unplugin": "^0.7.2",
67+
"unplugin": "^0.8.0",
6868
"untyped": "^0.4.4",
6969
"vue": "^3.2.37",
7070
"vue-bundle-renderer": "^0.3.9",

packages/nuxt/src/app/components/nuxt-error-boundary.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ import { defineComponent, ref, onErrorCaptured } from 'vue'
22
import { useNuxtApp } from '#app'
33

44
export default defineComponent({
5+
emits: {
6+
error (_error: unknown) {
7+
return true
8+
}
9+
},
510
setup (_props, { slots, emit }) {
611
const error = ref(null)
712
const nuxtApp = useNuxtApp()

packages/nuxt/src/head/runtime/components.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,29 @@ export const Script = defineComponent({
8686
}))
8787
})
8888

89+
// <noscript>
90+
export const NoScript = defineComponent({
91+
name: 'NoScript',
92+
inheritAttrs: false,
93+
props: {
94+
...globalProps,
95+
title: String
96+
},
97+
setup: setupForUseMeta((props, { slots }) => {
98+
const noscript = { ...props }
99+
const textContent = (slots.default?.() || [])
100+
.filter(({ children }) => children)
101+
.map(({ children }) => children)
102+
.join('')
103+
if (textContent) {
104+
noscript.children = textContent
105+
}
106+
return {
107+
noscript: [noscript]
108+
}
109+
})
110+
})
111+
89112
// <link>
90113
export const Link = defineComponent({
91114
name: 'Link',

packages/schema/src/config/_app.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ export default {
9393
* // <style type="text/css">:root { color: red }</style>
9494
* { children: ':root { color: red }', type: 'text/css' }
9595
* ]
96+
* noscript: [
97+
* // <noscript>Javascript is required</noscript>
98+
* { children: 'Javascript is required' }
99+
* ]
96100
* }
97101
* }
98102
* ```

packages/schema/src/types/meta.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ export interface MetaObject extends Record<string, any> {
2121
style?: Array<Record<string, any>>
2222
/** Each item in the array maps to a newly-created `<script>` element, where object properties map to attributes. */
2323
script?: Array<Record<string, any>>
24+
/** Each item in the array maps to a newly-created `<noscript>` element, where object properties map to attributes. */
25+
noscript?: Array<Record<string, any>>
2426

2527
titleTemplate?: string | ((title: string) => string)
2628
title?: string
27-
29+
2830
bodyAttrs?: Record<string, any>
2931
htmlAttrs?: Record<string, any>
3032
}

packages/test-utils/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
"ohmyfetch": "^0.4.18"
2323
},
2424
"devDependencies": {
25-
"playwright": "^1.24.0",
25+
"playwright": "^1.24.1",
2626
"unbuild": "latest",
27-
"vitest": "^0.19.0"
27+
"vitest": "^0.19.1"
2828
},
2929
"peerDependencies": {
3030
"vue": "^3.2.37"

packages/vite/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@
4444
"postcss": "^8.4.14",
4545
"postcss-import": "^14.1.0",
4646
"postcss-url": "^10.1.3",
47-
"rollup": "^2.77.0",
47+
"rollup": "^2.77.1",
4848
"rollup-plugin-visualizer": "^5.7.1",
4949
"ufo": "^0.8.5",
50-
"unplugin": "^0.7.2",
50+
"unplugin": "^0.8.0",
5151
"vite": "~3.0.3",
52-
"vite-node": "^0.19.0",
52+
"vite-node": "^0.19.1",
5353
"vite-plugin-checker": "^0.4.9"
5454
},
5555
"peerDependencies": {

packages/webpack/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"style-resources-loader": "^1.5.0",
4646
"time-fix-plugin": "^2.0.7",
4747
"ufo": "^0.8.5",
48-
"unplugin": "^0.7.2",
48+
"unplugin": "^0.8.0",
4949
"url-loader": "^4.1.1",
5050
"vue-loader": "^17.0.0",
5151
"webpack": "^5.74.0",

0 commit comments

Comments
 (0)