diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b84bd85cb7..5d9a2f75038 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +## [3.5.16](https://github.com/vuejs/core/compare/v3.5.15...v3.5.16) (2025-05-29) + + +### Reverts + +* Revert "fix(compiler-sfc): add scoping tag to trailing universal selector (#1…" (#13406) ([19f23b1](https://github.com/vuejs/core/commit/19f23b180bb679e38db95d6a10a420abeedc8e1c)), closes [#1](https://github.com/vuejs/core/issues/1) [#13406](https://github.com/vuejs/core/issues/13406) +* Revert "fix(compiler-sfc): add error handling for defineModel() without varia…" (#13390) ([42f879f](https://github.com/vuejs/core/commit/42f879fcab48e0e1011967a771b4ad9e8838d760)), closes [#13390](https://github.com/vuejs/core/issues/13390) + + + ## [3.5.15](https://github.com/vuejs/core/compare/v3.5.14...v3.5.15) (2025-05-26) diff --git a/changelogs/CHANGELOG-3.0.md b/changelogs/CHANGELOG-3.0.md index 16483767fe4..c19ef26890b 100644 --- a/changelogs/CHANGELOG-3.0.md +++ b/changelogs/CHANGELOG-3.0.md @@ -56,13 +56,13 @@ - **hydration:** handle camel-case tag name when performing match assertion ([#3247](https://github.com/vuejs/core/issues/3247)) ([9036f88](https://github.com/vuejs/core/commit/9036f88d8304a3455265f1ecd86ec8f4a5ea4715)), closes [#3243](https://github.com/vuejs/core/issues/3243) - **KeepAlive:** adapt keepalive for ssr ([#3259](https://github.com/vuejs/core/issues/3259)) ([e8e9b00](https://github.com/vuejs/core/commit/e8e9b00f81ed42434afd92f84101e7a14d70a23c)), closes [#3255](https://github.com/vuejs/core/issues/3255) - **reactivity:** ensure computed can be wrapped by readonly ([41e02f0](https://github.com/vuejs/core/commit/41e02f0fac069c93c94438741517e713f3c94215)), closes [#3376](https://github.com/vuejs/core/issues/3376) -- **reactivity:** ensure that shallow and normal proxies are tracked seperately (close [#2843](https://github.com/vuejs/core/issues/2843)) ([#2851](https://github.com/vuejs/core/issues/2851)) ([22cc4a7](https://github.com/vuejs/core/commit/22cc4a76592cfe336e75e2fa0c05232ae1f0f149)) +- **reactivity:** ensure that shallow and normal proxies are tracked separately (close [#2843](https://github.com/vuejs/core/issues/2843)) ([#2851](https://github.com/vuejs/core/issues/2851)) ([22cc4a7](https://github.com/vuejs/core/commit/22cc4a76592cfe336e75e2fa0c05232ae1f0f149)) - **reactivity:** fix shallow readonly behavior for collections ([#3003](https://github.com/vuejs/core/issues/3003)) ([68de9f4](https://github.com/vuejs/core/commit/68de9f408a2e61a5726a4a0d03b026cba451c5bd)), closes [#3007](https://github.com/vuejs/core/issues/3007) - **rumtime-core:** custom dom props should be cloned when cloning a hoisted DOM ([#3080](https://github.com/vuejs/core/issues/3080)) ([5dbe834](https://github.com/vuejs/core/commit/5dbe8348581dacd7a3594a9b0055ce350ce8e5bf)), closes [#3072](https://github.com/vuejs/core/issues/3072) - **runtime-core:** cache props default values to avoid unnecessary watcher trigger ([#3474](https://github.com/vuejs/core/issues/3474)) ([44166b4](https://github.com/vuejs/core/commit/44166b43d9be1062f79612880f71284049bcab0b)), closes [#3471](https://github.com/vuejs/core/issues/3471) - **runtime-core:** ensure only skip unflushed job ([#3406](https://github.com/vuejs/core/issues/3406)) ([bf34e33](https://github.com/vuejs/core/commit/bf34e33c909da89681b9c5004cdf04ab198ec5a7)) - **runtime-core:** fix async component ref handling ([#3191](https://github.com/vuejs/core/issues/3191)) ([7562e72](https://github.com/vuejs/core/commit/7562e72c2b58a5646bd4fbd9adea11eb884fe140)), closes [#3188](https://github.com/vuejs/core/issues/3188) -- **runtime-core:** fix erraneous emits warnings w/ mixins ([60d777d](https://github.com/vuejs/core/commit/60d777d228414515cc32526ad72a53ef070501be)), closes [#2651](https://github.com/vuejs/core/issues/2651) +- **runtime-core:** fix erroneous emits warnings w/ mixins ([60d777d](https://github.com/vuejs/core/commit/60d777d228414515cc32526ad72a53ef070501be)), closes [#2651](https://github.com/vuejs/core/issues/2651) - **runtime-core:** fix warning for absent props ([#3363](https://github.com/vuejs/core/issues/3363)) ([86ceef4](https://github.com/vuejs/core/commit/86ceef43523bfbbb0a24731d3802ca6849cbefd6)), closes [#3362](https://github.com/vuejs/core/issues/3362) - **runtime-core:** handle error in async setup ([#2881](https://github.com/vuejs/core/issues/2881)) ([d668d48](https://github.com/vuejs/core/commit/d668d48e9e5211a49ee53361ea5b4d67ba16e0a3)) - **runtime-core:** handle error in async watchEffect ([#3129](https://github.com/vuejs/core/issues/3129)) ([eb1fae6](https://github.com/vuejs/core/commit/eb1fae63f926435fb0eef890663d24e09d4c79e1)) @@ -202,7 +202,7 @@ may cause build issues in projects still using TS 3.x. - **script-setup:** ensure useContext() return valid context ([73cdb9d](https://github.com/vuejs/core/commit/73cdb9d4208f887fe08349657122e39175d7166c)) - **slots:** dynamically named slots should be keyed by name ([2ab8c41](https://github.com/vuejs/core/commit/2ab8c41a1a43952fb229587a9da48d9a1214ab9e)), closes [#2535](https://github.com/vuejs/core/issues/2535) - **slots:** should render fallback content when slot content contains no valid nodes ([#2485](https://github.com/vuejs/core/issues/2485)) ([ce4915d](https://github.com/vuejs/core/commit/ce4915d8bed12f4cdb5fa8ca39bda98d0d3aabb7)), closes [#2347](https://github.com/vuejs/core/issues/2347) [#2461](https://github.com/vuejs/core/issues/2461) -- **suspense:** fix nested async child toggle inside already resovled suspense ([cf7f1db](https://github.com/vuejs/core/commit/cf7f1dbc9be8d50ad220e3630c38f5a9a217d693)), closes [#2215](https://github.com/vuejs/core/issues/2215) +- **suspense:** fix nested async child toggle inside already resolved suspense ([cf7f1db](https://github.com/vuejs/core/commit/cf7f1dbc9be8d50ad220e3630c38f5a9a217d693)), closes [#2215](https://github.com/vuejs/core/issues/2215) - **teleport:** Teleport into SVG elements ([#2648](https://github.com/vuejs/core/issues/2648)) ([cd92836](https://github.com/vuejs/core/commit/cd928362232747a51d1fd4790bb20adcdd59d187)), closes [#2652](https://github.com/vuejs/core/issues/2652) - **transition:** avoid invoking stale transition end callbacks ([eaf8a67](https://github.com/vuejs/core/commit/eaf8a67c7219e1b79d6abca44a1d7f1b341b58b0)), closes [#2482](https://github.com/vuejs/core/issues/2482) - **transition:** respect rules in \*-leave-from transition class ([#2597](https://github.com/vuejs/core/issues/2597)) ([e2618a6](https://github.com/vuejs/core/commit/e2618a632d4add2819ffb8b575af0da189dc3204)), closes [#2593](https://github.com/vuejs/core/issues/2593) @@ -236,7 +236,7 @@ may cause build issues in projects still using TS 3.x. - **compiler-sfc:** compileScript inline render function mode ([886ed76](https://github.com/vuejs/core/commit/886ed7681dd203c07ff3b504538328f43e14d9b0)) - **compiler-sfc:** new script setup implementation ([556560f](https://github.com/vuejs/core/commit/556560fae31d9e406cfae656089657b6332686c1)) -- **compiler-sfc:** new SFC css varaible injection implementation ([41bb7fa](https://github.com/vuejs/core/commit/41bb7fa330e78c4a354a2e67742bd13bee2f4293)) +- **compiler-sfc:** new SFC css variable injection implementation ([41bb7fa](https://github.com/vuejs/core/commit/41bb7fa330e78c4a354a2e67742bd13bee2f4293)) - **compiler-sfc:** support kebab-case components in ``), @@ -1017,7 +1017,7 @@ describe('SFC compile `), @@ -1027,7 +1027,7 @@ describe('SFC compile - `), - ).toThrow( - 'defineModel() must be assigned to a variable. For example: const model = defineModel()', - ) - }) }) diff --git a/packages/compiler-sfc/__tests__/compileStyle.spec.ts b/packages/compiler-sfc/__tests__/compileStyle.spec.ts index 70c6af557ab..78fd52425e8 100644 --- a/packages/compiler-sfc/__tests__/compileStyle.spec.ts +++ b/packages/compiler-sfc/__tests__/compileStyle.spec.ts @@ -493,31 +493,7 @@ describe('SFC style preprocessors', () => { }" `) expect(compileScoped(`.foo * { color: red; }`)).toMatchInlineSnapshot(` - ".foo[data-v-test] [data-v-test] { color: red; - }" - `) - expect(compileScoped(`.foo :active { color: red; }`)) - .toMatchInlineSnapshot(` - ".foo[data-v-test] :active { color: red; - }" - `) - expect(compileScoped(`.foo *:active { color: red; }`)) - .toMatchInlineSnapshot(` - ".foo[data-v-test] [data-v-test]:active { color: red; - }" - `) - expect(compileScoped(`.foo * .bar { color: red; }`)).toMatchInlineSnapshot(` - ".foo * .bar[data-v-test] { color: red; - }" - `) - expect(compileScoped(`:last-child * { color: red; }`)) - .toMatchInlineSnapshot(` - "[data-v-test]:last-child [data-v-test] { color: red; - }" - `) - expect(compileScoped(`:last-child *:active { color: red; }`)) - .toMatchInlineSnapshot(` - "[data-v-test]:last-child [data-v-test]:active { color: red; + ".foo[data-v-test] * { color: red; }" `) }) diff --git a/packages/compiler-sfc/package.json b/packages/compiler-sfc/package.json index 3797cc88f0e..e0af375214e 100644 --- a/packages/compiler-sfc/package.json +++ b/packages/compiler-sfc/package.json @@ -1,6 +1,6 @@ { "name": "@vue/compiler-sfc", - "version": "3.5.15", + "version": "3.5.16", "description": "@vue/compiler-sfc", "main": "dist/compiler-sfc.cjs.js", "module": "dist/compiler-sfc.esm-browser.js", diff --git a/packages/compiler-sfc/src/script/defineModel.ts b/packages/compiler-sfc/src/script/defineModel.ts index 746bbabe552..05082800284 100644 --- a/packages/compiler-sfc/src/script/defineModel.ts +++ b/packages/compiler-sfc/src/script/defineModel.ts @@ -22,13 +22,6 @@ export function processDefineModel( return false } - if (!declId) { - ctx.error( - 'defineModel() must be assigned to a variable. For example: const model = defineModel()', - node, - ) - } - ctx.hasDefineModelCall = true const type = diff --git a/packages/compiler-sfc/src/style/pluginScoped.ts b/packages/compiler-sfc/src/style/pluginScoped.ts index 4845d8eee39..d0aaddd7676 100644 --- a/packages/compiler-sfc/src/style/pluginScoped.ts +++ b/packages/compiler-sfc/src/style/pluginScoped.ts @@ -102,7 +102,6 @@ function rewriteSelector( slotted = false, ) { let node: selectorParser.Node | null = null - let starNode: selectorParser.Node | null = null let shouldInject = !deep // find the last child node to insert attribute selector selector.each(n => { @@ -217,21 +216,17 @@ function rewriteSelector( return false } } - // store the universal selector so it can be rewritten later - // .foo * -> .foo[xxxxxxx] [xxxxxxx] - starNode = n + // .foo * -> .foo[xxxxxxx] * + if (node) return } if ( - (n.type !== 'pseudo' && - n.type !== 'combinator' && - n.type !== 'universal') || + (n.type !== 'pseudo' && n.type !== 'combinator') || (n.type === 'pseudo' && (n.value === ':is' || n.value === ':where') && !node) ) { node = n - starNode = null } }) @@ -279,20 +274,6 @@ function rewriteSelector( quoteMark: `"`, }), ) - // Used for trailing universal selectors (#12906) - // `.foo * {}` -> `.foo[xxxxxxx] [xxxxxxx] {}` - if (starNode) { - selector.insertBefore( - starNode, - selectorParser.attribute({ - attribute: idToAdd, - value: idToAdd, - raws: {}, - quoteMark: `"`, - }), - ) - selector.removeChild(starNode) - } } } diff --git a/packages/compiler-ssr/package.json b/packages/compiler-ssr/package.json index 0e49a83c2c4..60b3dd09a8e 100644 --- a/packages/compiler-ssr/package.json +++ b/packages/compiler-ssr/package.json @@ -1,6 +1,6 @@ { "name": "@vue/compiler-ssr", - "version": "3.5.15", + "version": "3.5.16", "description": "@vue/compiler-ssr", "main": "dist/compiler-ssr.cjs.js", "types": "dist/compiler-ssr.d.ts", diff --git a/packages/reactivity/__tests__/reactive.spec.ts b/packages/reactivity/__tests__/reactive.spec.ts index a3ba6a39c1d..9b17f960b1a 100644 --- a/packages/reactivity/__tests__/reactive.spec.ts +++ b/packages/reactivity/__tests__/reactive.spec.ts @@ -195,8 +195,8 @@ describe('reactivity/reactive', () => { test('toRaw on object using reactive as prototype', () => { const original = { foo: 1 } const observed = reactive(original) - const inherted = Object.create(observed) - expect(toRaw(inherted)).toBe(inherted) + const inherited = Object.create(observed) + expect(toRaw(inherited)).toBe(inherited) }) test('toRaw on user Proxy wrapping reactive', () => { diff --git a/packages/reactivity/package.json b/packages/reactivity/package.json index 8886fe928d1..9009d49040a 100644 --- a/packages/reactivity/package.json +++ b/packages/reactivity/package.json @@ -1,6 +1,6 @@ { "name": "@vue/reactivity", - "version": "3.5.15", + "version": "3.5.16", "description": "@vue/reactivity", "main": "index.js", "module": "dist/reactivity.esm-bundler.js", diff --git a/packages/runtime-core/__tests__/apiWatch.spec.ts b/packages/runtime-core/__tests__/apiWatch.spec.ts index 39032a63699..ff06fbea774 100644 --- a/packages/runtime-core/__tests__/apiWatch.spec.ts +++ b/packages/runtime-core/__tests__/apiWatch.spec.ts @@ -1595,7 +1595,7 @@ describe('api: watch', () => { num.value++ await nextTick() - // would not be calld when value>1 + // would not be called when value>1 expect(spy1).toHaveBeenCalledTimes(1) expect(spy2).toHaveBeenCalledTimes(1) }) @@ -1874,7 +1874,7 @@ describe('api: watch', () => { expect(foo.value.a).toBe(2) }) - test('watch immediate error in effect scope should be catched by onErrorCaptured', async () => { + test('watch immediate error in effect scope should be caught by onErrorCaptured', async () => { const warn = vi.spyOn(console, 'warn') warn.mockImplementation(() => {}) const ERROR_IN_SCOPE = 'ERROR_IN_SCOPE' diff --git a/packages/runtime-core/package.json b/packages/runtime-core/package.json index 94350274334..5b973b1c4b9 100644 --- a/packages/runtime-core/package.json +++ b/packages/runtime-core/package.json @@ -1,6 +1,6 @@ { "name": "@vue/runtime-core", - "version": "3.5.15", + "version": "3.5.16", "description": "@vue/runtime-core", "main": "index.js", "module": "dist/runtime-core.esm-bundler.js", diff --git a/packages/runtime-dom/package.json b/packages/runtime-dom/package.json index 5764f176320..394c3565ab0 100644 --- a/packages/runtime-dom/package.json +++ b/packages/runtime-dom/package.json @@ -1,6 +1,6 @@ { "name": "@vue/runtime-dom", - "version": "3.5.15", + "version": "3.5.16", "description": "@vue/runtime-dom", "main": "index.js", "module": "dist/runtime-dom.esm-bundler.js", diff --git a/packages/server-renderer/package.json b/packages/server-renderer/package.json index d798e4335c5..a8b126162ec 100644 --- a/packages/server-renderer/package.json +++ b/packages/server-renderer/package.json @@ -1,6 +1,6 @@ { "name": "@vue/server-renderer", - "version": "3.5.15", + "version": "3.5.16", "description": "@vue/server-renderer", "main": "index.js", "module": "dist/server-renderer.esm-bundler.js", diff --git a/packages/shared/package.json b/packages/shared/package.json index c5ffec0d314..4539e89a9c2 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@vue/shared", - "version": "3.5.15", + "version": "3.5.16", "description": "internal utils shared across @vue packages", "main": "index.js", "module": "dist/shared.esm-bundler.js", diff --git a/packages/vue-compat/package.json b/packages/vue-compat/package.json index 41bb288f866..023907ee7e9 100644 --- a/packages/vue-compat/package.json +++ b/packages/vue-compat/package.json @@ -1,6 +1,6 @@ { "name": "@vue/compat", - "version": "3.5.15", + "version": "3.5.16", "description": "Vue 3 compatibility build for Vue 2", "main": "index.js", "module": "dist/vue.runtime.esm-bundler.js", diff --git a/packages/vue/__tests__/e2e/Transition.spec.ts b/packages/vue/__tests__/e2e/Transition.spec.ts index 14441bd823b..45597521791 100644 --- a/packages/vue/__tests__/e2e/Transition.spec.ts +++ b/packages/vue/__tests__/e2e/Transition.spec.ts @@ -3254,7 +3254,7 @@ describe('e2e: Transition', () => { setup: () => { // Big arrays kick GC earlier const test = ref([...Array(30_000_000)].map((_, i) => ({ i }))) - // TODO: Use a diferent TypeScript env for testing + // TODO: Use a different TypeScript env for testing // @ts-expect-error - Custom property and same lib as runtime is used window.__REF__ = new WeakRef(test) @@ -3309,7 +3309,7 @@ describe('e2e: Transition', () => { setup: () => { // Big arrays kick GC earlier const test = ref([...Array(30_000_000)].map((_, i) => ({ i }))) - // TODO: Use a diferent TypeScript env for testing + // TODO: Use a different TypeScript env for testing // @ts-expect-error - Custom property and same lib as runtime is used window.__REF__ = new WeakRef(test) diff --git a/packages/vue/package.json b/packages/vue/package.json index f1ad15f31bb..0bad2628516 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -1,6 +1,6 @@ { "name": "vue", - "version": "3.5.15", + "version": "3.5.16", "description": "The progressive JavaScript framework for building modern web UI.", "main": "index.js", "module": "dist/vue.runtime.esm-bundler.js",