Skip to content

Commit ff6a6b0

Browse files
authored
Merge branch 'vuejs:main' into fix/nested-transitiongroup
2 parents dcc93a8 + 9a36f2a commit ff6a6b0

File tree

189 files changed

+3684
-1694
lines changed

Some content is hidden

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

189 files changed

+3684
-1694
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
uses: ./.github/workflows/test.yml
1717

1818
continuous-release:
19+
if: github.repository == 'vuejs/core'
1920
runs-on: ubuntu-latest
2021
steps:
2122
- name: Checkout

.github/workflows/size-data.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ env:
1818

1919
jobs:
2020
upload:
21+
if: github.repository == 'vuejs/core'
2122
runs-on: ubuntu-latest
2223

2324
steps:

.github/workflows/size-report.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
size-report:
1919
runs-on: ubuntu-latest
2020
if: >
21+
github.repository == 'vuejs/core' &&
2122
github.event.workflow_run.event == 'pull_request' &&
2223
github.event.workflow_run.conclusion == 'success'
2324
steps:
@@ -65,7 +66,7 @@ jobs:
6566
if_no_artifact_found: warn
6667

6768
- name: Prepare report
68-
run: pnpm tsx scripts/size-report.ts > size-report.md
69+
run: node scripts/size-report.js > size-report.md
6970

7071
- name: Read Size Report
7172
id: size-report

CHANGELOG.md

Lines changed: 192 additions & 0 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"private": true,
3-
"version": "3.5.0-beta.3",
4-
"packageManager": "pnpm@9.7.1",
3+
"version": "3.5.6",
4+
"packageManager": "pnpm@9.10.0",
55
"type": "module",
66
"scripts": {
77
"dev": "node scripts/dev.js",
88
"build": "node scripts/build.js",
9-
"build-dts": "tsc -p tsconfig.build-browser.json && tsc -p tsconfig.build-node.json && rollup -c rollup.dts.config.js",
10-
"clean": "rimraf packages/*/dist temp .eslintcache",
11-
"size": "run-s \"size-*\" && tsx scripts/usage-size.ts",
9+
"build-dts": "tsc -p tsconfig.build.json --noCheck && rollup -c rollup.dts.config.js",
10+
"clean": "rimraf --glob packages/*/dist temp .eslintcache",
11+
"size": "run-s \"size-*\" && node scripts/usage-size.js",
1212
"size-global": "node scripts/build.js vue runtime-dom -f global -p --size",
1313
"size-esm-runtime": "node scripts/build.js vue -f esm-bundler-runtime",
1414
"size-esm": "node scripts/build.js runtime-dom runtime-core reactivity shared -f esm-bundler",
@@ -17,11 +17,11 @@
1717
"format": "prettier --write --cache .",
1818
"format-check": "prettier --check --cache .",
1919
"test": "vitest",
20-
"test-unit": "vitest -c vitest.unit.config.ts",
21-
"test-e2e": "node scripts/build.js vue -f global -d && vitest -c vitest.e2e.config.ts",
20+
"test-unit": "vitest --project unit",
21+
"test-e2e": "node scripts/build.js vue -f global -d && vitest --project e2e",
2222
"test-dts": "run-s build-dts test-dts-only",
2323
"test-dts-only": "tsc -p packages-private/dts-built-test/tsconfig.json && tsc -p ./packages-private/dts-test/tsconfig.test.json",
24-
"test-coverage": "vitest -c vitest.unit.config.ts --coverage",
24+
"test-coverage": "vitest run --project unit --coverage",
2525
"test-bench": "vitest bench",
2626
"release": "node scripts/release.js",
2727
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
@@ -32,7 +32,7 @@
3232
"dev-sfc-serve": "vite packages-private/sfc-playground --host",
3333
"dev-sfc-run": "run-p \"dev compiler-sfc -f esm-browser\" \"dev vue -if esm-bundler-runtime\" \"dev vue -ipf esm-browser-runtime\" \"dev server-renderer -if esm-bundler\" dev-sfc-serve",
3434
"serve": "serve",
35-
"open": "open http://localhost:3000/packages/template-explorer/local.html",
35+
"open": "open http://localhost:3000/packages-private/template-explorer/local.html",
3636
"build-sfc-playground": "run-s build-all-cjs build-runtime-esm build-browser-esm build-ssr-esm build-sfc-playground-self",
3737
"build-all-cjs": "node scripts/build.js vue runtime compiler reactivity shared -af cjs",
3838
"build-runtime-esm": "node scripts/build.js runtime reactivity shared -af esm-bundler && node scripts/build.js vue -f esm-bundler-runtime && node scripts/build.js vue -f esm-browser-runtime",
@@ -66,35 +66,35 @@
6666
"@rollup/plugin-json": "^6.1.0",
6767
"@rollup/plugin-node-resolve": "^15.2.3",
6868
"@rollup/plugin-replace": "5.0.4",
69-
"@swc/core": "^1.7.11",
69+
"@swc/core": "^1.7.26",
7070
"@types/hash-sum": "^1.0.2",
71-
"@types/node": "^20.16.0",
71+
"@types/node": "^20.16.5",
7272
"@types/semver": "^7.5.8",
7373
"@types/serve-handler": "^6.1.4",
74-
"@vitest/coverage-istanbul": "^2.0.5",
74+
"@vitest/coverage-v8": "^2.1.1",
7575
"@vue/consolidate": "1.0.0",
7676
"conventional-changelog-cli": "^5.0.0",
7777
"enquirer": "^2.4.1",
7878
"esbuild": "^0.23.1",
7979
"esbuild-plugin-polyfill-node": "^0.3.0",
80-
"eslint": "^9.9.0",
81-
"eslint-plugin-import-x": "^3.1.0",
80+
"eslint": "^9.10.0",
81+
"eslint-plugin-import-x": "^4.2.1",
8282
"eslint-plugin-vitest": "^0.5.4",
8383
"estree-walker": "catalog:",
84-
"jsdom": "^24.1.1",
85-
"lint-staged": "^15.2.9",
84+
"jsdom": "^25.0.0",
85+
"lint-staged": "^15.2.10",
8686
"lodash": "^4.17.21",
8787
"magic-string": "^0.30.11",
8888
"markdown-table": "^3.0.3",
8989
"marked": "13.0.3",
90-
"npm-run-all2": "^6.2.2",
91-
"picocolors": "^1.0.1",
90+
"npm-run-all2": "^6.2.3",
91+
"picocolors": "^1.1.0",
9292
"prettier": "^3.3.3",
9393
"pretty-bytes": "^6.1.1",
9494
"pug": "^3.0.3",
95-
"puppeteer": "~23.0.2",
95+
"puppeteer": "~23.3.0",
9696
"rimraf": "^6.0.1",
97-
"rollup": "^4.21.0",
97+
"rollup": "^4.21.3",
9898
"rollup-plugin-dts": "^6.1.1",
9999
"rollup-plugin-esbuild": "^6.1.1",
100100
"rollup-plugin-polyfill-node": "^0.13.0",
@@ -103,12 +103,11 @@
103103
"serve-handler": "^6.1.5",
104104
"simple-git-hooks": "^2.11.1",
105105
"todomvc-app-css": "^2.4.3",
106-
"tslib": "^2.6.3",
107-
"tsx": "^4.17.0",
108-
"typescript": "~5.5.4",
109-
"typescript-eslint": "^8.1.0",
106+
"tslib": "^2.7.0",
107+
"typescript": "~5.6.2",
108+
"typescript-eslint": "^8.5.0",
110109
"vite": "catalog:",
111-
"vitest": "^2.0.5"
110+
"vitest": "^2.1.1"
112111
},
113112
"pnpm": {
114113
"peerDependencyRules": {

packages-private/dts-test/appDirective.test-d.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,17 @@ import { expectType } from './utils'
33

44
const app = createApp({})
55

6-
app.directive<HTMLElement, string>('custom', {
7-
mounted(el, binding) {
8-
expectType<HTMLElement>(el)
9-
expectType<string>(binding.value)
6+
app.directive<HTMLElement, string, 'prevent' | 'stop', 'arg1' | 'arg2'>(
7+
'custom',
8+
{
9+
mounted(el, binding) {
10+
expectType<HTMLElement>(el)
11+
expectType<string>(binding.value)
12+
expectType<{ prevent: boolean; stop: boolean }>(binding.modifiers)
13+
expectType<'arg1' | 'arg2'>(binding.arg!)
1014

11-
// @ts-expect-error not any
12-
expectType<number>(binding.value)
15+
// @ts-expect-error not any
16+
expectType<number>(binding.value)
17+
},
1318
},
14-
})
19+
)

packages-private/dts-test/defineComponent.test-d.tsx

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,26 @@ describe('type inference w/ options API', () => {
480480
})
481481
})
482482

483+
// #4051
484+
describe('type inference w/ empty prop object', () => {
485+
const MyComponent = defineComponent({
486+
props: {},
487+
setup(props) {
488+
return {}
489+
},
490+
render() {},
491+
})
492+
expectType<JSX.Element>(<MyComponent />)
493+
// AllowedComponentProps
494+
expectType<JSX.Element>(<MyComponent class={'foo'} />)
495+
// ComponentCustomProps
496+
expectType<JSX.Element>(<MyComponent custom={1} />)
497+
// VNodeProps
498+
expectType<JSX.Element>(<MyComponent key="1" />)
499+
// @ts-expect-error
500+
expectError(<MyComponent other="other" />)
501+
})
502+
483503
describe('with mixins', () => {
484504
const MixinA = defineComponent({
485505
emits: ['bar'],
@@ -1021,6 +1041,18 @@ describe('emits', () => {
10211041
},
10221042
})
10231043

1044+
// #11803 manual props annotation in setup()
1045+
const Hello = defineComponent({
1046+
name: 'HelloWorld',
1047+
inheritAttrs: false,
1048+
props: { foo: String },
1049+
emits: {
1050+
customClick: (args: string) => typeof args === 'string',
1051+
},
1052+
setup(props: { foo?: string }) {},
1053+
})
1054+
;<Hello onCustomClick={() => {}} />
1055+
10241056
// without emits
10251057
defineComponent({
10261058
setup(props, { emit }) {
@@ -1790,6 +1822,15 @@ describe('__typeRefs backdoor, object syntax', () => {
17901822
expectType<number>(refs.child.$refs.foo)
17911823
})
17921824

1825+
describe('__typeEl backdoor', () => {
1826+
const Comp = defineComponent({
1827+
__typeEl: {} as HTMLAnchorElement,
1828+
})
1829+
const c = new Comp()
1830+
1831+
expectType<HTMLAnchorElement>(c.$el)
1832+
})
1833+
17931834
defineComponent({
17941835
props: {
17951836
foo: [String, null],

packages-private/dts-test/setupHelpers.test-d.ts

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,51 @@ describe('defineModel', () => {
427427
defineModel<string>({ default: 123 })
428428
// @ts-expect-error unknown props option
429429
defineModel({ foo: 123 })
430+
431+
// unrelated getter and setter types
432+
{
433+
const modelVal = defineModel({
434+
get(_: string[]): string {
435+
return ''
436+
},
437+
set(_: number) {
438+
return 1
439+
},
440+
})
441+
expectType<string | undefined>(modelVal.value)
442+
modelVal.value = 1
443+
modelVal.value = undefined
444+
// @ts-expect-error
445+
modelVal.value = 'foo'
446+
447+
const [modelVal2] = modelVal
448+
expectType<string | undefined>(modelVal2.value)
449+
modelVal2.value = 1
450+
modelVal2.value = undefined
451+
// @ts-expect-error
452+
modelVal.value = 'foo'
453+
454+
const count = defineModel('count', {
455+
get(_: string[]): string {
456+
return ''
457+
},
458+
set(_: number) {
459+
return ''
460+
},
461+
})
462+
expectType<string | undefined>(count.value)
463+
count.value = 1
464+
count.value = undefined
465+
// @ts-expect-error
466+
count.value = 'foo'
467+
468+
const [count2] = count
469+
expectType<string | undefined>(count2.value)
470+
count2.value = 1
471+
count2.value = undefined
472+
// @ts-expect-error
473+
count2.value = 'foo'
474+
}
430475
})
431476

432477
describe('useModel', () => {

packages-private/dts-test/tsx.test-d.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,5 @@ expectType<JSX.Element>(
121121
xmlns="http://www.w3.org/2000/svg"
122122
/>,
123123
)
124+
// details
125+
expectType<JSX.Element>(<details name="details" />)

packages-private/global.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/// <reference types="vite/client" />
2+
3+
// Global compile-time constants
4+
declare var __COMMIT__: string
5+
6+
declare module 'file-saver' {
7+
export function saveAs(blob: any, name: any): void
8+
}

0 commit comments

Comments
 (0)