Skip to content

Commit 7fe4712

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents d6c5bcf + 574c3e6 commit 7fe4712

File tree

37 files changed

+777
-257
lines changed

37 files changed

+777
-257
lines changed

CHANGELOG.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,32 @@
1+
## [3.4.25](https://github.com/vuejs/core/compare/v3.4.24...v3.4.25) (2024-04-24)
2+
3+
4+
### Bug Fixes
5+
6+
* **defineModel:** align prod mode runtime type generation with defineProps ([4253a57](https://github.com/vuejs/core/commit/4253a57f1703a7f1ac701d77e0a235689203461d)), closes [#10769](https://github.com/vuejs/core/issues/10769)
7+
* **runtime-core:** properly get keepAlive child ([#10772](https://github.com/vuejs/core/issues/10772)) ([3724693](https://github.com/vuejs/core/commit/3724693a25c3f2dd13d70a8a1af760b03a4fb783)), closes [#10771](https://github.com/vuejs/core/issues/10771)
8+
* **runtime-core:** use normal object as internal prototype for attrs and slots ([064e82f](https://github.com/vuejs/core/commit/064e82f5855f30fe0b77fe9b5e4dd22700fd634d)), closes [/github.com/vuejs/core/commit/6df53d85a207986128159d88565e6e7045db2add#r141304923](https://github.com//github.com/vuejs/core/commit/6df53d85a207986128159d88565e6e7045db2add/issues/r141304923)
9+
10+
11+
12+
## [3.4.24](https://github.com/vuejs/core/compare/v3.4.23...v3.4.24) (2024-04-22)
13+
14+
15+
### Bug Fixes
16+
17+
* **compiler-core:** handle template ref bound via v-bind object on v-for ([#10706](https://github.com/vuejs/core/issues/10706)) ([da7adef](https://github.com/vuejs/core/commit/da7adefa844265eecc9c336abfc727bc05b4f16e)), closes [#10696](https://github.com/vuejs/core/issues/10696)
18+
* **compiler-core:** properly parse await expressions in edge cases ([b92c25f](https://github.com/vuejs/core/commit/b92c25f53dff0fc1687f57ca4033d0ac25218940)), closes [#10754](https://github.com/vuejs/core/issues/10754)
19+
* **compiler-sfc:** handle readonly operator and ReadonlyArray/Map/Set types ([5cef52a](https://github.com/vuejs/core/commit/5cef52a5c23ba8ba3239e6def03b8ff008d3cc72)), closes [#10726](https://github.com/vuejs/core/issues/10726)
20+
* **compiler-ssr:** fix hydration mismatch for conditional slot in transition ([f12c81e](https://github.com/vuejs/core/commit/f12c81efca3fcf9a7ce478af2261ad6ab9b0bfd7)), closes [#10743](https://github.com/vuejs/core/issues/10743)
21+
* **compiler-ssr:** fix v-html SSR for nullish values ([1ff4076](https://github.com/vuejs/core/commit/1ff407676f9495883b459779a9b0370d7588b51f)), closes [#10725](https://github.com/vuejs/core/issues/10725)
22+
* **deps:** update compiler ([#10760](https://github.com/vuejs/core/issues/10760)) ([15df5c1](https://github.com/vuejs/core/commit/15df5c1b261b9b471eb811fd47ab7b3cfc41cf83))
23+
* **runtime-core:** fix edge case of KeepAlive inside Transition with slot children ([#10719](https://github.com/vuejs/core/issues/10719)) ([e51ca61](https://github.com/vuejs/core/commit/e51ca61ca060b2772e967d169548fc2f58fce6d1)), closes [#10708](https://github.com/vuejs/core/issues/10708)
24+
* **runtime-core:** further fix slots _ctx check ([cde7f05](https://github.com/vuejs/core/commit/cde7f05787d16dbb93d9419ef5331adf992816fd)), closes [#10724](https://github.com/vuejs/core/issues/10724)
25+
* **runtime-core:** props should be readonly via direct template access ([b93f264](https://github.com/vuejs/core/commit/b93f26464785de227b88c51a88328ae80e80d804)), closes [#8216](https://github.com/vuejs/core/issues/8216) [#10736](https://github.com/vuejs/core/issues/10736)
26+
* **transition:** transition is breaking/flickering when enter is canceled ([#10688](https://github.com/vuejs/core/issues/10688)) ([65109a7](https://github.com/vuejs/core/commit/65109a70f187473edae8cf4df11af3c33345e6f6))
27+
28+
29+
130
## [3.4.23](https://github.com/vuejs/core/compare/v3.4.22...v3.4.23) (2024-04-16)
231

332

SECURITY.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ Please note that we do not consider XSS via template expressions a valid attack
1010

1111
We would like to thank the following security researchers for responsibly disclosing security issues to us.
1212

13-
- Jeet Pal - [GitHub](https://github.com/jeetpal2007) | [Email]([email protected]) | [LinkedIn](https://in.linkedin.com/in/jeet-pal-22601a290 )
13+
- Jeet Pal - [@jeetpal2007](https://github.com/jeetpal2007) | [Email]([email protected]) | [LinkedIn](https://in.linkedin.com/in/jeet-pal-22601a290 )
14+
- Mix - [@mnixry](https://github.com/mnixry)

package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"version": "3.0.0-vapor",
4-
"packageManager": "[email protected].1",
4+
"packageManager": "[email protected].5",
55
"type": "module",
66
"scripts": {
77
"dev": "node scripts/dev.js vue vue-vapor",
@@ -59,7 +59,7 @@
5959
"node": ">=18.12.0"
6060
},
6161
"devDependencies": {
62-
"@babel/parser": "^7.24.1",
62+
"@babel/parser": "^7.24.4",
6363
"@babel/types": "^7.24.0",
6464
"@codspeed/vitest-plugin": "^3.1.0",
6565
"@rollup/plugin-alias": "^5.1.0",
@@ -70,10 +70,10 @@
7070
"@rollup/plugin-terser": "^0.4.4",
7171
"@types/hash-sum": "^1.0.2",
7272
"@types/minimist": "^1.2.5",
73-
"@types/node": "^20.12.5",
73+
"@types/node": "^20.12.7",
7474
"@types/semver": "^7.5.8",
75-
"@vitest/coverage-istanbul": "^1.4.0",
76-
"@vitest/ui": "^1.4.0",
75+
"@vitest/coverage-istanbul": "^1.5.0",
76+
"@vitest/ui": "^1.5.0",
7777
"@vue/consolidate": "1.0.0",
7878
"conventional-changelog-cli": "^4.1.0",
7979
"enquirer": "^2.4.1",
@@ -87,32 +87,32 @@
8787
"jsdom": "^24.0.0",
8888
"lint-staged": "^15.2.2",
8989
"lodash": "^4.17.21",
90-
"magic-string": "^0.30.8",
90+
"magic-string": "^0.30.10",
9191
"markdown-table": "^3.0.3",
92-
"marked": "^12.0.1",
92+
"marked": "^12.0.2",
9393
"minimist": "^1.2.8",
9494
"npm-run-all2": "^6.1.2",
9595
"picocolors": "^1.0.0",
9696
"prettier": "^3.2.5",
9797
"pretty-bytes": "^6.1.1",
9898
"pug": "^3.0.2",
99-
"puppeteer": "~22.6.3",
99+
"puppeteer": "~22.6.5",
100100
"rimraf": "^5.0.5",
101-
"rollup": "^4.13.2",
101+
"rollup": "^4.16.1",
102102
"rollup-plugin-dts": "^6.1.0",
103103
"rollup-plugin-esbuild": "^6.1.1",
104104
"rollup-plugin-polyfill-node": "^0.13.0",
105105
"semver": "^7.6.0",
106106
"serve": "^14.2.1",
107107
"simple-git-hooks": "^2.11.1",
108-
"terser": "^5.30.1",
108+
"terser": "^5.30.3",
109109
"todomvc-app-css": "^2.4.3",
110110
"tslib": "^2.6.2",
111111
"tsx": "^4.7.2",
112112
"typescript": "~5.4.5",
113113
"typescript-eslint": "^7.6.0",
114-
"vite": "^5.2.7",
115-
"vitest": "^1.4.0"
114+
"vite": "^5.2.10",
115+
"vitest": "^1.5.0"
116116
},
117117
"pnpm": {
118118
"peerDependencyRules": {
Lines changed: 228 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,228 @@
1+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2+
3+
exports[`compiler: v-for > codegen > basic v-for 1`] = `
4+
"const _Vue = Vue
5+
6+
return function render(_ctx, _cache) {
7+
with (_ctx) {
8+
const { renderList: _renderList, Fragment: _Fragment, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
9+
10+
return (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(items, (item) => {
11+
return (_openBlock(), _createElementBlock("span"))
12+
}), 256 /* UNKEYED_FRAGMENT */))
13+
}
14+
}"
15+
`;
16+
17+
exports[`compiler: v-for > codegen > keyed template v-for 1`] = `
18+
"const _Vue = Vue
19+
20+
return function render(_ctx, _cache) {
21+
with (_ctx) {
22+
const { renderList: _renderList, Fragment: _Fragment, openBlock: _openBlock, createElementBlock: _createElementBlock, createElementVNode: _createElementVNode } = _Vue
23+
24+
return (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(items, (item) => {
25+
return (_openBlock(), _createElementBlock(_Fragment, { key: item }, [
26+
"hello",
27+
_createElementVNode("span")
28+
], 64 /* STABLE_FRAGMENT */))
29+
}), 128 /* KEYED_FRAGMENT */))
30+
}
31+
}"
32+
`;
33+
34+
exports[`compiler: v-for > codegen > keyed v-for 1`] = `
35+
"const _Vue = Vue
36+
37+
return function render(_ctx, _cache) {
38+
with (_ctx) {
39+
const { renderList: _renderList, Fragment: _Fragment, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
40+
41+
return (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(items, (item) => {
42+
return (_openBlock(), _createElementBlock("span", { key: item }))
43+
}), 128 /* KEYED_FRAGMENT */))
44+
}
45+
}"
46+
`;
47+
48+
exports[`compiler: v-for > codegen > skipped key 1`] = `
49+
"const _Vue = Vue
50+
51+
return function render(_ctx, _cache) {
52+
with (_ctx) {
53+
const { renderList: _renderList, Fragment: _Fragment, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
54+
55+
return (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(items, (item, __, index) => {
56+
return (_openBlock(), _createElementBlock("span"))
57+
}), 256 /* UNKEYED_FRAGMENT */))
58+
}
59+
}"
60+
`;
61+
62+
exports[`compiler: v-for > codegen > skipped value & key 1`] = `
63+
"const _Vue = Vue
64+
65+
return function render(_ctx, _cache) {
66+
with (_ctx) {
67+
const { renderList: _renderList, Fragment: _Fragment, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
68+
69+
return (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(items, (_, __, index) => {
70+
return (_openBlock(), _createElementBlock("span"))
71+
}), 256 /* UNKEYED_FRAGMENT */))
72+
}
73+
}"
74+
`;
75+
76+
exports[`compiler: v-for > codegen > skipped value 1`] = `
77+
"const _Vue = Vue
78+
79+
return function render(_ctx, _cache) {
80+
with (_ctx) {
81+
const { renderList: _renderList, Fragment: _Fragment, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
82+
83+
return (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(items, (_, key, index) => {
84+
return (_openBlock(), _createElementBlock("span"))
85+
}), 256 /* UNKEYED_FRAGMENT */))
86+
}
87+
}"
88+
`;
89+
90+
exports[`compiler: v-for > codegen > template v-for 1`] = `
91+
"const _Vue = Vue
92+
93+
return function render(_ctx, _cache) {
94+
with (_ctx) {
95+
const { renderList: _renderList, Fragment: _Fragment, openBlock: _openBlock, createElementBlock: _createElementBlock, createElementVNode: _createElementVNode } = _Vue
96+
97+
return (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(items, (item) => {
98+
return (_openBlock(), _createElementBlock(_Fragment, null, [
99+
"hello",
100+
_createElementVNode("span")
101+
], 64 /* STABLE_FRAGMENT */))
102+
}), 256 /* UNKEYED_FRAGMENT */))
103+
}
104+
}"
105+
`;
106+
107+
exports[`compiler: v-for > codegen > template v-for key injection with single child 1`] = `
108+
"const _Vue = Vue
109+
110+
return function render(_ctx, _cache) {
111+
with (_ctx) {
112+
const { renderList: _renderList, Fragment: _Fragment, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
113+
114+
return (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(items, (item) => {
115+
return (_openBlock(), _createElementBlock("span", {
116+
key: item.id,
117+
id: item.id
118+
}, null, 8 /* PROPS */, ["id"]))
119+
}), 128 /* KEYED_FRAGMENT */))
120+
}
121+
}"
122+
`;
123+
124+
exports[`compiler: v-for > codegen > template v-for w/ <slot/> 1`] = `
125+
"const _Vue = Vue
126+
127+
return function render(_ctx, _cache) {
128+
with (_ctx) {
129+
const { renderList: _renderList, Fragment: _Fragment, openBlock: _openBlock, createElementBlock: _createElementBlock, renderSlot: _renderSlot } = _Vue
130+
131+
return (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(items, (item) => {
132+
return _renderSlot($slots, "default")
133+
}), 256 /* UNKEYED_FRAGMENT */))
134+
}
135+
}"
136+
`;
137+
138+
exports[`compiler: v-for > codegen > v-for on <slot/> 1`] = `
139+
"const _Vue = Vue
140+
141+
return function render(_ctx, _cache) {
142+
with (_ctx) {
143+
const { renderList: _renderList, Fragment: _Fragment, openBlock: _openBlock, createElementBlock: _createElementBlock, renderSlot: _renderSlot } = _Vue
144+
145+
return (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(items, (item) => {
146+
return _renderSlot($slots, "default")
147+
}), 256 /* UNKEYED_FRAGMENT */))
148+
}
149+
}"
150+
`;
151+
152+
exports[`compiler: v-for > codegen > v-for on element with custom directive 1`] = `
153+
"const _Vue = Vue
154+
155+
return function render(_ctx, _cache) {
156+
with (_ctx) {
157+
const { renderList: _renderList, Fragment: _Fragment, openBlock: _openBlock, createElementBlock: _createElementBlock, resolveDirective: _resolveDirective, withDirectives: _withDirectives } = _Vue
158+
159+
const _directive_foo = _resolveDirective("foo")
160+
161+
return (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(list, (i) => {
162+
return _withDirectives((_openBlock(), _createElementBlock("div", null, null, 512 /* NEED_PATCH */)), [
163+
[_directive_foo]
164+
])
165+
}), 256 /* UNKEYED_FRAGMENT */))
166+
}
167+
}"
168+
`;
169+
170+
exports[`compiler: v-for > codegen > v-for with constant expression 1`] = `
171+
"const _Vue = Vue
172+
173+
return function render(_ctx, _cache) {
174+
with (_ctx) {
175+
const { renderList: _renderList, Fragment: _Fragment, openBlock: _openBlock, createElementBlock: _createElementBlock, toDisplayString: _toDisplayString, createElementVNode: _createElementVNode } = _Vue
176+
177+
return (_openBlock(), _createElementBlock(_Fragment, null, _renderList(10, (item) => {
178+
return _createElementVNode("p", null, _toDisplayString(item), 1 /* TEXT */)
179+
}), 64 /* STABLE_FRAGMENT */))
180+
}
181+
}"
182+
`;
183+
184+
exports[`compiler: v-for > codegen > v-if + v-for 1`] = `
185+
"const _Vue = Vue
186+
187+
return function render(_ctx, _cache) {
188+
with (_ctx) {
189+
const { renderList: _renderList, Fragment: _Fragment, openBlock: _openBlock, createElementBlock: _createElementBlock, createCommentVNode: _createCommentVNode } = _Vue
190+
191+
return ok
192+
? (_openBlock(true), _createElementBlock(_Fragment, { key: 0 }, _renderList(list, (i) => {
193+
return (_openBlock(), _createElementBlock("div"))
194+
}), 256 /* UNKEYED_FRAGMENT */))
195+
: _createCommentVNode("v-if", true)
196+
}
197+
}"
198+
`;
199+
200+
exports[`compiler: v-for > codegen > v-if + v-for on <template> 1`] = `
201+
"const _Vue = Vue
202+
203+
return function render(_ctx, _cache) {
204+
with (_ctx) {
205+
const { renderList: _renderList, Fragment: _Fragment, openBlock: _openBlock, createElementBlock: _createElementBlock, createCommentVNode: _createCommentVNode } = _Vue
206+
207+
return ok
208+
? (_openBlock(true), _createElementBlock(_Fragment, { key: 0 }, _renderList(list, (i) => {
209+
return (_openBlock(), _createElementBlock(_Fragment, null, [], 64 /* STABLE_FRAGMENT */))
210+
}), 256 /* UNKEYED_FRAGMENT */))
211+
: _createCommentVNode("v-if", true)
212+
}
213+
}"
214+
`;
215+
216+
exports[`compiler: v-for > codegen > value + key + index 1`] = `
217+
"const _Vue = Vue
218+
219+
return function render(_ctx, _cache) {
220+
with (_ctx) {
221+
const { renderList: _renderList, Fragment: _Fragment, openBlock: _openBlock, createElementBlock: _createElementBlock } = _Vue
222+
223+
return (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(items, (item, key, index) => {
224+
return (_openBlock(), _createElementBlock("span"))
225+
}), 256 /* UNKEYED_FRAGMENT */))
226+
}
227+
}"
228+
`;

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

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import { transformBind } from '../../src/transforms/vBind'
3939
import { PatchFlags } from '@vue/shared'
4040
import { createObjectMatcher, genFlagText } from '../testUtils'
4141
import { transformText } from '../../src/transforms/transformText'
42+
import { parseWithForTransform } from './vFor.spec'
4243

4344
function parseWithElementTransform(
4445
template: string,
@@ -1338,4 +1339,42 @@ describe('compiler: element transform', () => {
13381339
isBlock: false,
13391340
})
13401341
})
1342+
1343+
test('ref_for marker on static ref', () => {
1344+
const { node } = parseWithForTransform(`<div v-for="i in l" ref="x"/>`)
1345+
expect((node.children[0] as any).codegenNode.props).toMatchObject(
1346+
createObjectMatcher({
1347+
ref_for: `[true]`,
1348+
ref: 'x',
1349+
}),
1350+
)
1351+
})
1352+
1353+
test('ref_for marker on dynamic ref', () => {
1354+
const { node } = parseWithForTransform(`<div v-for="i in l" :ref="x"/>`)
1355+
expect((node.children[0] as any).codegenNode.props).toMatchObject(
1356+
createObjectMatcher({
1357+
ref_for: `[true]`,
1358+
ref: '[x]',
1359+
}),
1360+
)
1361+
})
1362+
1363+
test('ref_for marker on v-bind', () => {
1364+
const { node } = parseWithForTransform(`<div v-for="i in l" v-bind="x" />`)
1365+
expect((node.children[0] as any).codegenNode.props).toMatchObject({
1366+
type: NodeTypes.JS_CALL_EXPRESSION,
1367+
callee: MERGE_PROPS,
1368+
arguments: [
1369+
createObjectMatcher({
1370+
ref_for: `[true]`,
1371+
}),
1372+
{
1373+
type: NodeTypes.SIMPLE_EXPRESSION,
1374+
content: 'x',
1375+
isStatic: false,
1376+
},
1377+
],
1378+
})
1379+
})
13411380
})

0 commit comments

Comments
 (0)