Skip to content

Commit 6ebdd91

Browse files
authored
Merge branch 'main' into fix/vuejs#10042
2 parents b97abd9 + fef2acb commit 6ebdd91

File tree

83 files changed

+1683
-886
lines changed

Some content is hidden

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

83 files changed

+1683
-886
lines changed

.github/renovate.json5

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,13 @@
4646

4747
// ESM only
4848
'estree-walker',
49+
50+
// pinned
51+
// https://github.com/vuejs/core/issues/10300#issuecomment-1940855364
52+
'lru-cache',
53+
54+
// pinned
55+
// https://github.com/vuejs/core/commit/a012e39b373f1b6918e5c89856e8f902e1bfa14d
56+
'@rollup/plugin-replace',
4957
],
5058
}

.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@v2
17+
uses: pnpm/action-setup@v3.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@v2
20+
uses: pnpm/action-setup@v3.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@v2
18+
uses: pnpm/action-setup@v3.0.0
1919

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

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- uses: actions/checkout@v4
2121

2222
- name: Install pnpm
23-
uses: pnpm/action-setup@v2
23+
uses: pnpm/action-setup@v3.0.0
2424

2525
- name: Install Node.js
2626
uses: actions/setup-node@v4
@@ -42,7 +42,7 @@ jobs:
4242
- uses: actions/checkout@v4
4343

4444
- name: Install pnpm
45-
uses: pnpm/action-setup@v2
45+
uses: pnpm/action-setup@v3.0.0
4646

4747
- name: Install Node.js
4848
uses: actions/setup-node@v4
@@ -65,13 +65,13 @@ jobs:
6565
- uses: actions/checkout@v4
6666

6767
- name: Setup cache for Chromium binary
68-
uses: actions/cache@v3
68+
uses: actions/cache@v4
6969
with:
7070
path: ~/.cache/puppeteer
7171
key: chromium-${{ hashFiles('pnpm-lock.yaml') }}
7272

7373
- name: Install pnpm
74-
uses: pnpm/action-setup@v2
74+
uses: pnpm/action-setup@v3.0.0
7575

7676
- name: Install Node.js
7777
uses: actions/setup-node@v4
@@ -97,7 +97,7 @@ jobs:
9797
- uses: actions/checkout@v4
9898

9999
- name: Install pnpm
100-
uses: pnpm/action-setup@v2
100+
uses: pnpm/action-setup@v3.0.0
101101

102102
- name: Install Node.js
103103
uses: actions/setup-node@v4
@@ -125,7 +125,7 @@ jobs:
125125
# - uses: actions/checkout@v4
126126

127127
# - name: Install pnpm
128-
# uses: pnpm/action-setup@v2
128+
# uses: pnpm/action-setup@v3.0.0
129129

130130
# - name: Install Node.js
131131
# uses: actions/setup-node@v4

.github/workflows/size-data.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- uses: actions/checkout@v4
2323

2424
- name: Install pnpm
25-
uses: pnpm/action-setup@v2
25+
uses: pnpm/action-setup@v3.0.0
2626

2727
- name: Install Node.js
2828
uses: actions/setup-node@v4
@@ -36,7 +36,7 @@ jobs:
3636
- run: pnpm run size
3737

3838
- name: Upload Size Data
39-
uses: actions/upload-artifact@v3
39+
uses: actions/upload-artifact@v4
4040
with:
4141
name: size-data
4242
path: temp/size
@@ -45,7 +45,7 @@ jobs:
4545
if: ${{github.event_name == 'pull_request'}}
4646
run: echo ${{ github.event.number }} > ./pr.txt
4747

48-
- uses: actions/upload-artifact@v3
48+
- uses: actions/upload-artifact@v4
4949
if: ${{github.event_name == 'pull_request'}}
5050
with:
5151
name: pr-number

.github/workflows/size-report.yml

Lines changed: 4 additions & 4 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@v2
27+
uses: pnpm/action-setup@v3.0.0
2828

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

3838
- name: Download PR number
39-
uses: dawidd6/action-download-artifact@v2
39+
uses: dawidd6/action-download-artifact@v3
4040
with:
4141
name: pr-number
4242
run_id: ${{ github.event.workflow_run.id }}
@@ -48,14 +48,14 @@ jobs:
4848
path: ./pr.txt
4949

5050
- name: Download Size Data
51-
uses: dawidd6/action-download-artifact@v2
51+
uses: dawidd6/action-download-artifact@v3
5252
with:
5353
name: size-data
5454
run_id: ${{ github.event.workflow_run.id }}
5555
path: temp/size
5656

5757
- name: Download Previous Size Data
58-
uses: dawidd6/action-download-artifact@v2
58+
uses: dawidd6/action-download-artifact@v3
5959
with:
6060
branch: main
6161
workflow: size-data.yml

CHANGELOG.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,94 @@
1+
## [3.4.21](https://github.com/vuejs/core/compare/v3.4.20...v3.4.21) (2024-02-28)
2+
3+
4+
### Bug Fixes
5+
6+
* **runtime-dom:** avoid unset option's value ([#10416](https://github.com/vuejs/core/issues/10416)) ([b3f8b5a](https://github.com/vuejs/core/commit/b3f8b5a4e700d4c47a146b6040882287d180f6cb)), closes [#10412](https://github.com/vuejs/core/issues/10412) [#10396](https://github.com/vuejs/core/issues/10396)
7+
* **suspense:** ensure nested suspense patching if in fallback state ([#10417](https://github.com/vuejs/core/issues/10417)) ([7c97778](https://github.com/vuejs/core/commit/7c97778aec1e3513035e5df265e1b8a7801f6106)), closes [#10415](https://github.com/vuejs/core/issues/10415)
8+
* **warning:** stringify args in warn handler ([#10414](https://github.com/vuejs/core/issues/10414)) ([bc37258](https://github.com/vuejs/core/commit/bc37258caa2f6f67f4554ab8587aca3798d92124)), closes [#10409](https://github.com/vuejs/core/issues/10409)
9+
10+
11+
12+
## [3.4.20](https://github.com/vuejs/core/compare/v3.4.19...v3.4.20) (2024-02-26)
13+
14+
15+
### Bug Fixes
16+
17+
* **parser:** should not treat uppercase components as special tags ([e0e0253](https://github.com/vuejs/core/commit/e0e02535cdea1aeb1cfaff0d61d4b2555e555c36)), closes [#10395](https://github.com/vuejs/core/issues/10395)
18+
* **runtime-dom:** avoid always resetting nullish option value ([ff130c4](https://github.com/vuejs/core/commit/ff130c470204086edaa093fb8fdc1247c69cba69)), closes [#10396](https://github.com/vuejs/core/issues/10396)
19+
* **runtime-dom:** fix nested v-show priority regression ([364f890](https://github.com/vuejs/core/commit/364f8902c8657faec7c3a4d70a5b2c856567e92d)), closes [#10338](https://github.com/vuejs/core/issues/10338)
20+
* **runtime-dom:** v-bind style should clear previous css string value ([#10373](https://github.com/vuejs/core/issues/10373)) ([e2d3235](https://github.com/vuejs/core/commit/e2d323538e71d404e729148fd19a08bbc2e3da9b)), closes [#10352](https://github.com/vuejs/core/issues/10352)
21+
* **suspense:** handle suspense switching with nested suspense ([#10184](https://github.com/vuejs/core/issues/10184)) ([0f3da05](https://github.com/vuejs/core/commit/0f3da05ea201761529bb95594df1e2cee20b7107)), closes [#10098](https://github.com/vuejs/core/issues/10098)
22+
* **types:** better typing for direct setup signature of defineComponent ([#10357](https://github.com/vuejs/core/issues/10357)) ([eadce5b](https://github.com/vuejs/core/commit/eadce5b75356656fd2209ebdb406d34823c961b7)), closes [#8604](https://github.com/vuejs/core/issues/8604) [#8855](https://github.com/vuejs/core/issues/8855)
23+
24+
25+
26+
## [3.4.19](https://github.com/vuejs/core/compare/v3.4.18...v3.4.19) (2024-02-13)
27+
28+
29+
### Bug Fixes
30+
31+
* **deps:** pin lru-cache to avoid hashing error ([b8be990](https://github.com/vuejs/core/commit/b8be99018ceae92d1732dfb414df12b36b90b31f)), closes [#10300](https://github.com/vuejs/core/issues/10300)
32+
* **hydration:** fix css vars hydration mismatch false positive on non-root nodes ([995d2fd](https://github.com/vuejs/core/commit/995d2fdcca485c24849c99f498c1edc163722e04)), closes [#10317](https://github.com/vuejs/core/issues/10317) [#10325](https://github.com/vuejs/core/issues/10325)
33+
* **runtime-dom:** should not trigger transition when v-show value is falsy ([#10311](https://github.com/vuejs/core/issues/10311)) ([e509639](https://github.com/vuejs/core/commit/e50963903d93a7f24003b6e2c03647fdf7454b1e))
34+
35+
36+
### Features
37+
38+
> Note: this warning is categorized as a feature but released in a patch because it does not affect public APIs.
39+
40+
* **dx:** warn users when computed is self-triggering ([#10299](https://github.com/vuejs/core/issues/10299)) ([f7ba97f](https://github.com/vuejs/core/commit/f7ba97f9754a9882c1f6b1c07ca1a4040479dd13))
41+
42+
43+
### Performance Improvements
44+
45+
* **runtime:** improve `getType()` GC and speed ([#10327](https://github.com/vuejs/core/issues/10327)) ([603a1e1](https://github.com/vuejs/core/commit/603a1e1f5ad587c077f0d974c1bbe856be22ebe9))
46+
47+
48+
49+
## [3.4.18](https://github.com/vuejs/core/compare/v3.4.17...v3.4.18) (2024-02-09)
50+
51+
52+
### Bug Fixes
53+
54+
* **dx:** warn against reserved keys as prop name ([77a804b](https://github.com/vuejs/core/commit/77a804b1d0d6a3f12fb3674cdceb85ebd6481e02)), closes [#10281](https://github.com/vuejs/core/issues/10281)
55+
* **runtime-dom:** ensure v-show respects display value set via v-bind ([#10297](https://github.com/vuejs/core/issues/10297)) ([c224897](https://github.com/vuejs/core/commit/c224897dd4e189a10ec601a97fe08cb638ebee19)), closes [#10151](https://github.com/vuejs/core/issues/10151)
56+
57+
58+
59+
## [3.4.17](https://github.com/vuejs/core/compare/v3.4.16...v3.4.17) (2024-02-09)
60+
61+
62+
### Reverts
63+
64+
* fix(runtime-dom): ensure v-show respects display value set via v-bind ([#10161](https://github.com/vuejs/core/issues/10161)) ([2cd5b05](https://github.com/vuejs/core/commit/2cd5b05c3bf171be5c0b473c084c01704a058ffa)), closes [#10294](https://github.com/vuejs/core/issues/10294) [#10151](https://github.com/vuejs/core/issues/10151)
65+
66+
67+
68+
## [3.4.16](https://github.com/vuejs/core/compare/v3.4.15...v3.4.16) (2024-02-08)
69+
70+
71+
### Bug Fixes
72+
73+
* **compiler-core:** handle same-name shorthand edge case for in-DOM templates ([cb87b62](https://github.com/vuejs/core/commit/cb87b6213d7b003fa7280712c285c7c9d9f291ca)), closes [#10280](https://github.com/vuejs/core/issues/10280)
74+
* **compiler-core:** support v-bind shorthand syntax for dynamic slot name ([#10218](https://github.com/vuejs/core/issues/10218)) ([91f058a](https://github.com/vuejs/core/commit/91f058a90cd603492649633d153b120977c4df6b)), closes [#10213](https://github.com/vuejs/core/issues/10213)
75+
* **deps:** update compiler ([#10269](https://github.com/vuejs/core/issues/10269)) ([336bb65](https://github.com/vuejs/core/commit/336bb65820243006efdf990e6ea3610696467508))
76+
* **hydration:** fix SFC style v-bind hydration mismatch warnings ([#10250](https://github.com/vuejs/core/issues/10250)) ([f0b5f7e](https://github.com/vuejs/core/commit/f0b5f7ed8ddf74f9f5ba47cb65e8300370875291)), closes [#10215](https://github.com/vuejs/core/issues/10215)
77+
* **reactivity:** avoid infinite recursion from side effects in computed getter ([#10232](https://github.com/vuejs/core/issues/10232)) ([0bced13](https://github.com/vuejs/core/commit/0bced13ee5c53a02d5f10e5db76fe38b6e131440)), closes [#10214](https://github.com/vuejs/core/issues/10214)
78+
* **reactivity:** handle `MaybeDirty` recurse ([#10187](https://github.com/vuejs/core/issues/10187)) ([6c7e0bd](https://github.com/vuejs/core/commit/6c7e0bd88f021b0b6365370e97b0c7e243d7d70b)), closes [#10185](https://github.com/vuejs/core/issues/10185)
79+
* **reactivity:** skip non-extensible objects when using `markRaw` ([#10289](https://github.com/vuejs/core/issues/10289)) ([2312184](https://github.com/vuejs/core/commit/2312184bc335e0d32aa4c0c0b49190b6334849b4)), closes [#10288](https://github.com/vuejs/core/issues/10288)
80+
* **runtime-core:** avoid inlining isShallow ([#10238](https://github.com/vuejs/core/issues/10238)) ([53eee72](https://github.com/vuejs/core/commit/53eee72c3a96420db35236b5e8e4d9308a56e1b4))
81+
* **runtime-core:** support for nested calls to runWithContext ([#10261](https://github.com/vuejs/core/issues/10261)) ([75e02b5](https://github.com/vuejs/core/commit/75e02b5099a08166bdf407127916734c48209ee9)), closes [#10260](https://github.com/vuejs/core/issues/10260)
82+
* **runtime-dom:** ensure v-show respects display value set via v-bind ([#10161](https://github.com/vuejs/core/issues/10161)) ([9b19f09](https://github.com/vuejs/core/commit/9b19f0912104bfccb10c8cf5beab02b21a648935)), closes [#10151](https://github.com/vuejs/core/issues/10151)
83+
* **runtime-dom:** fix option selected update failed ([#10200](https://github.com/vuejs/core/issues/10200)) ([f31d782](https://github.com/vuejs/core/commit/f31d782e4668050a188ac0f11ba8d5b861b913ca)), closes [#10194](https://github.com/vuejs/core/issues/10194) [#10267](https://github.com/vuejs/core/issues/10267)
84+
85+
86+
### Reverts
87+
88+
* perf(templateRef): avoid double render when using template ref on v-for ([eb1b911](https://github.com/vuejs/core/commit/eb1b9116d7cd4a5747e8dadcdc5ba921df011f64)), closes [#9908](https://github.com/vuejs/core/issues/9908) [#10210](https://github.com/vuejs/core/issues/10210) [#10234](https://github.com/vuejs/core/issues/10234)
89+
90+
91+
192
## [3.4.15](https://github.com/vuejs/core/compare/v3.4.14...v3.4.15) (2024-01-18)
293

394

changelogs/CHANGELOG-3.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ may cause build issues in projects still using TS 3.x.
773773
- **types:** adjust type exports for manual render function and tooling usage ([e4dc03a](https://github.com/vuejs/core/commit/e4dc03a8b17d5e9f167de6a62a645878ac7ef3e2)), closes [#1329](https://github.com/vuejs/core/issues/1329)
774774
- **types:** mixins/extends support in TypeScript ([#626](https://github.com/vuejs/core/issues/626)) ([d3c436a](https://github.com/vuejs/core/commit/d3c436ae2e66b75b7f2ed574dadda3f0e1fdce73))
775775
- **types:** support typing directive value via generic argument ([#1007](https://github.com/vuejs/core/issues/1007)) ([419b86d](https://github.com/vuejs/core/commit/419b86d1908f2a0521e6a7eafcbee764e9ee59a0)), closes [#998](https://github.com/vuejs/core/issues/998)
776-
- **types:** update to Typescript 3.9 ([#1106](https://github.com/vuejs/core/issues/1106)) ([97dedeb](https://github.com/vuejs/core/commit/97dedebd8097116a16209664a1ca38392b964da3))
776+
- **types:** update to TypeScript 3.9 ([#1106](https://github.com/vuejs/core/issues/1106)) ([97dedeb](https://github.com/vuejs/core/commit/97dedebd8097116a16209664a1ca38392b964da3))
777777

778778
### Performance Improvements
779779

package.json

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
3-
"version": "3.4.15",
4-
"packageManager": "[email protected].1",
3+
"version": "3.4.21",
4+
"packageManager": "[email protected].4",
55
"type": "module",
66
"scripts": {
77
"dev": "node scripts/dev.js",
@@ -70,49 +70,49 @@
7070
"@rollup/plugin-terser": "^0.4.4",
7171
"@types/hash-sum": "^1.0.2",
7272
"@types/minimist": "^1.2.5",
73-
"@types/node": "^20.11.16",
74-
"@types/semver": "^7.5.6",
75-
"@typescript-eslint/eslint-plugin": "^6.18.1",
76-
"@typescript-eslint/parser": "^6.18.1",
77-
"@vitest/coverage-istanbul": "^1.2.2",
78-
"@vue/consolidate": "0.17.3",
73+
"@types/node": "^20.11.20",
74+
"@types/semver": "^7.5.8",
75+
"@typescript-eslint/eslint-plugin": "^7.0.2",
76+
"@typescript-eslint/parser": "^7.0.2",
77+
"@vitest/coverage-istanbul": "^1.3.1",
78+
"@vue/consolidate": "1.0.0",
7979
"conventional-changelog-cli": "^4.1.0",
8080
"enquirer": "^2.4.1",
81-
"esbuild": "^0.20.0",
81+
"esbuild": "^0.20.1",
8282
"esbuild-plugin-polyfill-node": "^0.3.0",
83-
"eslint": "^8.56.0",
84-
"eslint-define-config": "^1.24.1",
83+
"eslint": "^8.57.0",
84+
"eslint-define-config": "^2.1.0",
8585
"eslint-plugin-import": "npm:eslint-plugin-i@^2.29.1",
86-
"eslint-plugin-jest": "^27.6.3",
86+
"eslint-plugin-jest": "^27.9.0",
8787
"estree-walker": "^2.0.2",
8888
"execa": "^8.0.1",
89-
"jsdom": "^23.2.0",
90-
"lint-staged": "^15.2.0",
89+
"jsdom": "^24.0.0",
90+
"lint-staged": "^15.2.2",
9191
"lodash": "^4.17.21",
92-
"magic-string": "^0.30.6",
92+
"magic-string": "^0.30.7",
9393
"markdown-table": "^3.0.3",
94-
"marked": "^11.2.0",
94+
"marked": "^12.0.0",
9595
"minimist": "^1.2.8",
96-
"npm-run-all2": "^5.0.2",
96+
"npm-run-all2": "^6.1.2",
9797
"picocolors": "^1.0.0",
98-
"prettier": "^3.2.2",
98+
"prettier": "^3.2.5",
9999
"pretty-bytes": "^6.1.1",
100100
"pug": "^3.0.2",
101-
"puppeteer": "~21.11.0",
101+
"puppeteer": "~22.2.0",
102102
"rimraf": "^5.0.5",
103-
"rollup": "4.9.2",
103+
"rollup": "^4.12.0",
104104
"rollup-plugin-dts": "^6.1.0",
105105
"rollup-plugin-esbuild": "^6.1.1",
106106
"rollup-plugin-polyfill-node": "^0.13.0",
107-
"semver": "^7.5.4",
107+
"semver": "^7.6.0",
108108
"serve": "^14.2.1",
109109
"simple-git-hooks": "^2.9.0",
110-
"terser": "^5.27.0",
110+
"terser": "^5.28.1",
111111
"todomvc-app-css": "^2.4.3",
112112
"tslib": "^2.6.2",
113-
"tsx": "^4.7.0",
113+
"tsx": "^4.7.1",
114114
"typescript": "^5.2.2",
115-
"vite": "^5.0.12",
116-
"vitest": "^1.2.2"
115+
"vite": "^5.1.4",
116+
"vitest": "^1.3.1"
117117
}
118118
}

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,4 +389,20 @@ describe('compiler: transform <slot> outlets', () => {
389389
},
390390
})
391391
})
392+
393+
test('dynamically named slot outlet with v-bind shorthand', () => {
394+
const ast = parseWithSlots(`<slot :name />`)
395+
expect((ast.children[0] as ElementNode).codegenNode).toMatchObject({
396+
type: NodeTypes.JS_CALL_EXPRESSION,
397+
callee: RENDER_SLOT,
398+
arguments: [
399+
`$slots`,
400+
{
401+
type: NodeTypes.SIMPLE_EXPRESSION,
402+
content: `name`,
403+
isStatic: false,
404+
},
405+
],
406+
})
407+
})
392408
})

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,4 +408,22 @@ describe('compiler: transform v-bind', () => {
408408
},
409409
})
410410
})
411+
412+
test('error on invalid argument for same-name shorthand', () => {
413+
const onError = vi.fn()
414+
parseWithVBind(`<div v-bind:[arg] />`, { onError })
415+
expect(onError.mock.calls[0][0]).toMatchObject({
416+
code: ErrorCodes.X_V_BIND_INVALID_SAME_NAME_ARGUMENT,
417+
loc: {
418+
start: {
419+
line: 1,
420+
column: 13,
421+
},
422+
end: {
423+
line: 1,
424+
column: 18,
425+
},
426+
},
427+
})
428+
})
411429
})

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ describe('compiler: transform v-on', () => {
271271
})
272272
})
273273

274-
test('should NOT wrap as function if expression is already function expression (with Typescript)', () => {
274+
test('should NOT wrap as function if expression is already function expression (with TypeScript)', () => {
275275
const { node } = parseWithVOn(`<div @click="(e: any): any => foo(e)"/>`)
276276
expect((node.codegenNode as VNodeCall).props).toMatchObject({
277277
properties: [

0 commit comments

Comments
 (0)