Skip to content

Commit 2635626

Browse files
committed
chore: Merge branch 'main' into minor
2 parents 96e4738 + 3e89a0d commit 2635626

File tree

84 files changed

+1992
-786
lines changed

Some content is hidden

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

84 files changed

+1992
-786
lines changed

.github/workflows/autofix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- uses: actions/checkout@v4
1515

1616
- name: Install pnpm
17-
uses: pnpm/action-setup@v3.0.0
17+
uses: pnpm/action-setup@v4.0.0
1818

1919
- name: Set node version to 18
2020
uses: actions/setup-node@v4

.github/workflows/canary-minor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
ref: minor
1818

1919
- name: Install pnpm
20-
uses: pnpm/action-setup@v3.0.0
20+
uses: pnpm/action-setup@v4.0.0
2121

2222
- name: Set node version to 18
2323
uses: actions/setup-node@v4

.github/workflows/canary.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- uses: actions/checkout@v4
1616

1717
- name: Install pnpm
18-
uses: pnpm/action-setup@v3.0.0
18+
uses: pnpm/action-setup@v4.0.0
1919

2020
- name: Install Node.js
2121
uses: actions/setup-node@v4

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- uses: actions/checkout@v4
2222

2323
- name: Install pnpm
24-
uses: pnpm/action-setup@v3.0.0
24+
uses: pnpm/action-setup@v4.0.0
2525

2626
- name: Install Node.js
2727
uses: actions/setup-node@v4
@@ -43,7 +43,7 @@ jobs:
4343
- uses: actions/checkout@v4
4444

4545
- name: Install pnpm
46-
uses: pnpm/action-setup@v3.0.0
46+
uses: pnpm/action-setup@v4.0.0
4747

4848
- name: Install Node.js
4949
uses: actions/setup-node@v4
@@ -72,7 +72,7 @@ jobs:
7272
key: chromium-${{ hashFiles('pnpm-lock.yaml') }}
7373

7474
- name: Install pnpm
75-
uses: pnpm/action-setup@v3.0.0
75+
uses: pnpm/action-setup@v4.0.0
7676

7777
- name: Install Node.js
7878
uses: actions/setup-node@v4
@@ -98,7 +98,7 @@ jobs:
9898
- uses: actions/checkout@v4
9999

100100
- name: Install pnpm
101-
uses: pnpm/action-setup@v3.0.0
101+
uses: pnpm/action-setup@v4.0.0
102102

103103
- name: Install Node.js
104104
uses: actions/setup-node@v4

.github/workflows/size-data.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- uses: actions/checkout@v4
2424

2525
- name: Install pnpm
26-
uses: pnpm/action-setup@v3.0.0
26+
uses: pnpm/action-setup@v4.0.0
2727

2828
- name: Install Node.js
2929
uses: actions/setup-node@v4

.github/workflows/size-report.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- uses: actions/checkout@v4
2525

2626
- name: Install pnpm
27-
uses: pnpm/action-setup@v3.0.0
27+
uses: pnpm/action-setup@v4.0.0
2828

2929
- name: Install Node.js
3030
uses: actions/setup-node@v4
@@ -36,14 +36,14 @@ jobs:
3636
run: pnpm install
3737

3838
- name: Download Size Data
39-
uses: dawidd6/action-download-artifact@v3
39+
uses: dawidd6/action-download-artifact@v4
4040
with:
4141
name: size-data
4242
run_id: ${{ github.event.workflow_run.id }}
4343
path: temp/size
4444

4545
- name: Download Previous Size Data
46-
uses: dawidd6/action-download-artifact@v3
46+
uses: dawidd6/action-download-artifact@v4
4747
with:
4848
branch: main
4949
workflow: size-data.yml

CHANGELOG.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,54 @@
1+
## [3.4.28](https://github.com/vuejs/core/compare/v3.4.27...v3.4.28) (2024-06-14)
2+
3+
4+
### Bug Fixes
5+
6+
* **compat:** correctly transform non-identifier expressions in legacy filter syntax ([#10896](https://github.com/vuejs/core/issues/10896)) ([07b3c4b](https://github.com/vuejs/core/commit/07b3c4b7860009e19446f3d78571556c5737d82a)), closes [#10852](https://github.com/vuejs/core/issues/10852)
7+
* **compat:** ensure proper handling of render fuction from SFC using Vue.extend ([#7781](https://github.com/vuejs/core/issues/7781)) ([c73847f](https://github.com/vuejs/core/commit/c73847f2becc20f03cb9c68748eea92455e688ee)), closes [#7766](https://github.com/vuejs/core/issues/7766)
8+
* **compat:** only warn ATTR_FALSE_VALUE when enabled ([04729ba](https://github.com/vuejs/core/commit/04729ba2163d840f0ca7866bc964696eb5557804)), closes [#11126](https://github.com/vuejs/core/issues/11126)
9+
* **compile-sfc:** register props destructure rest id as setup bindings ([#10888](https://github.com/vuejs/core/issues/10888)) ([b2b5f57](https://github.com/vuejs/core/commit/b2b5f57c2c945edd0eebc1b545ec1b7568e51484)), closes [#10885](https://github.com/vuejs/core/issues/10885)
10+
* **compile-sfc:** Support project reference with folder, ([#10908](https://github.com/vuejs/core/issues/10908)) ([bdeac37](https://github.com/vuejs/core/commit/bdeac377c7b85888193b49ac187e927636cc40bc)), closes [#10907](https://github.com/vuejs/core/issues/10907)
11+
* **compiler-core:** allow unicode to appear in simple identifiers ([#6765](https://github.com/vuejs/core/issues/6765)) ([3ea9644](https://github.com/vuejs/core/commit/3ea964473d3ac0ba3e7b0b2c22d71f23d0f69123)), closes [#6367](https://github.com/vuejs/core/issues/6367)
12+
* **compiler-core:** change v-for key type to match Object.keys ([#10963](https://github.com/vuejs/core/issues/10963)) ([9fead52](https://github.com/vuejs/core/commit/9fead5234320848f8be82275c6b5dd0a290f2cca)), closes [#8819](https://github.com/vuejs/core/issues/8819)
13+
* **compiler-core:** emit TS-compatible function declaration when requested ([#9363](https://github.com/vuejs/core/issues/9363)) ([5d25850](https://github.com/vuejs/core/commit/5d258502a0faffc8a451b8701f13a31b2566d068))
14+
* **compiler-core:** fix :key shorthand on v-for ([#10942](https://github.com/vuejs/core/issues/10942)) ([29425df](https://github.com/vuejs/core/commit/29425df1acb9e520c6ae894d06bcff73fde90edd)), closes [#10882](https://github.com/vuejs/core/issues/10882) [#10939](https://github.com/vuejs/core/issues/10939)
15+
* **compiler-core:** make `ForIteratorExpression`'s `returns` property optional ([#11011](https://github.com/vuejs/core/issues/11011)) ([5b8c1af](https://github.com/vuejs/core/commit/5b8c1afb74e39045fcb53a011420d26e3f67eab4))
16+
* **compiler-core:** should set `<math>` tag as block to retain MathML namespace after patching ([#10891](https://github.com/vuejs/core/issues/10891)) ([87c5443](https://github.com/vuejs/core/commit/87c54430448005294c41803f07f517fef848f917))
17+
* **compiler-core:** v-for expression missing source with spaces should emit error ([#5821](https://github.com/vuejs/core/issues/5821)) ([b9ca202](https://github.com/vuejs/core/commit/b9ca202f477be595477e182972ee9bae3f2b9f74)), closes [#5819](https://github.com/vuejs/core/issues/5819)
18+
* **compiler-sfc:** improve type resolving for the keyof operator ([#10921](https://github.com/vuejs/core/issues/10921)) ([293cf4e](https://github.com/vuejs/core/commit/293cf4e131b6d4606e1de2cd7ea87814e2544952)), closes [#10920](https://github.com/vuejs/core/issues/10920) [#11002](https://github.com/vuejs/core/issues/11002)
19+
* **compiler-sfc:** support as keyword with template literal types ([#11100](https://github.com/vuejs/core/issues/11100)) ([2594b1d](https://github.com/vuejs/core/commit/2594b1df57f672ac6621ac2880645e975fea581c)), closes [#10962](https://github.com/vuejs/core/issues/10962)
20+
* **compiler-sfc:** support type resolve for keyof for intersection & union types ([#11132](https://github.com/vuejs/core/issues/11132)) ([495263a](https://github.com/vuejs/core/commit/495263a9cb356861e58a4364f2570608265486b5)), closes [#11129](https://github.com/vuejs/core/issues/11129)
21+
* **compiler-sfc:** throw error when import macro as alias ([#11041](https://github.com/vuejs/core/issues/11041)) ([34a97ed](https://github.com/vuejs/core/commit/34a97edd2c8273c213599c44770accdb0846da8e))
22+
* correct the type of `<details>`'s `onToggle` event handler ([#10938](https://github.com/vuejs/core/issues/10938)) ([fd18ce7](https://github.com/vuejs/core/commit/fd18ce70b1a260a2485c9cd7faa30193da4b79f5)), closes [#10928](https://github.com/vuejs/core/issues/10928)
23+
* **custom-element:** disconnect MutationObserver in nextTick in case that custom elements are moved ([#10613](https://github.com/vuejs/core/issues/10613)) ([bbb5be2](https://github.com/vuejs/core/commit/bbb5be299b500a00e60c757118c846c3b5ddd8e0)), closes [#10610](https://github.com/vuejs/core/issues/10610)
24+
* **custom-elements:** compatibility of createElement in older versions of Chrome ([#9615](https://github.com/vuejs/core/issues/9615)) ([a88295d](https://github.com/vuejs/core/commit/a88295dc076ee867939d8b0ee2225e63c5ffb0ca)), closes [#9614](https://github.com/vuejs/core/issues/9614)
25+
* **hmr:** avoid infinite recursion when reloading hmr components ([#6936](https://github.com/vuejs/core/issues/6936)) ([36bd9b0](https://github.com/vuejs/core/commit/36bd9b0a1fb83e61731fb80d66e265dccbedcfa8)), closes [#6930](https://github.com/vuejs/core/issues/6930)
26+
* **hydration:** log hydration error even when using async components ([#9403](https://github.com/vuejs/core/issues/9403)) ([5afc76c](https://github.com/vuejs/core/commit/5afc76c229f9ad30eef07f34c7b65e8fe427e637)), closes [#9369](https://github.com/vuejs/core/issues/9369)
27+
* **KeepAlive:** properly cache nested Suspense subtree ([#10912](https://github.com/vuejs/core/issues/10912)) ([07764fe](https://github.com/vuejs/core/commit/07764fe330692fadf0fc9fb9e92cb5b111df33be))
28+
* **npm:** explicitly add `@vue/reactivity` as dependency of `@vue/runtime-dom` ([#10468](https://github.com/vuejs/core/issues/10468)) ([ec424f6](https://github.com/vuejs/core/commit/ec424f6cd96b7e6ba74fc244c484c00fa5590aac))
29+
* **reactivity:** pass oldValue in debug info when triggering refs ([#8210](https://github.com/vuejs/core/issues/8210)) ([3b0a56a](https://github.com/vuejs/core/commit/3b0a56a9c4d162ec3bd725a4f2dfd776b045e727)), closes [vuejs/pinia#2061](https://github.com/vuejs/pinia/issues/2061)
30+
* **runtime-core:** avoid traversing static children for vnodes w/ PatchFlags.BAIL ([#11115](https://github.com/vuejs/core/issues/11115)) ([b557d3f](https://github.com/vuejs/core/commit/b557d3fb8ae1e4e926c4ad0fbb2fa7abe50fd661)), closes [#10547](https://github.com/vuejs/core/issues/10547)
31+
* **runtime-core:** do not fire mount/activated hooks if unmounted before mounted ([#9370](https://github.com/vuejs/core/issues/9370)) ([aa156ed](https://github.com/vuejs/core/commit/aa156ed5c4dc0d33ff37e201a7e89d5e0e29160e)), closes [#8898](https://github.com/vuejs/core/issues/8898) [#9264](https://github.com/vuejs/core/issues/9264) [#9617](https://github.com/vuejs/core/issues/9617)
32+
* **runtime-core:** ensure suspense creates dep component's render effect with correct optimized flag ([#7689](https://github.com/vuejs/core/issues/7689)) ([c521f95](https://github.com/vuejs/core/commit/c521f956e1697cda36a7f1b913599e5e2004f7ba)), closes [#7688](https://github.com/vuejs/core/issues/7688)
33+
* **runtime-core:** fix missed updates when passing text vnode to `<component :is>` ([#8304](https://github.com/vuejs/core/issues/8304)) ([b310ec3](https://github.com/vuejs/core/commit/b310ec389d9738247e5b0f01711186216eb49955)), closes [#8298](https://github.com/vuejs/core/issues/8298)
34+
* **runtime-core:** fix stale v-memo after v-if toggle ([#6606](https://github.com/vuejs/core/issues/6606)) ([edf2638](https://github.com/vuejs/core/commit/edf263847eddc910f4d2de68287d84b8c66c3860)), closes [#6593](https://github.com/vuejs/core/issues/6593)
35+
* **runtime-core:** fix Transition for components with root-level v-if ([#7678](https://github.com/vuejs/core/issues/7678)) ([ef2e737](https://github.com/vuejs/core/commit/ef2e737577de42ea38771403f8a4dee8c892daa5)), closes [#7649](https://github.com/vuejs/core/issues/7649)
36+
* **runtime-dom:** also set attribute for form element state ([537a571](https://github.com/vuejs/core/commit/537a571f8cf09dfe0a020e9e8891ecdd351fc3e4)), closes [#6007](https://github.com/vuejs/core/issues/6007) [#6012](https://github.com/vuejs/core/issues/6012)
37+
* **runtime-dom:** support Symbol for input value bindings ([#10608](https://github.com/vuejs/core/issues/10608)) ([188f3ae](https://github.com/vuejs/core/commit/188f3ae533fd340603068a516a8fecc5d57426c5)), closes [#10597](https://github.com/vuejs/core/issues/10597)
38+
* **shared:** ensure invokeArrayFns handles undefined arguments ([#10869](https://github.com/vuejs/core/issues/10869)) ([9b40d0f](https://github.com/vuejs/core/commit/9b40d0f25da868a83b0d6bf99dbbdb3ca68bb700)), closes [#10863](https://github.com/vuejs/core/issues/10863)
39+
* **ssr:** directive binding.instance should respect exposed during ssr ([df686ab](https://github.com/vuejs/core/commit/df686abb4f0ac9d898e4fd93751e860f8cbbdbea)), closes [#7499](https://github.com/vuejs/core/issues/7499) [#7502](https://github.com/vuejs/core/issues/7502)
40+
* **ssr:** fix hydration for node with empty text node ([#7216](https://github.com/vuejs/core/issues/7216)) ([d1011c0](https://github.com/vuejs/core/commit/d1011c07a957d858cb37725b13bc8e4d7a395490))
41+
* **ssr:** fix the bug that multi slot scope id does not work on component ([#6100](https://github.com/vuejs/core/issues/6100)) ([4c74302](https://github.com/vuejs/core/commit/4c74302aae64c118752db7fc2a2c229a11ebaead)), closes [#6093](https://github.com/vuejs/core/issues/6093)
42+
* **teleport:** do not throw target warning when teleport is disabled ([#9818](https://github.com/vuejs/core/issues/9818)) ([15ee43f](https://github.com/vuejs/core/commit/15ee43f66ad2485ac212b02b444345d867b3c060))
43+
* **transition:** ensure Transition enterHooks are updated after clone ([#11066](https://github.com/vuejs/core/issues/11066)) ([671cf29](https://github.com/vuejs/core/commit/671cf297a550d15b19fa3fecce1b30e26cad8154)), closes [#11061](https://github.com/vuejs/core/issues/11061)
44+
* **types/apiWatch:** correct type inference for reactive array ([#11036](https://github.com/vuejs/core/issues/11036)) ([aae2d78](https://github.com/vuejs/core/commit/aae2d78875daa476280a45e71c2f38292964efae)), closes [#9416](https://github.com/vuejs/core/issues/9416)
45+
* **types:** improve `app.provide` type checking ([#10603](https://github.com/vuejs/core/issues/10603)) ([612bbf0](https://github.com/vuejs/core/commit/612bbf0507cbe39d701acc5dff11824802078063)), closes [#10602](https://github.com/vuejs/core/issues/10602)
46+
* **types:** support generic argument in setup context expose method ([#8507](https://github.com/vuejs/core/issues/8507)) ([635a59b](https://github.com/vuejs/core/commit/635a59b96fe6be445525c6595ca27da7ef7c1feb))
47+
* **v-model:** fix the lazy modifier is not reset by other modifications ([#8547](https://github.com/vuejs/core/issues/8547)) ([a52a02f](https://github.com/vuejs/core/commit/a52a02f43fdf73d8aaad99c9cafed07f12ee422a)), closes [#8546](https://github.com/vuejs/core/issues/8546) [#6564](https://github.com/vuejs/core/issues/6564) [#6773](https://github.com/vuejs/core/issues/6773)
48+
* **watch:** support traversing symbol properties in deep watcher ([#10969](https://github.com/vuejs/core/issues/10969)) ([a3e8aaf](https://github.com/vuejs/core/commit/a3e8aafbcc82003a66caded61143eb64c4ef02cd)), closes [#402](https://github.com/vuejs/core/issues/402)
49+
50+
51+
152
## [3.4.27](https://github.com/vuejs/core/compare/v3.4.26...v3.4.27) (2024-05-06)
253

354

SECURITY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ We would like to thank the following security researchers for responsibly disclo
1212

1313
- Jeet Pal - [@jeetpal2007](https://github.com/jeetpal2007) | [Email](jeetpal2007@gmail.com) | [LinkedIn](https://in.linkedin.com/in/jeet-pal-22601a290 )
1414
- Mix - [@mnixry](https://github.com/mnixry)
15+
- Aviv Keller - [@RedYetiDev](https://github.com/redyetidev) | [LinkedIn](https://www.linkedin.com/in/redyetidev) <redyetidev@gmail.com>

package.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"version": "3.5.0-alpha.2",
4-
"packageManager": "pnpm@9.1.2",
4+
"packageManager": "pnpm@9.2.0",
55
"type": "module",
66
"scripts": {
77
"dev": "node scripts/dev.js",
@@ -59,8 +59,8 @@
5959
"node": ">=18.12.0"
6060
},
6161
"devDependencies": {
62-
"@babel/parser": "^7.24.6",
63-
"@babel/types": "^7.24.6",
62+
"@babel/parser": "^7.24.7",
63+
"@babel/types": "^7.24.7",
6464
"@codspeed/vitest-plugin": "^3.1.0",
6565
"@rollup/plugin-alias": "^5.1.0",
6666
"@rollup/plugin-commonjs": "^25.0.8",
@@ -70,19 +70,19 @@
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.12",
73+
"@types/node": "^20.14.2",
7474
"@types/semver": "^7.5.8",
7575
"@vitest/coverage-istanbul": "^1.5.2",
7676
"@vue/consolidate": "1.0.0",
7777
"conventional-changelog-cli": "^4.1.0",
7878
"enquirer": "^2.4.1",
79-
"esbuild": "^0.21.4",
79+
"esbuild": "^0.21.5",
8080
"esbuild-plugin-polyfill-node": "^0.3.0",
81-
"eslint": "^9.3.0",
81+
"eslint": "^9.4.0",
8282
"eslint-plugin-import-x": "^0.5.1",
8383
"eslint-plugin-vitest": "^0.5.4",
8484
"estree-walker": "^2.0.2",
85-
"execa": "^8.0.1",
85+
"execa": "^9.2.0",
8686
"jsdom": "^24.0.0",
8787
"lint-staged": "^15.2.5",
8888
"lodash": "^4.17.21",
@@ -92,7 +92,7 @@
9292
"minimist": "^1.2.8",
9393
"npm-run-all2": "^6.2.0",
9494
"picocolors": "^1.0.1",
95-
"prettier": "^3.2.5",
95+
"prettier": "^3.3.1",
9696
"pretty-bytes": "^6.1.1",
9797
"pug": "^3.0.3",
9898
"puppeteer": "~22.7.1",
@@ -104,13 +104,13 @@
104104
"semver": "^7.6.2",
105105
"serve": "^14.2.3",
106106
"simple-git-hooks": "^2.11.1",
107-
"terser": "^5.31.0",
107+
"terser": "^5.31.1",
108108
"todomvc-app-css": "^2.4.3",
109-
"tslib": "^2.6.2",
110-
"tsx": "^4.11.0",
109+
"tslib": "^2.6.3",
110+
"tsx": "^4.15.1",
111111
"typescript": "~5.4.5",
112-
"typescript-eslint": "^7.10.0",
113-
"vite": "^5.2.11",
112+
"typescript-eslint": "^7.12.0",
113+
"vite": "^5.2.13",
114114
"vitest": "^1.5.2"
115115
},
116116
"pnpm": {

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

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
import { ErrorCodes } from '../../src/errors'
1919
import { type CompilerOptions, generate } from '../../src'
2020
import { FRAGMENT, RENDER_LIST, RENDER_SLOT } from '../../src/runtimeHelpers'
21-
import { PatchFlags } from '@vue/shared'
21+
import { PatchFlagNames, PatchFlags } from '@vue/shared'
2222
import { createObjectMatcher, genFlagText } from '../testUtils'
2323

2424
export function parseWithForTransform(
@@ -202,6 +202,18 @@ describe('compiler: v-for', () => {
202202
expect(forNode.valueAlias).toBeUndefined()
203203
expect((forNode.source as SimpleExpressionNode).content).toBe('items')
204204
})
205+
206+
test('source containing string expression with spaces', () => {
207+
const { node: forNode } = parseWithForTransform(
208+
`<span v-for="item in state ['my items']" />`,
209+
)
210+
expect(forNode.keyAlias).toBeUndefined()
211+
expect(forNode.objectIndexAlias).toBeUndefined()
212+
expect((forNode.valueAlias as SimpleExpressionNode).content).toBe('item')
213+
expect((forNode.source as SimpleExpressionNode).content).toBe(
214+
"state ['my items']",
215+
)
216+
})
205217
})
206218

207219
describe('errors', () => {
@@ -253,6 +265,18 @@ describe('compiler: v-for', () => {
253265
)
254266
})
255267

268+
test('missing source and have multiple spaces with', () => {
269+
const onError = vi.fn()
270+
parseWithForTransform('<span v-for="item in " />', { onError })
271+
272+
expect(onError).toHaveBeenCalledTimes(1)
273+
expect(onError).toHaveBeenCalledWith(
274+
expect.objectContaining({
275+
code: ErrorCodes.X_V_FOR_MALFORMED_EXPRESSION,
276+
}),
277+
)
278+
})
279+
256280
test('missing value', () => {
257281
const onError = vi.fn()
258282
parseWithForTransform('<span v-for="in items" />', { onError })
@@ -1019,5 +1043,33 @@ describe('compiler: v-for', () => {
10191043
})
10201044
expect(generate(root).code).toMatchSnapshot()
10211045
})
1046+
1047+
test('template v-for key w/ :key shorthand on div', () => {
1048+
const {
1049+
node: { codegenNode },
1050+
} = parseWithForTransform('<div v-for="key in keys" :key>test</div>')
1051+
expect(codegenNode.patchFlag).toBe(
1052+
`${PatchFlags.KEYED_FRAGMENT} /* ${PatchFlagNames[PatchFlags.KEYED_FRAGMENT]} */`,
1053+
)
1054+
})
1055+
1056+
test('template v-for key w/ :key shorthand on template injected to the child', () => {
1057+
const {
1058+
node: { codegenNode },
1059+
} = parseWithForTransform(
1060+
'<template v-for="key in keys" :key><div>test</div></template>',
1061+
)
1062+
expect(assertSharedCodegen(codegenNode, true)).toMatchObject({
1063+
source: { content: `keys` },
1064+
params: [{ content: `key` }],
1065+
innerVNodeCall: {
1066+
type: NodeTypes.VNODE_CALL,
1067+
tag: `"div"`,
1068+
props: createObjectMatcher({
1069+
key: '[key]',
1070+
}),
1071+
},
1072+
})
1073+
})
10221074
})
10231075
})

0 commit comments

Comments
 (0)