Skip to content

Commit 897116d

Browse files
authored
Merge branch 'vuejs:main' into hidden-ssr
2 parents 77903a0 + 5f8314c commit 897116d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1099
-793
lines changed

.github/workflows/autofix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ jobs:
3131
- name: Run prettier
3232
run: pnpm run format
3333

34-
- uses: autofix-ci/action@551dded8c6cc8a1054039c8bc0b8b48c51dfc6ef
34+
- uses: autofix-ci/action@635ffb0c9798bd160680f18fd73371e355b85f27

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
## [3.5.17](https://github.com/vuejs/core/compare/v3.5.16...v3.5.17) (2025-06-18)
2+
3+
4+
### Bug Fixes
5+
6+
* **compat:** allow v-model built in modifiers on component ([#12654](https://github.com/vuejs/core/issues/12654)) ([cb14b86](https://github.com/vuejs/core/commit/cb14b860f150c4a83bcd52cd26096b7a5aa3a2bf)), closes [#12652](https://github.com/vuejs/core/issues/12652)
7+
* **compile-sfc:** handle mapped types work with omit and pick ([#12648](https://github.com/vuejs/core/issues/12648)) ([4eb46e4](https://github.com/vuejs/core/commit/4eb46e443f1878199755cb73d481d318a9714392)), closes [#12647](https://github.com/vuejs/core/issues/12647)
8+
* **compiler-core:** do not increase newlines in `InEntity` state ([#13362](https://github.com/vuejs/core/issues/13362)) ([f05a8d6](https://github.com/vuejs/core/commit/f05a8d613bd873b811cfdb9979ccac8382dba322))
9+
* **compiler-core:** ignore whitespace when matching adjacent v-if ([#12321](https://github.com/vuejs/core/issues/12321)) ([10ebcef](https://github.com/vuejs/core/commit/10ebcef8c870dbc042b0ea49b1424b2e8f692145)), closes [#9173](https://github.com/vuejs/core/issues/9173)
10+
* **compiler-core:** prevent comments from blocking static node hoisting ([#13345](https://github.com/vuejs/core/issues/13345)) ([55dad62](https://github.com/vuejs/core/commit/55dad625acd9e9ddd5a933d5e323ecfdec1a612f)), closes [#13344](https://github.com/vuejs/core/issues/13344)
11+
* **compiler-sfc:** improved type resolution for function type aliases ([#13452](https://github.com/vuejs/core/issues/13452)) ([f3479aa](https://github.com/vuejs/core/commit/f3479aac9625f4459e650d1c0a70e73863147903)), closes [#13444](https://github.com/vuejs/core/issues/13444)
12+
* **custom-element:** ensure configureApp is applied to async component ([#12607](https://github.com/vuejs/core/issues/12607)) ([5ba1afb](https://github.com/vuejs/core/commit/5ba1afba09c3ea56c1c17484f5d8aeae210ce52a)), closes [#12448](https://github.com/vuejs/core/issues/12448)
13+
* **custom-element:** prevent injecting child styles if shadowRoot is false ([#12769](https://github.com/vuejs/core/issues/12769)) ([73055d8](https://github.com/vuejs/core/commit/73055d8d9578d485e3fe846726b50666e1aa56f5)), closes [#12630](https://github.com/vuejs/core/issues/12630)
14+
* **reactivity:** add `__v_skip` flag to `Dep` to prevent reactive conversion ([#12804](https://github.com/vuejs/core/issues/12804)) ([e8d8f5f](https://github.com/vuejs/core/commit/e8d8f5f604e821acc46b4200d5b06979c05af1c2)), closes [#12803](https://github.com/vuejs/core/issues/12803)
15+
* **runtime-core:** unset old ref during patching when new ref is absent ([#12900](https://github.com/vuejs/core/issues/12900)) ([47ddf98](https://github.com/vuejs/core/commit/47ddf986021dff8de68b0da72787e53a6c19de4c)), closes [#12898](https://github.com/vuejs/core/issues/12898)
16+
* **slots:** make cache indexes marker non-enumerable ([#13469](https://github.com/vuejs/core/issues/13469)) ([919c447](https://github.com/vuejs/core/commit/919c44744bba1f0c661c87d2059c3b429611aa7e)), closes [#13468](https://github.com/vuejs/core/issues/13468)
17+
* **ssr:** handle initial selected state for select with v-model + v-for/v-if option ([#13487](https://github.com/vuejs/core/issues/13487)) ([1552095](https://github.com/vuejs/core/commit/15520954f9f1c7f834175938a50dba5d4be0e6c4)), closes [#13486](https://github.com/vuejs/core/issues/13486)
18+
* **types:** typo of `vOnce` and `vSlot` ([#13343](https://github.com/vuejs/core/issues/13343)) ([762fae4](https://github.com/vuejs/core/commit/762fae4b57ad60602e5c84465a3bff562785b314))
19+
20+
21+
122
## [3.5.16](https://github.com/vuejs/core/compare/v3.5.15...v3.5.16) (2025-05-29)
223

324

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
3-
"version": "3.5.16",
4-
"packageManager": "pnpm@10.11.0",
3+
"version": "3.5.17",
4+
"packageManager": "pnpm@10.12.1",
55
"type": "module",
66
"scripts": {
77
"dev": "node scripts/dev.js",
@@ -65,21 +65,21 @@
6565
"@babel/parser": "catalog:",
6666
"@babel/types": "catalog:",
6767
"@rollup/plugin-alias": "^5.1.1",
68-
"@rollup/plugin-commonjs": "^28.0.3",
68+
"@rollup/plugin-commonjs": "^28.0.6",
6969
"@rollup/plugin-json": "^6.1.0",
7070
"@rollup/plugin-node-resolve": "^16.0.1",
7171
"@rollup/plugin-replace": "5.0.4",
72-
"@swc/core": "^1.11.29",
72+
"@swc/core": "^1.12.1",
7373
"@types/hash-sum": "^1.0.2",
74-
"@types/node": "^22.15.21",
74+
"@types/node": "^22.15.31",
7575
"@types/semver": "^7.7.0",
7676
"@types/serve-handler": "^6.1.4",
7777
"@vitest/coverage-v8": "^3.1.4",
7878
"@vitest/eslint-plugin": "^1.2.1",
7979
"@vue/consolidate": "1.0.0",
8080
"conventional-changelog-cli": "^5.0.0",
8181
"enquirer": "^2.4.1",
82-
"esbuild": "^0.25.4",
82+
"esbuild": "^0.25.5",
8383
"esbuild-plugin-polyfill-node": "^0.3.0",
8484
"eslint": "^9.27.0",
8585
"eslint-plugin-import-x": "^4.13.1",
@@ -97,7 +97,7 @@
9797
"pug": "^3.0.3",
9898
"puppeteer": "~24.9.0",
9999
"rimraf": "^6.0.1",
100-
"rollup": "^4.41.1",
100+
"rollup": "^4.43.0",
101101
"rollup-plugin-dts": "^6.2.1",
102102
"rollup-plugin-esbuild": "^6.2.1",
103103
"rollup-plugin-polyfill-node": "^0.13.0",

packages-private/sfc-playground/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"vite": "catalog:"
1414
},
1515
"dependencies": {
16-
"@vue/repl": "^4.5.1",
16+
"@vue/repl": "^4.6.1",
1717
"file-saver": "^2.0.5",
1818
"jszip": "^3.10.1",
1919
"vue": "workspace:*"

packages-private/sfc-playground/src/App.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ onMounted(() => {
141141
:editorOptions="{ autoSaveText: false }"
142142
:store="store"
143143
:showCompileOutput="true"
144+
:showSsrOutput="useSSRMode"
145+
:showOpenSourceMap="true"
144146
:autoResize="true"
145147
:clearConsole="false"
146148
:preview-options="{

packages/compiler-core/__tests__/parse.spec.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2271,6 +2271,11 @@ describe('compiler: parse', () => {
22712271
expect(span.loc.start.offset).toBe(0)
22722272
expect(span.loc.end.offset).toBe(27)
22732273
})
2274+
2275+
test('correct loc when a line in attribute value ends with &', () => {
2276+
const [span] = baseParse(`<span v-if="foo &&\nbar"></span>`).children
2277+
expect(span.loc.end.line).toBe(2)
2278+
})
22742279
})
22752280

22762281
describe('decodeEntities option', () => {

packages/compiler-core/__tests__/transforms/__snapshots__/cacheStatic.spec.ts.snap

Lines changed: 39 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ return function render(_ctx, _cache) {
88
const { createElementVNode: _createElementVNode, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
99
1010
return (_openBlock(), _createElementBlock("div", null, _cache[0] || (_cache[0] = [
11-
_createElementVNode("div", { key: "foo" }, null, -1 /* HOISTED */)
11+
_createElementVNode("div", { key: "foo" }, null, -1 /* CACHED */)
1212
])))
1313
}
1414
}"
@@ -25,11 +25,11 @@ return function render(_ctx, _cache) {
2525
_createElementVNode("p", null, [
2626
_createElementVNode("span"),
2727
_createElementVNode("span")
28-
], -1 /* HOISTED */),
28+
], -1 /* CACHED */),
2929
_createElementVNode("p", null, [
3030
_createElementVNode("span"),
3131
_createElementVNode("span")
32-
], -1 /* HOISTED */)
32+
], -1 /* CACHED */)
3333
])))
3434
}
3535
}"
@@ -45,7 +45,7 @@ return function render(_ctx, _cache) {
4545
return (_openBlock(), _createElementBlock("div", null, _cache[0] || (_cache[0] = [
4646
_createElementVNode("div", null, [
4747
_createCommentVNode("comment")
48-
], -1 /* HOISTED */)
48+
], -1 /* CACHED */)
4949
])))
5050
}
5151
}"
@@ -59,9 +59,9 @@ return function render(_ctx, _cache) {
5959
const { createElementVNode: _createElementVNode, createTextVNode: _createTextVNode, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
6060
6161
return (_openBlock(), _createElementBlock("div", null, _cache[0] || (_cache[0] = [
62-
_createElementVNode("span", null, null, -1 /* HOISTED */),
62+
_createElementVNode("span", null, null, -1 /* CACHED */),
6363
_createTextVNode("foo"),
64-
_createElementVNode("div", null, null, -1 /* HOISTED */)
64+
_createElementVNode("div", null, null, -1 /* CACHED */)
6565
])))
6666
}
6767
}"
@@ -75,7 +75,7 @@ return function render(_ctx, _cache) {
7575
const { createElementVNode: _createElementVNode, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
7676
7777
return (_openBlock(), _createElementBlock("div", null, _cache[0] || (_cache[0] = [
78-
_createElementVNode("span", { class: "inline" }, "hello", -1 /* HOISTED */)
78+
_createElementVNode("span", { class: "inline" }, "hello", -1 /* CACHED */)
7979
])))
8080
}
8181
}"
@@ -148,7 +148,7 @@ return function render(_ctx, _cache) {
148148
const { toDisplayString: _toDisplayString, createElementVNode: _createElementVNode, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
149149
150150
return (_openBlock(), _createElementBlock("div", null, _cache[0] || (_cache[0] = [
151-
_createElementVNode("span", null, "foo " + _toDisplayString(1) + " " + _toDisplayString(true), -1 /* HOISTED */)
151+
_createElementVNode("span", null, "foo " + _toDisplayString(1) + " " + _toDisplayString(true), -1 /* CACHED */)
152152
])))
153153
}
154154
}"
@@ -162,7 +162,7 @@ return function render(_ctx, _cache) {
162162
const { toDisplayString: _toDisplayString, createElementVNode: _createElementVNode, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
163163
164164
return (_openBlock(), _createElementBlock("div", null, _cache[0] || (_cache[0] = [
165-
_createElementVNode("span", { foo: 0 }, _toDisplayString(1), -1 /* HOISTED */)
165+
_createElementVNode("span", { foo: 0 }, _toDisplayString(1), -1 /* CACHED */)
166166
])))
167167
}
168168
}"
@@ -178,7 +178,7 @@ return function render(_ctx, _cache) {
178178
return (_openBlock(), _createElementBlock("div", null, [
179179
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(1, (i) => {
180180
return (_openBlock(), _createElementBlock("div", null, [...(_cache[0] || (_cache[0] = [
181-
_createElementVNode("span", { class: "hi" }, null, -1 /* HOISTED */)
181+
_createElementVNode("span", { class: "hi" }, null, -1 /* CACHED */)
182182
]))]))
183183
}), 256 /* UNKEYED_FRAGMENT */))
184184
]))
@@ -216,7 +216,7 @@ return function render(_ctx, _cache) {
216216
217217
return (_openBlock(), _createElementBlock("div", null, [
218218
_withDirectives((_openBlock(), _createElementBlock("svg", null, _cache[0] || (_cache[0] = [
219-
_createElementVNode("path", { d: "M2,3H5.5L12" }, null, -1 /* HOISTED */)
219+
_createElementVNode("path", { d: "M2,3H5.5L12" }, null, -1 /* CACHED */)
220220
]))), [
221221
[_directive_foo]
222222
])
@@ -402,14 +402,40 @@ return function render(_ctx, _cache) {
402402
return (_openBlock(), _createElementBlock("div", null, [
403403
ok
404404
? (_openBlock(), _createElementBlock("div", _hoisted_1, _cache[0] || (_cache[0] = [
405-
_createElementVNode("span", null, null, -1 /* HOISTED */)
405+
_createElementVNode("span", null, null, -1 /* CACHED */)
406406
])))
407407
: _createCommentVNode("v-if", true)
408408
]))
409409
}
410410
}"
411411
`;
412412

413+
exports[`compiler: cacheStatic transform > should hoist props for root with single element excluding comments 1`] = `
414+
"const _Vue = Vue
415+
const { createElementVNode: _createElementVNode, createCommentVNode: _createCommentVNode } = _Vue
416+
417+
const _hoisted_1 = { id: "a" }
418+
419+
return function render(_ctx, _cache) {
420+
with (_ctx) {
421+
const { createCommentVNode: _createCommentVNode, createElementVNode: _createElementVNode, Fragment: _Fragment, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
422+
423+
return (_openBlock(), _createElementBlock(_Fragment, null, [
424+
_createCommentVNode("comment"),
425+
_createElementVNode("div", _hoisted_1, _cache[0] || (_cache[0] = [
426+
_createElementVNode("div", { id: "b" }, [
427+
_createElementVNode("div", { id: "c" }, [
428+
_createElementVNode("div", { id: "d" }, [
429+
_createElementVNode("div", { id: "e" }, "hello")
430+
])
431+
])
432+
], -1 /* CACHED */)
433+
]))
434+
], 2112 /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */))
435+
}
436+
}"
437+
`;
438+
413439
exports[`compiler: cacheStatic transform > should hoist v-for children if static 1`] = `
414440
"const _Vue = Vue
415441
const { createElementVNode: _createElementVNode } = _Vue
@@ -423,7 +449,7 @@ return function render(_ctx, _cache) {
423449
return (_openBlock(), _createElementBlock("div", null, [
424450
(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(list, (i) => {
425451
return (_openBlock(), _createElementBlock("div", _hoisted_1, _cache[0] || (_cache[0] = [
426-
_createElementVNode("span", null, null, -1 /* HOISTED */)
452+
_createElementVNode("span", null, null, -1 /* CACHED */)
427453
])))
428454
}), 256 /* UNKEYED_FRAGMENT */))
429455
]))

packages/compiler-core/__tests__/transforms/__snapshots__/vSlot.spec.ts.snap

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,28 @@ return function render(_ctx, _cache) {
246246
}"
247247
`;
248248

249+
exports[`compiler: transform component slots > with whitespace: 'preserve' > named slot with v-if + v-else 1`] = `
250+
"const { resolveComponent: _resolveComponent, withCtx: _withCtx, createSlots: _createSlots, openBlock: _openBlock, createBlock: _createBlock } = Vue
251+
252+
return function render(_ctx, _cache) {
253+
const _component_Comp = _resolveComponent("Comp")
254+
255+
return (_openBlock(), _createBlock(_component_Comp, null, _createSlots({ _: 2 /* DYNAMIC */ }, [
256+
ok
257+
? {
258+
name: "one",
259+
fn: _withCtx(() => ["foo"]),
260+
key: "0"
261+
}
262+
: {
263+
name: "two",
264+
fn: _withCtx(() => ["baz"]),
265+
key: "1"
266+
}
267+
]), 1024 /* DYNAMIC_SLOTS */))
268+
}"
269+
`;
270+
249271
exports[`compiler: transform component slots > with whitespace: 'preserve' > should not generate whitespace only default slot 1`] = `
250272
"const { resolveComponent: _resolveComponent, withCtx: _withCtx, openBlock: _openBlock, createBlock: _createBlock } = Vue
251273

packages/compiler-core/__tests__/transforms/cacheStatic.spec.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,32 @@ describe('compiler: cacheStatic transform', () => {
543543
expect(generate(root).code).toMatchSnapshot()
544544
})
545545

546+
test('should hoist props for root with single element excluding comments', () => {
547+
// deeply nested div to trigger stringification condition
548+
const root = transformWithCache(
549+
`<!--comment--><div id="a"><div id="b"><div id="c"><div id="d"><div id="e">hello</div></div></div></div></div>`,
550+
)
551+
expect(root.cached.length).toBe(1)
552+
expect(root.hoists).toMatchObject([createObjectMatcher({ id: 'a' })])
553+
554+
expect((root.codegenNode as VNodeCall).children).toMatchObject([
555+
{
556+
type: NodeTypes.COMMENT,
557+
content: 'comment',
558+
},
559+
{
560+
type: NodeTypes.ELEMENT,
561+
codegenNode: {
562+
type: NodeTypes.VNODE_CALL,
563+
tag: `"div"`,
564+
props: { content: `_hoisted_1` },
565+
children: { type: NodeTypes.JS_CACHE_EXPRESSION },
566+
},
567+
},
568+
])
569+
expect(generate(root).code).toMatchSnapshot()
570+
})
571+
546572
describe('prefixIdentifiers', () => {
547573
test('cache nested static tree with static interpolation', () => {
548574
const root = transformWithCache(

packages/compiler-core/__tests__/transforms/vSlot.spec.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -988,5 +988,19 @@ describe('compiler: transform component slots', () => {
988988

989989
expect(generate(root, { prefixIdentifiers: true }).code).toMatchSnapshot()
990990
})
991+
992+
test('named slot with v-if + v-else', () => {
993+
const source = `
994+
<Comp>
995+
<template #one v-if="ok">foo</template>
996+
<template #two v-else>baz</template>
997+
</Comp>
998+
`
999+
const { root } = parseWithSlots(source, {
1000+
whitespace: 'preserve',
1001+
})
1002+
1003+
expect(generate(root, { prefixIdentifiers: true }).code).toMatchSnapshot()
1004+
})
9911005
})
9921006
})

0 commit comments

Comments
 (0)