From: Evan You Date: Tue, 5 Dec 2023 02:54:20 +0000 (+0800) Subject: chore: Merge branch 'main' into minor X-Git-Tag: v3.4.0-beta.1~37 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a817883c266573d94b318f78d7f54e508cba8a21;p=thirdparty%2Fvuejs%2Fcore.git chore: Merge branch 'main' into minor --- a817883c266573d94b318f78d7f54e508cba8a21 diff --cc package.json index 1f4d5e9948,0dfa0df482..9564d3e51f --- a/package.json +++ b/package.json @@@ -32,9 -32,10 +32,10 @@@ "dev-sfc-run": "run-p \"dev compiler-sfc -f esm-browser\" \"dev vue -if esm-bundler-runtime\" \"dev vue -ipf esm-browser-runtime\" \"dev server-renderer -if esm-bundler\" dev-sfc-serve", "serve": "serve", "open": "open http://localhost:3000/packages/template-explorer/local.html", - "build-sfc-playground": "run-s build-all-cjs build-runtime-esm build-ssr-esm build-sfc-playground-self", + "build-sfc-playground": "run-s build-all-cjs build-runtime-esm build-browser-esm build-ssr-esm build-sfc-playground-self", - "build-all-cjs": "node scripts/build.js vue runtime compiler reactivity reactivity-transform shared -af cjs", + "build-all-cjs": "node scripts/build.js vue runtime compiler reactivity shared -af cjs", "build-runtime-esm": "node scripts/build.js runtime reactivity shared -af esm-bundler && node scripts/build.js vue -f esm-bundler-runtime && node scripts/build.js vue -f esm-browser-runtime", + "build-browser-esm": "node scripts/build.js runtime reactivity shared -af esm-bundler && node scripts/build.js vue -f esm-bundler && node scripts/build.js vue -f esm-browser", "build-ssr-esm": "node scripts/build.js compiler-sfc server-renderer -f esm-browser", "build-sfc-playground-self": "cd packages/sfc-playground && npm run build", "preinstall": "npx only-allow pnpm", diff --cc packages/compiler-core/__tests__/__snapshots__/parse.spec.ts.snap index 8886ce3371,5217a15023..63dea7e19d --- a/packages/compiler-core/__tests__/__snapshots__/parse.spec.ts.snap +++ b/packages/compiler-core/__tests__/__snapshots__/parse.spec.ts.snap @@@ -89,16 -75,34 +89,16 @@@ exports[`compiler: parse > Edge Cases "cached": 0, "children": [ { - "children": [ - { - "content": "", - "loc": { - "end": { - "column": 17, - "line": 1, - "offset": 16, - }, - "source": "", - "start": { - "column": 11, - "line": 1, - "offset": 10, - }, - }, - "type": 3, - }, - ], + "children": [], "codegenNode": undefined, - "isSelfClosing": false, + "isSelfClosing": true, "loc": { "end": { - "column": 28, + "column": 37, "line": 1, - "offset": 27, + "offset": 36, }, - "source": "
", - "source": "", ++ "source": "
", "start": { "column": 1, "line": 1, @@@ -106,147 -110,78 +106,147 @@@ }, }, "ns": 0, - "props": [], - "tag": "template", - "tagType": 0, - "type": 1, - }, - ], - "codegenNode": undefined, - "components": [], - "directives": [], - "helpers": Set {}, - "hoists": [], - "imports": [], - "loc": { - "end": { - "column": 28, - "line": 1, - "offset": 27, - }, - "source": "", - "start": { - "column": 1, - "line": 1, - "offset": 0, - }, - }, - "temps": 0, - "type": 0, -} -`; - -exports[`compiler: parse > Errors > ABRUPT_CLOSING_OF_EMPTY_COMMENT > 1`] = ` -{ - "cached": 0, - "children": [ - { - "children": [ + "props": [ { - "content": "", + "arg": { + "constType": 3, + "content": "class", + "isStatic": true, + "loc": { + "end": { + "column": 12, + "line": 1, + "offset": 11, + }, + "source": "class", + "start": { + "column": 7, + "line": 1, + "offset": 6, + }, + }, + "type": 4, + }, + "exp": { + "constType": 0, + "content": "{ some: condition }", + "isStatic": false, + "loc": { + "end": { + "column": 33, + "line": 1, + "offset": 32, + }, + "source": "{ some: condition }", + "start": { + "column": 14, + "line": 1, + "offset": 13, + }, + }, + "type": 4, + }, "loc": { "end": { - "column": 18, + "column": 34, "line": 1, - "offset": 17, + "offset": 33, }, - "source": ":class=\\"{ some: condition }\\"", - "source": "", ++ "source": ":class="{ some: condition }"", "start": { - "column": 11, + "column": 6, "line": 1, - "offset": 10, + "offset": 5, }, }, - "type": 3, + "modifiers": [], + "name": "bind", + "rawName": ":class", + "type": 7, }, ], + "tag": "div", + "tagType": 0, + "type": 1, + }, + { + "children": [], "codegenNode": undefined, - "isSelfClosing": false, + "isSelfClosing": true, "loc": { "end": { - "column": 29, - "line": 1, - "offset": 28, + "column": 37, + "line": 2, + "offset": 73, }, - "source": "

", - "source": "", ++ "source": "

", "start": { "column": 1, - "line": 1, - "offset": 0, + "line": 2, + "offset": 37, }, }, "ns": 0, - "props": [], - "tag": "template", + "props": [ + { + "arg": { + "constType": 3, + "content": "style", + "isStatic": true, + "loc": { + "end": { + "column": 16, + "line": 2, + "offset": 52, + }, + "source": "style", + "start": { + "column": 11, + "line": 2, + "offset": 47, + }, + }, + "type": 4, + }, + "exp": { + "constType": 0, + "content": "{ color: 'red' }", + "isStatic": false, + "loc": { + "end": { + "column": 34, + "line": 2, + "offset": 70, + }, + "source": "{ color: 'red' }", + "start": { + "column": 18, + "line": 2, + "offset": 54, + }, + }, + "type": 4, + }, + "loc": { + "end": { + "column": 35, + "line": 2, + "offset": 71, + }, - "source": "v-bind:style=\\"{ color: 'red' }\\"", ++ "source": "v-bind:style="{ color: 'red' }"", + "start": { + "column": 4, + "line": 2, + "offset": 40, + }, + }, + "modifiers": [], + "name": "bind", + "rawName": "v-bind:style", + "type": 7, + }, + ], + "tag": "p", "tagType": 0, "type": 1, }, @@@ -259,20 -194,17 +259,20 @@@ "imports": [], "loc": { "end": { - "column": 29, - "line": 1, - "offset": 28, + "column": 37, + "line": 2, + "offset": 73, }, - "source": "

-

", - "source": "", ++ "source": "

++

", "start": { "column": 1, "line": 1, "offset": 0, }, }, - "source": "

-

", ++ "source": "

++

", "temps": 0, "type": 0, } @@@ -285,224 -217,25 +285,224 @@@ exports[`compiler: parse > Edge Cases { "children": [ { - "content": "[CDATA[cdata]]", + "children": [], + "codegenNode": undefined, + "isSelfClosing": true, "loc": { "end": { - "column": 28, - "line": 1, - "offset": 27, + "column": 39, + "line": 2, + "offset": 73, }, - "source": "

", - "source": "", ++ "source": "

", "start": { - "column": 11, - "line": 1, - "offset": 10, + "column": 3, + "line": 2, + "offset": 37, + }, + }, + "ns": 0, + "props": [ + { + "arg": { + "constType": 3, + "content": "style", + "isStatic": true, + "loc": { + "end": { + "column": 18, + "line": 2, + "offset": 52, + }, + "source": "style", + "start": { + "column": 13, + "line": 2, + "offset": 47, + }, + }, + "type": 4, + }, + "exp": { + "constType": 0, + "content": "{ color: 'red' }", + "isStatic": false, + "loc": { + "end": { + "column": 36, + "line": 2, + "offset": 70, + }, + "source": "{ color: 'red' }", + "start": { + "column": 20, + "line": 2, + "offset": 54, + }, + }, + "type": 4, + }, + "loc": { + "end": { + "column": 37, + "line": 2, + "offset": 71, + }, - "source": "v-bind:style=\\"{ color: 'red' }\\"", ++ "source": "v-bind:style="{ color: 'red' }"", + "start": { + "column": 6, + "line": 2, + "offset": 40, + }, + }, + "modifiers": [], + "name": "bind", + "rawName": "v-bind:style", + "type": 7, + }, + ], + "tag": "p", + "tagType": 0, + "type": 1, + }, + { + "content": " a comment with inside it ", + "loc": { + "end": { + "column": 43, + "line": 3, + "offset": 116, + }, + "source": "", + "start": { + "column": 3, + "line": 3, + "offset": 76, }, }, "type": 3, }, ], "codegenNode": undefined, - "isSelfClosing": false, + "loc": { + "end": { + "column": 7, + "line": 4, + "offset": 123, + }, - "source": "

-

++ "source": "

++

+ +

", + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "ns": 0, + "props": [ + { + "arg": { + "constType": 3, + "content": "class", + "isStatic": true, + "loc": { + "end": { + "column": 12, + "line": 1, + "offset": 11, + }, + "source": "class", + "start": { + "column": 7, + "line": 1, + "offset": 6, + }, + }, + "type": 4, + }, + "exp": { + "constType": 0, + "content": "{ some: condition }", + "isStatic": false, + "loc": { + "end": { + "column": 33, + "line": 1, + "offset": 32, + }, + "source": "{ some: condition }", + "start": { + "column": 14, + "line": 1, + "offset": 13, + }, + }, + "type": 4, + }, + "loc": { + "end": { + "column": 34, + "line": 1, + "offset": 33, + }, - "source": ":class=\\"{ some: condition }\\"", ++ "source": ":class="{ some: condition }"", + "start": { + "column": 6, + "line": 1, + "offset": 5, + }, + }, + "modifiers": [], + "name": "bind", + "rawName": ":class", + "type": 7, + }, + ], + "tag": "div", + "tagType": 0, + "type": 1, + }, + ], + "codegenNode": undefined, + "components": [], + "directives": [], + "helpers": Set {}, + "hoists": [], + "imports": [], + "loc": { + "end": { + "column": 7, + "line": 4, + "offset": 123, + }, - "source": "
-

++ "source": "

++

+ +

", + "start": { + "column": 1, + "line": 1, + "offset": 0, + }, + }, - "source": "
-

++ "source": "

++

+ +

", + "temps": 0, + "type": 0, +} +`; + +exports[`compiler: parse > Errors > CDATA_IN_HTML_CONTENT > 1`] = ` +{ + "cached": 0, + "children": [ + { + "children": [], + "codegenNode": undefined, "loc": { "end": { "column": 39, @@@ -805,7 -514,6 +805,7 @@@ exports[`compiler: parse > Errors > DUP "offset": 0, }, }, - "source": "", ++ "source": "", "temps": 0, "type": 0, } @@@ -1558,15 -1528,40 +1558,15 @@@ exports[`compiler: parse > Errors > EOF "cached": 0, "children": [ { - "children": [ - { - "children": [], - "codegenNode": undefined, - "isSelfClosing": false, - "loc": { - "end": { - "column": 16, - "line": 1, - "offset": 15, - }, - "source": "
Errors > EOF "cached": 0, "children": [ { - "children": [ - { - "children": [], - "codegenNode": undefined, - "isSelfClosing": false, - "loc": { - "end": { - "column": 15, - "line": 1, - "offset": 14, - }, - "source": "
Errors > EOF }, ], "codegenNode": undefined, - "isSelfClosing": false, "loc": { "end": { - "column": 19, + "column": 26, "line": 1, - "offset": 18, + "offset": 25, }, - "source": "