diff --git a/CHANGELOG.md b/CHANGELOG.md index ec08f2169..c8598e846 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,123 @@ +# [3.4.0-alpha.4](https://github.com/vuejs/core/compare/v3.3.10...v3.4.0-alpha.4) (2023-12-04) + + +### Bug Fixes + +* **compiler-core:** fix referencing typo ([#9708](https://github.com/vuejs/core/issues/9708)) ([3071de4](https://github.com/vuejs/core/commit/3071de44bc4bf669ab6b48fd8db8d728c30fdb0c)) +* **parser:** fix interpolation parsing in v-pre ([53aaa1e](https://github.com/vuejs/core/commit/53aaa1eb2876baf9de16b2f2c77b2c5fd5173900)) +* **parser:** properly set initial inXML state based on root ns ([47ea285](https://github.com/vuejs/core/commit/47ea285be3dcb66a83a593346995b5900d6c5478)) +* **parser:** should reset inRCDATA state ([ef97e8b](https://github.com/vuejs/core/commit/ef97e8b07d8350106c940f23679444b698832067)) + + +### Features + +* **compiler-core:** support accessing Error as global in template expressions ([#7018](https://github.com/vuejs/core/issues/7018)) ([bcca475](https://github.com/vuejs/core/commit/bcca475dbc58d76434cd8120b94929758cee2825)) +* **compiler-sfc:** analyze import usage in template via AST ([#9729](https://github.com/vuejs/core/issues/9729)) ([e8bbc94](https://github.com/vuejs/core/commit/e8bbc946cba6bf74c9da56f938b67d2a04c340ba)), closes [#8897](https://github.com/vuejs/core/issues/8897) [nuxt/nuxt#22416](https://github.com/nuxt/nuxt/issues/22416) +* **compiler-sfc:** bump postcss-modules to v6 ([2a507e3](https://github.com/vuejs/core/commit/2a507e32f0e2ef73813705a568b8633f68bda7a9)) +* **compiler:** lift vnode hooks deprecation warning to error ([8abc754](https://github.com/vuejs/core/commit/8abc754d5d86d9dfd5a7927b846f1a743f352364)) +* use enum to replace const enum ([#9261](https://github.com/vuejs/core/issues/9261)) ([fff7b86](https://github.com/vuejs/core/commit/fff7b864f4292d0430ba2bda7098ad43876b0210)), closes [#1228](https://github.com/vuejs/core/issues/1228) + + + +# [3.4.0-alpha.3](https://github.com/vuejs/core/compare/v3.4.0-alpha.2...v3.4.0-alpha.3) (2023-11-28) + + +### Bug Fixes + +* **parser:** directive arg should be undefined on shorthands with no arg ([e49dffc](https://github.com/vuejs/core/commit/e49dffc9ece86bddf094b9ad4ad15eb4856d6277)) + + +### Features + +* **dx:** link errors to docs in prod build ([#9165](https://github.com/vuejs/core/issues/9165)) ([9f8ba98](https://github.com/vuejs/core/commit/9f8ba9821fe166f77e63fa940e9e7e13ec3344fa)) + + + +# [3.4.0-alpha.2](https://github.com/vuejs/core/compare/v3.3.9...v3.4.0-alpha.2) (2023-11-27) + + +### Bug Fixes + +* avoid confusing breakage in @vitejs/plugin-vue ([ceec69c](https://github.com/vuejs/core/commit/ceec69c8ccb96c433a4a506ad2e85e276998bade)) +* **compiler-core:** fix line/column tracking when fast forwarding ([2e65ea4](https://github.com/vuejs/core/commit/2e65ea481f74db8649df8110a031cbdc98f98c84)) +* **compiler-sfc:** fix ast reuse for ssr ([fb619cf](https://github.com/vuejs/core/commit/fb619cf9a440239f0ba88e327d10001a6a3c8171)) +* **compiler-sfc:** support `:is` and `:where` selector in scoped css rewrite ([#8929](https://github.com/vuejs/core/issues/8929)) ([c6083dc](https://github.com/vuejs/core/commit/c6083dcad31f3e9292c687fada9e32f287e2317f)) +* **compiler-sfc:** use correct compiler when re-parsing in ssr mode ([678378a](https://github.com/vuejs/core/commit/678378afd559481badb486b243722b6287862e09)) + + +* feat!: remove reactivity transform (#9321) ([79b8a09](https://github.com/vuejs/core/commit/79b8a0905bf363bf82edd2096fef10c3db6d9c3c)), closes [#9321](https://github.com/vuejs/core/issues/9321) + + +### Features + +* **compiler-core:** support specifying root namespace when parsing ([40f72d5](https://github.com/vuejs/core/commit/40f72d5e50b389cb11b7ca13461aa2a75ddacdb4)) +* **compiler-core:** support v-bind shorthand for key and value with the same name ([#9451](https://github.com/vuejs/core/issues/9451)) ([26399aa](https://github.com/vuejs/core/commit/26399aa6fac1596b294ffeba06bb498d86f5508c)) +* **compiler:** improve parsing tolerance for language-tools ([41ff68e](https://github.com/vuejs/core/commit/41ff68ea579d933333392146625560359acb728a)) +* **reactivity:** expose last result for computed getter ([#9497](https://github.com/vuejs/core/issues/9497)) ([48b47a1](https://github.com/vuejs/core/commit/48b47a1ab63577e2dbd91947eea544e3ef185b85)) + + +### Performance Improvements + +* avoid sfc source map unnecessary serialization and parsing ([f15d2f6](https://github.com/vuejs/core/commit/f15d2f6cf69c0c39f8dfb5c33122790c68bf92e2)) +* **codegen:** optimize line / column calculation during codegen ([3be53d9](https://github.com/vuejs/core/commit/3be53d9b974dae1a10eb795cade71ae765e17574)) +* **codegen:** optimize source map generation ([c11002f](https://github.com/vuejs/core/commit/c11002f16afd243a2b15b546816e73882eea9e4d)) +* **compiler-sfc:** remove magic-string trim on script ([e8e3ec6](https://github.com/vuejs/core/commit/e8e3ec6ca7392e43975c75b56eaaa711d5ea9410)) +* **compiler-sfc:** use faster source map addMapping ([50cde7c](https://github.com/vuejs/core/commit/50cde7cfbcc49022ba88f5f69fa9b930b483c282)) +* optimize away isBuiltInType ([66c0ed0](https://github.com/vuejs/core/commit/66c0ed0a3c1c6f37dafc6b1c52b75c6bf60e3136)) +* optimize makeMap ([ae6fba9](https://github.com/vuejs/core/commit/ae6fba94954bac6430902f77b0d1113a98a75b18)) +* optimize position cloning ([2073236](https://github.com/vuejs/core/commit/20732366b9b3530d33b842cf1fc985919afb9317)) + + +### BREAKING CHANGES + +* Reactivity Transform was marked deprecated in 3.3 and is now removed in 3.4. This change does not require a major due to the feature being experimental. Users who wish to continue using the feature can do so via the external plugin at https://vue-macros.dev/features/reactivity-transform.html + + + +# [3.4.0-alpha.1](https://github.com/vuejs/core/compare/v3.3.7...v3.4.0-alpha.1) (2023-10-28) + + +### Features + +* **compiler-core:** export error message ([#8729](https://github.com/vuejs/core/issues/8729)) ([f7e80ee](https://github.com/vuejs/core/commit/f7e80ee4a065a9eaba98720abf415d9e87756cbd)) +* **compiler-sfc:** expose resolve type-based props and emits ([#8874](https://github.com/vuejs/core/issues/8874)) ([9e77580](https://github.com/vuejs/core/commit/9e77580c0c2f0d977bd0031a1d43cc334769d433)) +* export runtime error strings ([#9301](https://github.com/vuejs/core/issues/9301)) ([feb2f2e](https://github.com/vuejs/core/commit/feb2f2edce2d91218a5e9a52c81e322e4033296b)) +* **reactivity:** more efficient reactivity system ([#5912](https://github.com/vuejs/core/issues/5912)) ([16e06ca](https://github.com/vuejs/core/commit/16e06ca08f5a1e2af3fc7fb35de153dbe0c3087d)), closes [#311](https://github.com/vuejs/core/issues/311) [#1811](https://github.com/vuejs/core/issues/1811) [#6018](https://github.com/vuejs/core/issues/6018) [#7160](https://github.com/vuejs/core/issues/7160) [#8714](https://github.com/vuejs/core/issues/8714) [#9149](https://github.com/vuejs/core/issues/9149) [#9419](https://github.com/vuejs/core/issues/9419) [#9464](https://github.com/vuejs/core/issues/9464) +* **runtime-core:** add `once` option to watch ([#9034](https://github.com/vuejs/core/issues/9034)) ([a645e7a](https://github.com/vuejs/core/commit/a645e7aa51006516ba668b3a4365d296eb92ee7d)) + + + +## [3.3.10](https://github.com/vuejs/core/compare/v3.3.9...v3.3.10) (2023-12-04) + + +### Bug Fixes + +* **app:** prevent template from being cached between apps with different options ([#9724](https://github.com/vuejs/core/issues/9724)) ([ec71585](https://github.com/vuejs/core/commit/ec715854ca12520b2afc9e9b3981cbae05ae5206)), closes [#9618](https://github.com/vuejs/core/issues/9618) +* **compiler-sfc:** avoid passing forEach index to genMap ([f12db7f](https://github.com/vuejs/core/commit/f12db7fb564a534cef2e5805cc9f54afe5d72fbf)) +* **compiler-sfc:** deindent pug/jade templates ([6345197](https://github.com/vuejs/core/commit/634519720a21fb5a6871454e1cadad7053a568b8)), closes [#3231](https://github.com/vuejs/core/issues/3231) [#3842](https://github.com/vuejs/core/issues/3842) [#7723](https://github.com/vuejs/core/issues/7723) +* **compiler-sfc:** fix :where and :is selector in scoped mode with multiple selectors ([#9735](https://github.com/vuejs/core/issues/9735)) ([c3e2c55](https://github.com/vuejs/core/commit/c3e2c556b532656b50b8ab5cd2d9eabc26622d63)), closes [#9707](https://github.com/vuejs/core/issues/9707) +* **compiler-sfc:** generate more treeshaking friendly code ([#9507](https://github.com/vuejs/core/issues/9507)) ([8d74ca0](https://github.com/vuejs/core/commit/8d74ca0e6fa2738ca6854b7e879ff59419f948c7)), closes [#9500](https://github.com/vuejs/core/issues/9500) +* **compiler-sfc:** support inferring generic types ([#8511](https://github.com/vuejs/core/issues/8511)) ([eb5e307](https://github.com/vuejs/core/commit/eb5e307c0be62002e62c4c800d0dfacb39b0d4ca)), closes [#8482](https://github.com/vuejs/core/issues/8482) +* **compiler-sfc:** support resolving components from props ([#8785](https://github.com/vuejs/core/issues/8785)) ([7cbcee3](https://github.com/vuejs/core/commit/7cbcee3d831241a8bd3588ae92d3f27e3641e25f)) +* **compiler-sfc:** throw error when failing to load TS during type resolution ([#8883](https://github.com/vuejs/core/issues/8883)) ([4936d2e](https://github.com/vuejs/core/commit/4936d2e11a8d0ca3704bfe408548cb26bb3fd5e9)) +* **cssVars:** cssVar names should be double-escaped when generating code for ssr ([#8824](https://github.com/vuejs/core/issues/8824)) ([5199a12](https://github.com/vuejs/core/commit/5199a12f8855cd06f24bf355708b5a2134f63176)), closes [#7823](https://github.com/vuejs/core/issues/7823) +* **deps:** update compiler to ^7.23.4 ([#9681](https://github.com/vuejs/core/issues/9681)) ([31f6ebc](https://github.com/vuejs/core/commit/31f6ebc4df84490ed29fb75e7bf4259200eb51f0)) +* **runtime-core:** Suspense get anchor properly in Transition ([#9309](https://github.com/vuejs/core/issues/9309)) ([65f3fe2](https://github.com/vuejs/core/commit/65f3fe273127a8b68e1222fbb306d28d85f01757)), closes [#8105](https://github.com/vuejs/core/issues/8105) +* **runtime-dom:** set width/height with units as attribute ([#8781](https://github.com/vuejs/core/issues/8781)) ([bfc1838](https://github.com/vuejs/core/commit/bfc1838f31199de3f189198a3c234fa7bae91386)) +* **ssr:** avoid computed being accidentally cached before server render ([#9688](https://github.com/vuejs/core/issues/9688)) ([30d5d93](https://github.com/vuejs/core/commit/30d5d93a92b2154406ec04f8aca6b217fa01177c)), closes [#5300](https://github.com/vuejs/core/issues/5300) +* **types:** expose emits as props in functional components ([#9234](https://github.com/vuejs/core/issues/9234)) ([887e54c](https://github.com/vuejs/core/commit/887e54c347ea9eac4c721b5e2288f054873d1d30)) +* **types:** fix reactive collection types ([#8960](https://github.com/vuejs/core/issues/8960)) ([ad27473](https://github.com/vuejs/core/commit/ad274737015c36906d76f3189203093fa3a2e4e7)), closes [#8904](https://github.com/vuejs/core/issues/8904) +* **types:** improve return type withKeys and withModifiers ([#9734](https://github.com/vuejs/core/issues/9734)) ([43c3cfd](https://github.com/vuejs/core/commit/43c3cfdec5ae5d70fa2a21e857abc2d73f1a0d07)) + + +### Performance Improvements + +* optimize on* prop check ([38aaa8c](https://github.com/vuejs/core/commit/38aaa8c88648c54fe2616ad9c0961288092fcb44)) +* **runtime-dom:** cache modifier wrapper functions ([da4a4fb](https://github.com/vuejs/core/commit/da4a4fb5e8eee3c6d31f24ebd79a9d0feca56cb2)), closes [#8882](https://github.com/vuejs/core/issues/8882) +* **v-on:** constant handlers with modifiers should not be treated as dynamic ([4d94ebf](https://github.com/vuejs/core/commit/4d94ebfe75174b340d2b794e699cad1add3600a9)) + + + # [3.4.0-alpha.3](https://github.com/vuejs/core/compare/v3.4.0-alpha.2...v3.4.0-alpha.3) (2023-11-28) @@ -97,7 +217,7 @@ * **compiler-sfc:** fix dynamic directive arguments usage check for slots ([#9495](https://github.com/vuejs/core/issues/9495)) ([b39fa1f](https://github.com/vuejs/core/commit/b39fa1f8157647859331ce439c42ae016a49b415)), closes [#9493](https://github.com/vuejs/core/issues/9493) * **deps:** update dependency @vue/repl to ^2.6.2 ([#9536](https://github.com/vuejs/core/issues/9536)) ([5cef325](https://github.com/vuejs/core/commit/5cef325f41e3b38657c72fa1a38dedeee1c7a60a)) * **deps:** update dependency @vue/repl to ^2.6.3 ([#9540](https://github.com/vuejs/core/issues/9540)) ([176d590](https://github.com/vuejs/core/commit/176d59058c9aecffe9da4d4311e98496684f06d4)) -* **hydration:** fix tagName access eeror on comment/text node hydration mismatch ([dd8a0cf](https://github.com/vuejs/core/commit/dd8a0cf5dcde13d2cbd899262a0e07f16e14e489)), closes [#9531](https://github.com/vuejs/core/issues/9531) +* **hydration:** fix tagName access error on comment/text node hydration mismatch ([dd8a0cf](https://github.com/vuejs/core/commit/dd8a0cf5dcde13d2cbd899262a0e07f16e14e489)), closes [#9531](https://github.com/vuejs/core/issues/9531) * **types:** avoid exposing lru-cache types in generated dts ([462aeb3](https://github.com/vuejs/core/commit/462aeb3b600765e219ded2ee9a0ed1e74df61de0)), closes [#9521](https://github.com/vuejs/core/issues/9521) * **warn:** avoid warning on empty children with Suspense ([#3962](https://github.com/vuejs/core/issues/3962)) ([405f345](https://github.com/vuejs/core/commit/405f34587a63a5f1e3d147b9848219ea98acc22d)) diff --git a/package.json b/package.json index ae1d48562..03e063ae6 100644 --- a/package.json +++ b/package.json @@ -34,9 +34,10 @@ "dev-vapor-serve": "pnpm -C playground run dev", "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 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", @@ -58,8 +59,8 @@ "node": ">=18.12.0" }, "devDependencies": { - "@babel/parser": "^7.23.4", - "@babel/types": "^7.23.4", + "@babel/parser": "^7.23.5", + "@babel/types": "^7.23.5", "@rollup/plugin-alias": "^5.0.1", "@rollup/plugin-commonjs": "^25.0.7", "@rollup/plugin-json": "^6.0.1", @@ -68,7 +69,7 @@ "@rollup/plugin-terser": "^0.4.4", "@types/hash-sum": "^1.0.2", "@types/minimist": "^1.2.5", - "@types/node": "^20.10.0", + "@types/node": "^20.10.3", "@types/semver": "^7.5.5", "@typescript-eslint/parser": "^6.13.0", "@vitest/coverage-istanbul": "^0.34.6", @@ -94,7 +95,7 @@ "prettier": "^3.1.0", "pretty-bytes": "^6.1.1", "pug": "^3.0.2", - "puppeteer": "~21.5.1", + "puppeteer": "~21.5.2", "rimraf": "^5.0.5", "rollup": "^4.1.4", "rollup-plugin-dts": "^6.1.0", @@ -106,9 +107,9 @@ "terser": "^5.22.0", "todomvc-app-css": "^2.4.3", "tslib": "^2.6.2", - "tsx": "^4.5.0", + "tsx": "^4.6.2", "typescript": "^5.2.2", "vite": "^5.0.0", - "vitest": "^0.34.6" + "vitest": "^1.0.0" } } diff --git a/packages/compiler-core/__tests__/__snapshots__/codegen.spec.ts.snap b/packages/compiler-core/__tests__/__snapshots__/codegen.spec.ts.snap index 032d17e26..2bdb4afa4 100644 --- a/packages/compiler-core/__tests__/__snapshots__/codegen.spec.ts.snap +++ b/packages/compiler-core/__tests__/__snapshots__/codegen.spec.ts.snap @@ -48,12 +48,12 @@ exports[`compiler: codegen > Element (callExpression + objectExpression + Templa " return function render(_ctx, _cache) { with (_ctx) { - return _createElementVNode(\\"div\\", { - id: \\"foo\\", + return _createElementVNode("div", { + id: "foo", [prop]: bar, [foo + bar]: bar }, [ - _createElementVNode(\\"p\\", { \\"some-key\\": \\"foo\\" }) + _createElementVNode("p", { "some-key": "foo" }) ], 16) } }" @@ -63,12 +63,12 @@ exports[`compiler: codegen > assets + temps 1`] = ` " return function render(_ctx, _cache) { with (_ctx) { - const _component_Foo = _resolveComponent(\\"Foo\\") - const _component_bar_baz = _resolveComponent(\\"bar-baz\\") - const _component_barbaz = _resolveComponent(\\"barbaz\\") - const _component_Qux = _resolveComponent(\\"Qux\\", true) - const _directive_my_dir_0 = _resolveDirective(\\"my_dir_0\\") - const _directive_my_dir_1 = _resolveDirective(\\"my_dir_1\\") + const _component_Foo = _resolveComponent("Foo") + const _component_bar_baz = _resolveComponent("bar-baz") + const _component_barbaz = _resolveComponent("barbaz") + const _component_Qux = _resolveComponent("Qux", true) + const _directive_my_dir_0 = _resolveDirective("my_dir_0") + const _directive_my_dir_1 = _resolveDirective("my_dir_1") let _temp0, _temp1, _temp2 return null @@ -80,7 +80,7 @@ exports[`compiler: codegen > comment 1`] = ` " return function render(_ctx, _cache) { with (_ctx) { - return _createCommentVNode(\\"foo\\") + return _createCommentVNode("foo") } }" `; @@ -135,7 +135,7 @@ return function render(_ctx, _cache) { exports[`compiler: codegen > hoists 1`] = ` " const _hoisted_1 = hello -const _hoisted_2 = { id: \\"foo\\" } +const _hoisted_2 = { id: "foo" } return function render(_ctx, _cache) { with (_ctx) { @@ -165,7 +165,7 @@ return function render(_ctx, _cache) { `; exports[`compiler: codegen > module mode preamble 1`] = ` -"import { createVNode as _createVNode, resolveDirective as _resolveDirective } from \\"vue\\" +"import { createVNode as _createVNode, resolveDirective as _resolveDirective } from "vue" export function render(_ctx, _cache) { return null @@ -173,7 +173,7 @@ export function render(_ctx, _cache) { `; exports[`compiler: codegen > module mode preamble w/ optimizeImports: true 1`] = ` -"import { createVNode, resolveDirective } from \\"vue\\" +"import { createVNode, resolveDirective } from "vue" // Binding optimization for webpack code-split const _createVNode = createVNode, _resolveDirective = resolveDirective @@ -187,7 +187,7 @@ exports[`compiler: codegen > static text 1`] = ` " return function render(_ctx, _cache) { with (_ctx) { - return \\"hello\\" + return "hello" } }" `; diff --git a/packages/compiler-core/__tests__/__snapshots__/compile.spec.ts.snap b/packages/compiler-core/__tests__/__snapshots__/compile.spec.ts.snap index e8b2efba7..625485719 100644 --- a/packages/compiler-core/__tests__/__snapshots__/compile.spec.ts.snap +++ b/packages/compiler-core/__tests__/__snapshots__/compile.spec.ts.snap @@ -7,19 +7,19 @@ return function render(_ctx, _cache) { with (_ctx) { const { toDisplayString: _toDisplayString, openBlock: _openBlock, createElementBlock: _createElementBlock, createCommentVNode: _createCommentVNode, createTextVNode: _createTextVNode, Fragment: _Fragment, renderList: _renderList, createElementVNode: _createElementVNode, normalizeClass: _normalizeClass } = _Vue - return (_openBlock(), _createElementBlock(\\"div\\", { - id: \\"foo\\", + return (_openBlock(), _createElementBlock("div", { + id: "foo", class: _normalizeClass(bar.baz) }, [ - _createTextVNode(_toDisplayString(world.burn()) + \\" \\", 1 /* TEXT */), + _createTextVNode(_toDisplayString(world.burn()) + " ", 1 /* TEXT */), ok - ? (_openBlock(), _createElementBlock(\\"div\\", { key: 0 }, \\"yes\\")) + ? (_openBlock(), _createElementBlock("div", { key: 0 }, "yes")) : (_openBlock(), _createElementBlock(_Fragment, { key: 1 }, [ - _createTextVNode(\\"no\\") + _createTextVNode("no") ], 64 /* STABLE_FRAGMENT */)), (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(list, (value, index) => { - return (_openBlock(), _createElementBlock(\\"div\\", null, [ - _createElementVNode(\\"span\\", null, _toDisplayString(value + index), 1 /* TEXT */) + return (_openBlock(), _createElementBlock("div", null, [ + _createElementVNode("span", null, _toDisplayString(value + index), 1 /* TEXT */) ])) }), 256 /* UNKEYED_FRAGMENT */)) ], 2 /* CLASS */)) @@ -31,19 +31,19 @@ exports[`compiler: integration tests > function mode w/ prefixIdentifiers: true "const { toDisplayString: _toDisplayString, openBlock: _openBlock, createElementBlock: _createElementBlock, createCommentVNode: _createCommentVNode, createTextVNode: _createTextVNode, Fragment: _Fragment, renderList: _renderList, createElementVNode: _createElementVNode, normalizeClass: _normalizeClass } = Vue return function render(_ctx, _cache) { - return (_openBlock(), _createElementBlock(\\"div\\", { - id: \\"foo\\", + return (_openBlock(), _createElementBlock("div", { + id: "foo", class: _normalizeClass(_ctx.bar.baz) }, [ - _createTextVNode(_toDisplayString(_ctx.world.burn()) + \\" \\", 1 /* TEXT */), + _createTextVNode(_toDisplayString(_ctx.world.burn()) + " ", 1 /* TEXT */), (_ctx.ok) - ? (_openBlock(), _createElementBlock(\\"div\\", { key: 0 }, \\"yes\\")) + ? (_openBlock(), _createElementBlock("div", { key: 0 }, "yes")) : (_openBlock(), _createElementBlock(_Fragment, { key: 1 }, [ - _createTextVNode(\\"no\\") + _createTextVNode("no") ], 64 /* STABLE_FRAGMENT */)), (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.list, (value, index) => { - return (_openBlock(), _createElementBlock(\\"div\\", null, [ - _createElementVNode(\\"span\\", null, _toDisplayString(value + index), 1 /* TEXT */) + return (_openBlock(), _createElementBlock("div", null, [ + _createElementVNode("span", null, _toDisplayString(value + index), 1 /* TEXT */) ])) }), 256 /* UNKEYED_FRAGMENT */)) ], 2 /* CLASS */)) @@ -51,22 +51,22 @@ return function render(_ctx, _cache) { `; exports[`compiler: integration tests > module mode 1`] = ` -"import { toDisplayString as _toDisplayString, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createTextVNode as _createTextVNode, Fragment as _Fragment, renderList as _renderList, createElementVNode as _createElementVNode, normalizeClass as _normalizeClass } from \\"vue\\" +"import { toDisplayString as _toDisplayString, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createTextVNode as _createTextVNode, Fragment as _Fragment, renderList as _renderList, createElementVNode as _createElementVNode, normalizeClass as _normalizeClass } from "vue" export function render(_ctx, _cache) { - return (_openBlock(), _createElementBlock(\\"div\\", { - id: \\"foo\\", + return (_openBlock(), _createElementBlock("div", { + id: "foo", class: _normalizeClass(_ctx.bar.baz) }, [ - _createTextVNode(_toDisplayString(_ctx.world.burn()) + \\" \\", 1 /* TEXT */), + _createTextVNode(_toDisplayString(_ctx.world.burn()) + " ", 1 /* TEXT */), (_ctx.ok) - ? (_openBlock(), _createElementBlock(\\"div\\", { key: 0 }, \\"yes\\")) + ? (_openBlock(), _createElementBlock("div", { key: 0 }, "yes")) : (_openBlock(), _createElementBlock(_Fragment, { key: 1 }, [ - _createTextVNode(\\"no\\") + _createTextVNode("no") ], 64 /* STABLE_FRAGMENT */)), (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.list, (value, index) => { - return (_openBlock(), _createElementBlock(\\"div\\", null, [ - _createElementVNode(\\"span\\", null, _toDisplayString(value + index), 1 /* TEXT */) + return (_openBlock(), _createElementBlock("div", null, [ + _createElementVNode("span", null, _toDisplayString(value + index), 1 /* TEXT */) ])) }), 256 /* UNKEYED_FRAGMENT */)) ], 2 /* CLASS */)) diff --git a/packages/compiler-core/__tests__/__snapshots__/parse.spec.ts.snap b/packages/compiler-core/__tests__/__snapshots__/parse.spec.ts.snap index 8886ce337..63dea7e19 100644 --- a/packages/compiler-core/__tests__/__snapshots__/parse.spec.ts.snap +++ b/packages/compiler-core/__tests__/__snapshots__/parse.spec.ts.snap @@ -98,7 +98,7 @@ exports[`compiler: parse > Edge Cases > self closing multiple tag 1`] = ` "line": 1, "offset": 36, }, - "source": "
", + "source": "
", "start": { "column": 1, "line": 1, @@ -152,7 +152,7 @@ exports[`compiler: parse > Edge Cases > self closing multiple tag 1`] = ` "line": 1, "offset": 33, }, - "source": ":class=\\"{ some: condition }\\"", + "source": ":class="{ some: condition }"", "start": { "column": 6, "line": 1, @@ -179,7 +179,7 @@ exports[`compiler: parse > Edge Cases > self closing multiple tag 1`] = ` "line": 2, "offset": 73, }, - "source": "

", + "source": "

", "start": { "column": 1, "line": 2, @@ -233,7 +233,7 @@ exports[`compiler: parse > Edge Cases > self closing multiple tag 1`] = ` "line": 2, "offset": 71, }, - "source": "v-bind:style=\\"{ color: 'red' }\\"", + "source": "v-bind:style="{ color: 'red' }"", "start": { "column": 4, "line": 2, @@ -263,16 +263,16 @@ exports[`compiler: parse > Edge Cases > self closing multiple tag 1`] = ` "line": 2, "offset": 73, }, - "source": "

-

", + "source": "

+

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

-

", + "source": "

+

", "temps": 0, "type": 0, } @@ -294,7 +294,7 @@ exports[`compiler: parse > Edge Cases > valid html 1`] = ` "line": 2, "offset": 73, }, - "source": "

", + "source": "

", "start": { "column": 3, "line": 2, @@ -348,7 +348,7 @@ exports[`compiler: parse > Edge Cases > valid html 1`] = ` "line": 2, "offset": 71, }, - "source": "v-bind:style=\\"{ color: 'red' }\\"", + "source": "v-bind:style="{ color: 'red' }"", "start": { "column": 6, "line": 2, @@ -390,8 +390,8 @@ exports[`compiler: parse > Edge Cases > valid html 1`] = ` "line": 4, "offset": 123, }, - "source": "

-

+ "source": "

+

", "start": { @@ -447,7 +447,7 @@ exports[`compiler: parse > Edge Cases > valid html 1`] = ` "line": 1, "offset": 33, }, - "source": ":class=\\"{ some: condition }\\"", + "source": ":class="{ some: condition }"", "start": { "column": 6, "line": 1, @@ -477,8 +477,8 @@ exports[`compiler: parse > Edge Cases > valid html 1`] = ` "line": 4, "offset": 123, }, - "source": "
-

+ "source": "

+

", "start": { @@ -487,8 +487,8 @@ exports[`compiler: parse > Edge Cases > valid html 1`] = ` "offset": 0, }, }, - "source": "
-

+ "source": "

+

", "temps": 0, @@ -656,7 +656,7 @@ exports[`compiler: parse > Errors > DUPLICATE_ATTRIBUTE >