Skip to content

Commit f15ba2c

Browse files
committed
chore: Merge branch 'main' into minor
2 parents 0fd6193 + fd5c001 commit f15ba2c

File tree

103 files changed

+3217
-1553
lines changed

Some content is hidden

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

103 files changed

+3217
-1553
lines changed

.github/contributing.md

+21
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,27 @@ Hi! I'm really excited that you are interested in contributing to Vue.js. Before
1717

1818
## Pull Request Guidelines
1919

20+
### What kinds of Pull Requests are accepted?
21+
22+
- Bug fix that addresses a clearly identified bug. **"Clearly identified bug"** means the bug has a proper reproduction either from a related open issue, or is included in the PR itself. Avoid submitting PRs that claim to fix something but do not sufficiently explain what is being fixed.
23+
24+
- New feature that addresses a clearly explained and widely applicable use case. **"Widely applicable"** means the new feature should provide non-trivial improvements to the majority of the user base. Vue already has a large API surface so we are quite cautious about adding new features - if the use case is niche and can be addressed via userland implementations, it likely isn't suitable to go into core.
25+
26+
The feature implementation should also consider the trade-off between the added complexity vs. the benefits gained. For example, if a small feature requires significant changes that spreads across the codebase, it is likely not worth it, or the approach should be reconsidered.
27+
28+
If the feature has a non-trivial API surface addition, or significantly affects the way a common use case is approached by the users, it should go through a discussion first in the [RFC repo](https://github.com/vuejs/rfcs/discussions). PRs of such features without prior discussion make it really difficult to steer / adjust the API design due to coupling with concrete implementations, and can lead to wasted work.
29+
30+
- Chore: typos, comment improvements, build config, CI config, etc. For typos and comment changes, try to combine multiple of them into a single PR.
31+
32+
- **It should be noted that we discourage contributors from submitting code refactors that are largely stylistic.** Code refactors are only accepted if it improves performance, or comes with sufficient explanations on why it objectively improves the code quality (e.g. makes a related feature implementation easier).
33+
34+
The reason is that code readability is subjective. The maintainers of this project have chosen to write the code in its current style based on our preferences, and we do not want to spend time explaining our stylistic preferences. Contributors should just respect the established conventions when contributing code.
35+
36+
Another aspect of it is that large scale stylistic changes result in massive diffs that touch multiple files, adding noise to the git history and makes tracing behavior changes across commits more cumbersome.
37+
38+
39+
### Pull Request Checklist
40+
2041
- Vue core has two primary work branches: `main` and `minor`.
2142

2243
- If your pull request is a feature that adds new API surface, it should be submitted against the `minor` branch.

.github/renovate.json5

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
},
2929
{
3030
groupName: 'build',
31-
matchPackageNames: ['vite', 'terser'],
31+
matchPackageNames: ['vite', '@swc/core'],
3232
matchPackagePrefixes: ['rollup', 'esbuild', '@rollup', '@vitejs'],
3333
},
3434
{

.github/workflows/autofix.yml

+1-1
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@ea32e3a12414e6d3183163c3424a7d7a8631ad84
34+
- uses: autofix-ci/action@2891949f3779a1cafafae1523058501de3d4e944

.github/workflows/size-data.yml

+10
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,13 @@ jobs:
4141
with:
4242
name: size-data
4343
path: temp/size
44+
45+
- name: Save PR number
46+
if: ${{github.event_name == 'pull_request'}}
47+
run: echo ${{ github.event.number }} > ./pr.txt
48+
49+
- uses: actions/upload-artifact@v4
50+
if: ${{github.event_name == 'pull_request'}}
51+
with:
52+
name: pr-number
53+
path: pr.txt

.github/workflows/size-report.yml

+17-3
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,28 @@ jobs:
3535
- name: Install dependencies
3636
run: pnpm install
3737

38+
- name: Download PR number
39+
uses: dawidd6/action-download-artifact@v6
40+
with:
41+
name: pr-number
42+
run_id: ${{ github.event.workflow_run.id }}
43+
path: /tmp/pr-number
44+
45+
- name: Read PR Number
46+
id: pr-number
47+
uses: juliangruber/read-file-action@v1
48+
with:
49+
path: /tmp/pr-number/pr.txt
50+
3851
- name: Download Size Data
39-
uses: dawidd6/action-download-artifact@v4
52+
uses: dawidd6/action-download-artifact@v6
4053
with:
4154
name: size-data
4255
run_id: ${{ github.event.workflow_run.id }}
4356
path: temp/size
4457

4558
- name: Download Previous Size Data
46-
uses: dawidd6/action-download-artifact@v4
59+
uses: dawidd6/action-download-artifact@v6
4760
with:
4861
branch: main
4962
workflow: size-data.yml
@@ -52,7 +65,7 @@ jobs:
5265
path: temp/size-prev
5366
if_no_artifact_found: warn
5467

55-
- name: Compare size
68+
- name: Prepare report
5669
run: pnpm tsx scripts/size-report.ts > size-report.md
5770

5871
- name: Read Size Report
@@ -65,6 +78,7 @@ jobs:
6578
uses: actions-cool/maintain-one-comment@v3
6679
with:
6780
token: ${{ secrets.GITHUB_TOKEN }}
81+
number: ${{ steps.pr-number.outputs.content }}
6882
body: |
6983
${{ steps.size-report.outputs.content }}
7084
<!-- VUE_CORE_SIZE -->

CHANGELOG.md

+50
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,55 @@
1+
## [3.4.32](https://github.com/vuejs/core/compare/v3.4.31...v3.4.32) (2024-07-17)
2+
3+
4+
### Bug Fixes
5+
6+
* **build:** use consistent minify options from previous terser config ([789675f](https://github.com/vuejs/core/commit/789675f65d2b72cf979ba6a29bd323f716154a4b))
7+
* **compiler-sfc:** correctly resolve type annotation for declared function ([#11279](https://github.com/vuejs/core/issues/11279)) ([b287aee](https://github.com/vuejs/core/commit/b287aeec3ea85f20e4b1fc3d907c901bdc2a0176)), closes [#11266](https://github.com/vuejs/core/issues/11266)
8+
* **defineModel:** force local update when setter results in same emitted value ([de174e1](https://github.com/vuejs/core/commit/de174e1aa756508c7542605a448e55a373afb1ed)), closes [#10279](https://github.com/vuejs/core/issues/10279) [#10301](https://github.com/vuejs/core/issues/10301)
9+
* **hmr:** hmr reload should work with async component ([#11248](https://github.com/vuejs/core/issues/11248)) ([c8b9794](https://github.com/vuejs/core/commit/c8b97945759e869c997d60c3350d2451c5ff7887))
10+
* **hydration:** fix tracking of reactive style objects in production ([c10e40a](https://github.com/vuejs/core/commit/c10e40a217b89ab7e0f7f3515242d4246ecffbdd)), closes [#11372](https://github.com/vuejs/core/issues/11372)
11+
* **hydration:** handle consectuvie text nodes during hydration ([f44c3b3](https://github.com/vuejs/core/commit/f44c3b37d446d5f8e34539029dae0d806b25bb47)), closes [#7285](https://github.com/vuejs/core/issues/7285) [#7301](https://github.com/vuejs/core/issues/7301)
12+
* **reactivity:** ensure `unref` correctly resolves type for `ShallowRef` ([#11360](https://github.com/vuejs/core/issues/11360)) ([a509e30](https://github.com/vuejs/core/commit/a509e30f059fcdd158f39fdf34670b1019eaf2d1)), closes [#11356](https://github.com/vuejs/core/issues/11356)
13+
* **reactivity:** shallowReactive map "unwraps" the nested refs ([#8503](https://github.com/vuejs/core/issues/8503)) ([50ddafe](https://github.com/vuejs/core/commit/50ddafe91b9195cf94124466239f82c9794699fb)), closes [#8501](https://github.com/vuejs/core/issues/8501) [#11249](https://github.com/vuejs/core/issues/11249)
14+
* **runtime-core:** avoid recursive warning ([3ee7b4c](https://github.com/vuejs/core/commit/3ee7b4c7b1374c5bdc50a579b49f6bc15022b085)), closes [#8074](https://github.com/vuejs/core/issues/8074)
15+
* **runtime-core:** bail manually rendered compiler slot fragments in all cases ([3d34f40](https://github.com/vuejs/core/commit/3d34f406ac7497dafd2f4e62ab23579b78a0e08a)), closes [#10870](https://github.com/vuejs/core/issues/10870)
16+
* **runtime-core:** do not emit when defineModel ref is set with same value ([#11162](https://github.com/vuejs/core/issues/11162)) ([f1bb0ae](https://github.com/vuejs/core/commit/f1bb0aef084b5cdd4d49aecfed01ec106d9b6897)), closes [#11125](https://github.com/vuejs/core/issues/11125)
17+
* **runtime-core:** errors during component patch should be caught by error handlers ([ee0248a](https://github.com/vuejs/core/commit/ee0248accff589a94688e177e5e3af10c18288cb))
18+
* **runtime-core:** force diff slot fallback content and provided content ([d76dd9c](https://github.com/vuejs/core/commit/d76dd9c58de24b273bc55af3a8ed81ba693e9683)), closes [#7256](https://github.com/vuejs/core/issues/7256) [#9200](https://github.com/vuejs/core/issues/9200) [#9308](https://github.com/vuejs/core/issues/9308) [#7266](https://github.com/vuejs/core/issues/7266) [#9213](https://github.com/vuejs/core/issues/9213)
19+
* **runtime-core:** more edge case fix for manually rendered compiled slot ([685e3f3](https://github.com/vuejs/core/commit/685e3f381c024b9f4023e60fe0545dc60d90d984)), closes [#11336](https://github.com/vuejs/core/issues/11336)
20+
* **runtime-core:** use separate prop caches for components and mixins ([#11350](https://github.com/vuejs/core/issues/11350)) ([b0aa234](https://github.com/vuejs/core/commit/b0aa234e5e7a611c018de68bc31e0cf55518d5ce)), closes [#7998](https://github.com/vuejs/core/issues/7998)
21+
* **runtime-dom:** properly handle innerHTML unmount into new children ([#11159](https://github.com/vuejs/core/issues/11159)) ([3e9e32e](https://github.com/vuejs/core/commit/3e9e32ee0a6d0fbf67e9098a66ff0a1ea6647806)), closes [#9135](https://github.com/vuejs/core/issues/9135)
22+
* **teleport:** skip teleported nodes when locating patch anchor ([8655ced](https://github.com/vuejs/core/commit/8655ced480ea0fe453ff5fe445cecf97b91ec260)), closes [#9071](https://github.com/vuejs/core/issues/9071) [#9134](https://github.com/vuejs/core/issues/9134) [#9313](https://github.com/vuejs/core/issues/9313) [#9313](https://github.com/vuejs/core/issues/9313)
23+
* **v-model:** component v-model modifiers trim and number when cases don't match ([#9609](https://github.com/vuejs/core/issues/9609)) ([7fb6eb8](https://github.com/vuejs/core/commit/7fb6eb882b64bf99a99d00606e54b0e050674206)), closes [#4848](https://github.com/vuejs/core/issues/4848) [#4850](https://github.com/vuejs/core/issues/4850) [#4850](https://github.com/vuejs/core/issues/4850)
24+
* **v-once:** properly unmount v-once cached trees ([d343a0d](https://github.com/vuejs/core/commit/d343a0dc01663f91db42b4ddb693e6fffcb45873)), closes [#5154](https://github.com/vuejs/core/issues/5154) [#8809](https://github.com/vuejs/core/issues/8809)
25+
26+
27+
### Performance Improvements
28+
29+
* **server-renderer:** avoid unnecessary checks in `createBuffer` ([#11364](https://github.com/vuejs/core/issues/11364)) ([fc205bf](https://github.com/vuejs/core/commit/fc205bf4decde5ce0f4a61394ffa3914b502c287))
30+
* **server-renderer:** optimize `unrollBuffer` by avoiding promises ([#11340](https://github.com/vuejs/core/issues/11340)) ([05779a7](https://github.com/vuejs/core/commit/05779a70bd0b567ae458a07636d229bd07c44c4e))
31+
32+
33+
34+
## [3.4.31](https://github.com/vuejs/core/compare/v3.4.30...v3.4.31) (2024-06-28)
35+
36+
37+
### Bug Fixes
38+
39+
* **compiler-core:** handle inline comments with undefined bindings ([#11217](https://github.com/vuejs/core/issues/11217)) ([746352a](https://github.com/vuejs/core/commit/746352a14d62e9d3d9a38c359d2c54d418c1e0ac)), closes [#11216](https://github.com/vuejs/core/issues/11216)
40+
* **shared:** unwrap refs in toDisplayString ([#7306](https://github.com/vuejs/core/issues/7306)) ([0126cff](https://github.com/vuejs/core/commit/0126cfff9d93bcec70e5745519f6378e3cd3f39c)), closes [#5578](https://github.com/vuejs/core/issues/5578) [#5593](https://github.com/vuejs/core/issues/5593) [#11199](https://github.com/vuejs/core/issues/11199) [#11201](https://github.com/vuejs/core/issues/11201)
41+
42+
43+
### Reverts
44+
45+
* Revert "fix(reactivity): avoid infinite loop when render access a side effect computed ([#11135](https://github.com/vuejs/core/issues/11135))" ([e0df985](https://github.com/vuejs/core/commit/e0df985f0317fb65c5b461bf224375c7763f0269))
46+
* Revert "fix(reactivity): fix side effect computed dirty level (#11183)" ([6c303ea](https://github.com/vuejs/core/commit/6c303eacd14b7b0de0accc228f6abeb43d706f63)), closes [#11183](https://github.com/vuejs/core/issues/11183)
47+
48+
49+
150
## [3.4.30](https://github.com/vuejs/core/compare/v3.4.29...v3.4.30) (2024-06-22)
251

52+
**Note: this release contains a fix (#11150) that requires `vue-tsc` to also be updated in sync to ^2.0.22. See #11196**
353

454
### Bug Fixes
555

package.json

+17-22
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.3.0",
4+
"packageManager": "pnpm@9.5.0",
55
"type": "module",
66
"scripts": {
77
"dev": "node scripts/dev.js",
@@ -59,58 +59,53 @@
5959
"node": ">=18.12.0"
6060
},
6161
"devDependencies": {
62-
"@babel/parser": "^7.24.7",
63-
"@babel/types": "^7.24.7",
64-
"@codspeed/vitest-plugin": "^3.1.0",
62+
"@babel/parser": "catalog:",
63+
"@babel/types": "catalog:",
6564
"@rollup/plugin-alias": "^5.1.0",
66-
"@rollup/plugin-commonjs": "^25.0.8",
65+
"@rollup/plugin-commonjs": "^26.0.1",
6766
"@rollup/plugin-json": "^6.1.0",
6867
"@rollup/plugin-node-resolve": "^15.2.3",
6968
"@rollup/plugin-replace": "5.0.4",
70-
"@swc/core": "^1.6.1",
69+
"@swc/core": "^1.6.13",
7170
"@types/hash-sum": "^1.0.2",
72-
"@types/minimist": "^1.2.5",
73-
"@types/node": "^20.14.2",
71+
"@types/node": "^20.14.10",
7472
"@types/semver": "^7.5.8",
7573
"@vitest/coverage-istanbul": "^1.6.0",
7674
"@vue/consolidate": "1.0.0",
7775
"conventional-changelog-cli": "^4.1.0",
7876
"enquirer": "^2.4.1",
79-
"esbuild": "^0.21.5",
77+
"esbuild": "^0.23.0",
8078
"esbuild-plugin-polyfill-node": "^0.3.0",
81-
"eslint": "^9.5.0",
82-
"eslint-plugin-import-x": "^0.5.1",
79+
"eslint": "^9.6.0",
80+
"eslint-plugin-import-x": "^0.5.3",
8381
"eslint-plugin-vitest": "^0.5.4",
84-
"estree-walker": "^2.0.2",
85-
"execa": "^9.2.0",
82+
"estree-walker": "catalog:",
8683
"jsdom": "^24.1.0",
8784
"lint-staged": "^15.2.7",
8885
"lodash": "^4.17.21",
8986
"magic-string": "^0.30.10",
9087
"markdown-table": "^3.0.3",
9188
"marked": "^12.0.2",
92-
"minimist": "^1.2.8",
93-
"npm-run-all2": "^6.2.0",
89+
"npm-run-all2": "^6.2.2",
9490
"picocolors": "^1.0.1",
9591
"prettier": "^3.3.2",
9692
"pretty-bytes": "^6.1.1",
9793
"pug": "^3.0.3",
98-
"puppeteer": "~22.11.0",
99-
"rimraf": "^5.0.7",
100-
"rollup": "^4.18.0",
94+
"puppeteer": "~22.12.1",
95+
"rimraf": "^5.0.9",
96+
"rollup": "^4.18.1",
10197
"rollup-plugin-dts": "^6.1.1",
10298
"rollup-plugin-esbuild": "^6.1.1",
10399
"rollup-plugin-polyfill-node": "^0.13.0",
104100
"semver": "^7.6.2",
105101
"serve": "^14.2.3",
106102
"simple-git-hooks": "^2.11.1",
107-
"terser": "^5.31.1",
108103
"todomvc-app-css": "^2.4.3",
109104
"tslib": "^2.6.3",
110-
"tsx": "^4.15.5",
105+
"tsx": "^4.16.2",
111106
"typescript": "~5.4.5",
112-
"typescript-eslint": "^7.13.0",
113-
"vite": "^5.3.1",
107+
"typescript-eslint": "^7.15.0",
108+
"vite": "catalog:",
114109
"vitest": "^1.6.0"
115110
},
116111
"pnpm": {

packages/compiler-core/__tests__/__snapshots__/codegen.spec.ts.snap

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ export function render(_ctx, _cache) {
1919
}"
2020
`;
2121

22-
exports[`compiler: codegen > CacheExpression w/ isVNode: true 1`] = `
22+
exports[`compiler: codegen > CacheExpression w/ isVOnce: true 1`] = `
2323
"
2424
export function render(_ctx, _cache) {
2525
return _cache[1] || (
2626
_setBlockTracking(-1),
27-
_cache[1] = foo,
27+
(_cache[1] = foo).cacheIndex = 1,
2828
_setBlockTracking(1),
2929
_cache[1]
3030
)
@@ -54,7 +54,7 @@ return function render(_ctx, _cache) {
5454
[foo + bar]: bar
5555
}, [
5656
_createElementVNode("p", { "some-key": "foo" })
57-
], 16)
57+
], 16 /* FULL_PROPS */)
5858
}
5959
}"
6060
`;
@@ -98,7 +98,7 @@ exports[`compiler: codegen > forNode 1`] = `
9898
"
9999
return function render(_ctx, _cache) {
100100
with (_ctx) {
101-
return (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(), 1))
101+
return (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(), 1 /* TEXT */))
102102
}
103103
}"
104104
`;

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

+14-11
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ describe('compiler: codegen', () => {
267267
disableTracking: true,
268268
props: undefined,
269269
children: createCallExpression(RENDER_LIST),
270-
patchFlag: '1',
270+
patchFlag: PatchFlags.TEXT,
271271
dynamicProps: undefined,
272272
directives: undefined,
273273
loc: locStub,
@@ -303,7 +303,7 @@ describe('compiler: codegen', () => {
303303
disableTracking: false,
304304
props: undefined,
305305
children: createCallExpression(RENDER_LIST),
306-
patchFlag: genFlagText(PatchFlags.STABLE_FRAGMENT),
306+
patchFlag: PatchFlags.STABLE_FRAGMENT,
307307
dynamicProps: undefined,
308308
directives: undefined,
309309
loc: locStub,
@@ -364,7 +364,7 @@ describe('compiler: codegen', () => {
364364
),
365365
],
366366
// flag
367-
PatchFlags.FULL_PROPS + '',
367+
PatchFlags.FULL_PROPS,
368368
),
369369
}),
370370
)
@@ -375,7 +375,7 @@ describe('compiler: codegen', () => {
375375
[foo + bar]: bar
376376
}, [
377377
_${helperNameMap[CREATE_ELEMENT_VNODE]}("p", { "some-key": "foo" })
378-
], ${PatchFlags.FULL_PROPS})`)
378+
], ${genFlagText(PatchFlags.FULL_PROPS)})`)
379379
expect(code).toMatchSnapshot()
380380
})
381381

@@ -437,7 +437,7 @@ describe('compiler: codegen', () => {
437437
expect(code).toMatchSnapshot()
438438
})
439439

440-
test('CacheExpression w/ isVNode: true', () => {
440+
test('CacheExpression w/ isVOnce: true', () => {
441441
const { code } = generate(
442442
createRoot({
443443
cached: [],
@@ -456,7 +456,7 @@ describe('compiler: codegen', () => {
456456
`
457457
_cache[1] || (
458458
_setBlockTracking(-1),
459-
_cache[1] = foo,
459+
(_cache[1] = foo).cacheIndex = 1,
460460
_setBlockTracking(1),
461461
_cache[1]
462462
)
@@ -666,11 +666,14 @@ describe('compiler: codegen', () => {
666666
})
667667

668668
test('with patchFlag and no children/props', () => {
669-
expect(genCode(createVNodeCall(null, `"div"`, undefined, undefined, '1')))
670-
.toMatchInlineSnapshot(`
671-
"return _createElementVNode("div", null, null, 1)
672-
"
673-
`)
669+
expect(
670+
genCode(
671+
createVNodeCall(null, `"div"`, undefined, undefined, PatchFlags.TEXT),
672+
),
673+
).toMatchInlineSnapshot(`
674+
"return _createElementVNode("div", null, null, 1 /* TEXT */)
675+
"
676+
`)
674677
})
675678

676679
test('as block', () => {

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

+2-6
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import { transformFor } from '../src/transforms/vFor'
1919
import { transformElement } from '../src/transforms/transformElement'
2020
import { transformSlotOutlet } from '../src/transforms/transformSlotOutlet'
2121
import { transformText } from '../src/transforms/transformText'
22-
import { genFlagText } from './testUtils'
2322
import { PatchFlags } from '@vue/shared'
2423

2524
describe('compiler: transform', () => {
@@ -358,7 +357,7 @@ describe('compiler: transform', () => {
358357
{ type: NodeTypes.ELEMENT, tag: `div` },
359358
{ type: NodeTypes.ELEMENT, tag: `div` },
360359
] as any,
361-
genFlagText(PatchFlags.STABLE_FRAGMENT),
360+
PatchFlags.STABLE_FRAGMENT,
362361
),
363362
)
364363
})
@@ -374,10 +373,7 @@ describe('compiler: transform', () => {
374373
{ type: NodeTypes.ELEMENT, tag: `div` },
375374
{ type: NodeTypes.COMMENT },
376375
] as any,
377-
genFlagText([
378-
PatchFlags.STABLE_FRAGMENT,
379-
PatchFlags.DEV_ROOT_FRAGMENT,
380-
]),
376+
PatchFlags.STABLE_FRAGMENT | PatchFlags.DEV_ROOT_FRAGMENT,
381377
),
382378
)
383379
})

0 commit comments

Comments
 (0)