Skip to content

Commit b3f45d2

Browse files
committed
chore: merge branch 'minor' into feat/onEffectCleanup-and-baseWatch
2 parents 60a1b97 + 9a936aa commit b3f45d2

File tree

145 files changed

+6087
-3556
lines changed

Some content is hidden

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

145 files changed

+6087
-3556
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/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ 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') }}

.github/workflows/size-data.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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: 201 additions & 0 deletions
Large diffs are not rendered by default.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2018-present, Yuxi (Evan) You
3+
Copyright (c) 2018-present, Yuxi (Evan) You and Vue contributors
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

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: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
3-
"version": "3.4.5",
4-
"packageManager": "pnpm@8.14.0",
3+
"version": "3.4.20",
4+
"packageManager": "pnpm@8.15.4",
55
"type": "module",
66
"scripts": {
77
"dev": "node scripts/dev.js",
@@ -59,60 +59,60 @@
5959
"node": ">=18.12.0"
6060
},
6161
"devDependencies": {
62-
"@babel/parser": "^7.23.6",
63-
"@babel/types": "^7.23.6",
62+
"@babel/parser": "^7.23.9",
63+
"@babel/types": "^7.23.9",
6464
"@codspeed/vitest-plugin": "^2.3.1",
65-
"@rollup/plugin-alias": "^5.0.1",
65+
"@rollup/plugin-alias": "^5.1.0",
6666
"@rollup/plugin-commonjs": "^25.0.7",
67-
"@rollup/plugin-json": "^6.0.1",
67+
"@rollup/plugin-json": "^6.1.0",
6868
"@rollup/plugin-node-resolve": "^15.2.3",
69-
"@rollup/plugin-replace": "^5.0.4",
69+
"@rollup/plugin-replace": "5.0.4",
7070
"@rollup/plugin-terser": "^0.4.4",
7171
"@types/hash-sum": "^1.0.2",
7272
"@types/minimist": "^1.2.5",
73-
"@types/node": "^20.10.7",
74-
"@types/semver": "^7.5.6",
75-
"@typescript-eslint/eslint-plugin": "^6.17.0",
76-
"@typescript-eslint/parser": "^6.17.0",
77-
"@vitest/coverage-istanbul": "^1.1.3",
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.19.5",
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.1",
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.5",
92+
"magic-string": "^0.30.7",
9393
"markdown-table": "^3.0.3",
94-
"marked": "^11.1.1",
94+
"marked": "^12.0.0",
9595
"minimist": "^1.2.8",
96-
"npm-run-all": "^4.1.5",
96+
"npm-run-all2": "^6.1.2",
9797
"picocolors": "^1.0.0",
98-
"prettier": "^3.1.1",
98+
"prettier": "^3.2.5",
9999
"pretty-bytes": "^6.1.1",
100100
"pug": "^3.0.2",
101-
"puppeteer": "~21.7.0",
101+
"puppeteer": "~22.2.0",
102102
"rimraf": "^5.0.5",
103-
"rollup": "^4.1.4",
103+
"rollup": "^4.12.0",
104104
"rollup-plugin-dts": "^6.1.0",
105-
"rollup-plugin-esbuild": "^6.1.0",
106-
"rollup-plugin-polyfill-node": "^0.12.0",
107-
"semver": "^7.5.4",
105+
"rollup-plugin-esbuild": "^6.1.1",
106+
"rollup-plugin-polyfill-node": "^0.13.0",
107+
"semver": "^7.6.0",
108108
"serve": "^14.2.1",
109109
"simple-git-hooks": "^2.9.0",
110-
"terser": "^5.22.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.5",
116-
"vitest": "^1.1.3"
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: [

packages/compiler-core/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/compiler-core",
3-
"version": "3.4.5",
3+
"version": "3.4.20",
44
"description": "@vue/compiler-core",
55
"main": "index.js",
66
"module": "dist/compiler-core.esm-bundler.js",
@@ -17,6 +17,7 @@
1717
"development": "./dist/compiler-core.cjs.js",
1818
"default": "./index.js"
1919
},
20+
"module": "./dist/compiler-core.esm-bundler.js",
2021
"import": "./dist/compiler-core.esm-bundler.js",
2122
"require": "./index.js"
2223
},
@@ -45,13 +46,13 @@
4546
},
4647
"homepage": "https://github.com/vuejs/core/tree/main/packages/compiler-core#readme",
4748
"dependencies": {
48-
"@babel/parser": "^7.23.6",
49+
"@babel/parser": "^7.23.9",
4950
"@vue/shared": "workspace:*",
5051
"entities": "^4.5.0",
5152
"estree-walker": "^2.0.2",
5253
"source-map-js": "^1.0.2"
5354
},
5455
"devDependencies": {
55-
"@babel/types": "^7.23.6"
56+
"@babel/types": "^7.23.9"
5657
}
5758
}

packages/compiler-core/src/babelUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export function walkIdentifiers(
5050
}
5151
} else if (
5252
node.type === 'ObjectProperty' &&
53-
parent!.type === 'ObjectPattern'
53+
parent?.type === 'ObjectPattern'
5454
) {
5555
// mark property in destructure pattern
5656
;(node as any).inPattern = true

packages/compiler-core/src/errors.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export function createCompilerError<T extends number>(
3030
const msg =
3131
__DEV__ || !__BROWSER__
3232
? (messages || errorMessages)[code] + (additionalMessage || ``)
33-
: `https://vuejs.org/errors/#compiler-${code}`
33+
: `https://vuejs.org/error-reference/#compiler-${code}`
3434
const error = new SyntaxError(String(msg)) as InferCompilerError<T>
3535
error.code = code
3636
error.loc = loc
@@ -98,6 +98,10 @@ export enum ErrorCodes {
9898
X_SCOPE_ID_NOT_SUPPORTED,
9999
X_VNODE_HOOKS,
100100

101+
// placed here to preserve order for the current minor
102+
// TODO adjust order in 3.5
103+
X_V_BIND_INVALID_SAME_NAME_ARGUMENT,
104+
101105
// Special value for higher-order compilers to pick up the last code
102106
// to avoid collision of error codes. This should always be kept as the last
103107
// item.
@@ -156,6 +160,7 @@ export const errorMessages: Record<ErrorCodes, string> = {
156160
[ErrorCodes.X_V_FOR_MALFORMED_EXPRESSION]: `v-for has invalid expression.`,
157161
[ErrorCodes.X_V_FOR_TEMPLATE_KEY_PLACEMENT]: `<template v-for> key should be placed on the <template> tag.`,
158162
[ErrorCodes.X_V_BIND_NO_EXPRESSION]: `v-bind is missing expression.`,
163+
[ErrorCodes.X_V_BIND_INVALID_SAME_NAME_ARGUMENT]: `v-bind with same-name shorthand only allows static argument.`,
159164
[ErrorCodes.X_V_ON_NO_EXPRESSION]: `v-on is missing expression.`,
160165
[ErrorCodes.X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET]: `Unexpected custom directive on <slot> outlet.`,
161166
[ErrorCodes.X_V_SLOT_MIXED_SLOT_USAGE]:

packages/compiler-core/src/parser.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -692,6 +692,7 @@ function onCloseTag(el: ElementNode, end: number, isImplied = false) {
692692
}
693693

694694
if (
695+
!tokenizer.inSFCRoot &&
695696
isCompatEnabled(
696697
CompilerDeprecationTypes.COMPILER_NATIVE_TEMPLATE,
697698
currentOptions,

packages/compiler-core/src/tokenizer.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -553,12 +553,11 @@ export default class Tokenizer {
553553
// HTML mode
554554
// - <script>, <style> RAWTEXT
555555
// - <title>, <textarea> RCDATA
556-
const lower = c | 0x20
557-
if (lower === 116 /* t */) {
556+
if (c === 116 /* t */) {
558557
this.state = State.BeforeSpecialT
559558
} else {
560559
this.state =
561-
lower === 115 /* s */ ? State.BeforeSpecialS : State.InTagName
560+
c === 115 /* s */ ? State.BeforeSpecialS : State.InTagName
562561
}
563562
} else {
564563
this.state = State.InTagName
@@ -862,21 +861,19 @@ export default class Tokenizer {
862861
}
863862
}
864863
private stateBeforeSpecialS(c: number): void {
865-
const lower = c | 0x20
866-
if (lower === Sequences.ScriptEnd[3]) {
864+
if (c === Sequences.ScriptEnd[3]) {
867865
this.startSpecial(Sequences.ScriptEnd, 4)
868-
} else if (lower === Sequences.StyleEnd[3]) {
866+
} else if (c === Sequences.StyleEnd[3]) {
869867
this.startSpecial(Sequences.StyleEnd, 4)
870868
} else {
871869
this.state = State.InTagName
872870
this.stateInTagName(c) // Consume the token again
873871
}
874872
}
875873
private stateBeforeSpecialT(c: number): void {
876-
const lower = c | 0x20
877-
if (lower === Sequences.TitleEnd[3]) {
874+
if (c === Sequences.TitleEnd[3]) {
878875
this.startSpecial(Sequences.TitleEnd, 4)
879-
} else if (lower === Sequences.TextareaEnd[3]) {
876+
} else if (c === Sequences.TextareaEnd[3]) {
880877
this.startSpecial(Sequences.TextareaEnd, 4)
881878
} else {
882879
this.state = State.InTagName

packages/compiler-core/src/transform.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ export function createTransformContext(
256256
}
257257
context.parent!.children.splice(removalIndex, 1)
258258
},
259-
onNodeRemoved: () => {},
259+
onNodeRemoved: NOOP,
260260
addIdentifiers(exp) {
261261
// identifier tracking only happens in non-browser builds.
262262
if (!__BROWSER__) {

packages/compiler-core/src/transforms/transformSlotOutlet.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@ import {
66
type SlotOutletNode,
77
createCallExpression,
88
createFunctionExpression,
9+
createSimpleExpression,
910
} from '../ast'
1011
import { isSlotOutlet, isStaticArgOf, isStaticExp } from '../utils'
1112
import { type PropsExpression, buildProps } from './transformElement'
1213
import { ErrorCodes, createCompilerError } from '../errors'
1314
import { RENDER_SLOT } from '../runtimeHelpers'
1415
import { camelize } from '@vue/shared'
16+
import { processExpression } from './transformExpression'
1517

1618
export const transformSlotOutlet: NodeTransform = (node, context) => {
1719
if (isSlotOutlet(node)) {
@@ -76,7 +78,15 @@ export function processSlotOutlet(
7678
}
7779
} else {
7880
if (p.name === 'bind' && isStaticArgOf(p.arg, 'name')) {
79-
if (p.exp) slotName = p.exp
81+
if (p.exp) {
82+
slotName = p.exp
83+
} else if (p.arg && p.arg.type === NodeTypes.SIMPLE_EXPRESSION) {
84+
const name = camelize(p.arg.content)
85+
slotName = p.exp = createSimpleExpression(name, false, p.arg.loc)
86+
if (!__BROWSER__) {
87+
slotName = p.exp = processExpression(p.exp, context)
88+
}
89+
}
8090
} else {
8191
if (p.name === 'bind' && p.arg && isStaticExp(p.arg)) {
8292
p.arg.content = camelize(p.arg.content)

0 commit comments

Comments
 (0)