Skip to content

Commit 019a2bf

Browse files
committed
chore: merge remote-tracking branch 'origin/main' into minor
2 parents cec72f2 + 7de9e41 commit 019a2bf

43 files changed

Lines changed: 3257 additions & 632 deletions

Some content is hidden

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

‎.github/contributing.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ Builds and watches `vue/dist/vue-runtime.esm-bundler.js` with all deps inlined u
206206

207207
### `nr dev-compiler`
208208

209-
The `dev-compiler` script builds, watches and serves the [Template Explorer](https://github.com/vuejs/core/tree/main/packages/template-explorer) at `http://localhost:3000`. This is useful when working on pure compiler issues.
209+
The `dev-compiler` script builds, watches and serves the [Template Explorer](https://github.com/vuejs/core/tree/main/packages-private/template-explorer) at `http://localhost:3000`. This is useful when working on pure compiler issues.
210210

211211
### `nr test`
212212

‎changelogs/CHANGELOG-3.5.md‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
## [3.5.46](https://github.com/vuejs/core/compare/v3.5.45...v3.5.46) (2026-11-20)
2+
3+
### Bug Fixes
4+
5+
* **compiler-sfc:** honour user `onWarn` + surface inline template tips ([#16152](https://github.com/vuejs/core/issues/16152)) ([21738b5](https://github.com/vuejs/core/commit/21738b527bac4a91eef9cbdfc2cc5ac1f3dbdec9))
6+
* **compiler-sfc:** match tsconfig include/exclude relative to the config file ([f897fa3](https://github.com/vuejs/core/commit/f897fa3478ad3e1ba2060933d09af2ba854faebb))
7+
* **compiler-sfc:** preserve generic type argument scopes ([#16253](https://github.com/vuejs/core/issues/16253)) ([cbd9595](https://github.com/vuejs/core/commit/cbd95955a5362b44060908f6e28ad447c3031b8a)), closes [#16248](https://github.com/vuejs/core/issues/16248)
8+
* **compiler-sfc:** resolve configDir relative to referenced configs ([2e2f7c6](https://github.com/vuejs/core/commit/2e2f7c6bef54a85a3ce8db768b11c5562385b65d))
9+
* **compiler-ssr:** inject css vars into the content of keep-alive and teleport ([#16245](https://github.com/vuejs/core/issues/16245)) ([aec1e05](https://github.com/vuejs/core/commit/aec1e052e65b36abea659d553042511917dde211))
10+
* **compiler-ssr:** map static DOM prop aliases to HTML attribute names ([#16334](https://github.com/vuejs/core/issues/16334)) ([0f4002c](https://github.com/vuejs/core/commit/0f4002c6882ccfb1b2621b6acf266bd7ff84fb96))
11+
* **hydration:** claim disabled teleport target anchors before nested teleports ([#16333](https://github.com/vuejs/core/issues/16333)) ([148fdac](https://github.com/vuejs/core/commit/148fdacdc3a67aaa2b8d1b615da227c3fcc2df53)), closes [#16332](https://github.com/vuejs/core/issues/16332)
12+
* **runtime-dom:** apply css vars to teleported content replaced without patching the teleport ([#16239](https://github.com/vuejs/core/issues/16239)) ([b5b2310](https://github.com/vuejs/core/commit/b5b2310d88002424af5f404e75e0ca8fc59047bc)), closes [#7312](https://github.com/vuejs/core/issues/7312) [#7344](https://github.com/vuejs/core/issues/7344) [#16237](https://github.com/vuejs/core/issues/16237) [#16238](https://github.com/vuejs/core/issues/16238)
13+
* **shared:** handle objects without a prototype in looseEqual (fix [#16250](https://github.com/vuejs/core/issues/16250)) ([#16251](https://github.com/vuejs/core/issues/16251)) ([6782586](https://github.com/vuejs/core/commit/6782586546cfe580ef7b5c18d692199d52f13e77))
14+
* **ssr:** avoid inherited property-to-attribute mappings ([#16225](https://github.com/vuejs/core/issues/16225)) ([7ef6817](https://github.com/vuejs/core/commit/7ef6817112bb420ef47a7252821b37caae016ac9))
15+
* **ssr:** inject css vars through root loops and fragments ([#16244](https://github.com/vuejs/core/issues/16244)) ([7c8a0f7](https://github.com/vuejs/core/commit/7c8a0f704f6eb762e86bbbcc4af5548e6c7532d2)), closes [#16242](https://github.com/vuejs/core/issues/16242) [#16243](https://github.com/vuejs/core/issues/16243)
16+
* **suspense:** drop async setup errors from unmounted components ([#16350](https://github.com/vuejs/core/issues/16350)) ([da101a4](https://github.com/vuejs/core/commit/da101a4caf8476a1c863d2471079dc03023d4684)), closes [#16349](https://github.com/vuejs/core/issues/16349)
17+
* **suspense:** run mounted hooks once when an out-in boundary resolves inside a pending ancestor ([#16345](https://github.com/vuejs/core/issues/16345)) ([096dc12](https://github.com/vuejs/core/commit/096dc120aeccc4fed4056b32413c1868c7f70857)), closes [#16344](https://github.com/vuejs/core/issues/16344)
18+
* **transition:** ignore stale enter callbacks on a reused element ([09a73ad](https://github.com/vuejs/core/commit/09a73ad997d7ef8beb87ab5884265e0c599b2bef)), closes [#16355](https://github.com/vuejs/core/issues/16355)
19+
* **transition:** ignore stale leave callbacks on a reused element ([#16358](https://github.com/vuejs/core/issues/16358)) ([942d307](https://github.com/vuejs/core/commit/942d307f64660bc3438dfede3c17ae0fb31c3655))
20+
* **transition:** only skip enter for the element that is leaving (fix [#16359](https://github.com/vuejs/core/issues/16359)) ([#16362](https://github.com/vuejs/core/issues/16362)) ([6e0078a](https://github.com/vuejs/core/commit/6e0078a6d5880c27bd239a7c1d4c559388c4c48b))
21+
122
## [3.5.45](https://github.com/vuejs/core/compare/v3.5.44...v3.5.45) (2026-11-05)
223

324
### Bug Fixes

‎package.json‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"version": "3.6.0-rc.15",
4-
"packageManager": "pnpm@12.16.1",
4+
"packageManager": "pnpm@12.21.0",
55
"type": "module",
66
"scripts": {
77
"dev": "node scripts/dev.js",
@@ -74,15 +74,15 @@
7474
"oxc-transform": "^0.147.0",
7575
"oxc-minify": "^0.147.0",
7676
"picocolors": "^1.1.1",
77-
"playwright": "^1.64.1",
77+
"playwright": "^1.65.1",
7878
"pretty-bytes": "^7.2.0",
7979
"pug": "^3.0.4",
8080
"puppeteer": "~25.11.0",
8181
"rimraf": "^6.1.4",
8282
"rolldown": "^1.2.5",
8383
"rolldown-plugin-dts": "^0.28.2",
84-
"serve": "^14.2.6",
85-
"serve-handler": "^6.1.7",
84+
"serve": "^14.2.8",
85+
"serve-handler": "^6.1.8",
8686
"todomvc-app-css": "^2.4.3",
8787
"tslib": "^2.9.1",
8888
"typescript": "~6.0.3",

‎packages-private/sfc-playground/src/download/template/package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"vue": "latest"
1212
},
1313
"devDependencies": {
14-
"@vitejs/plugin-vue": "^6.0.10",
15-
"vite": "^8.3.5"
14+
"@vitejs/plugin-vue": "^6.0.11",
15+
"vite": "^8.3.8"
1616
}
1717
}

‎packages/compiler-sfc/__tests__/compileScript.spec.ts‎

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
import { vi } from 'vite-plus/test'
22
import { parse as babelParse } from '@babel/parser'
3-
import { BindingTypes } from '@vue/compiler-core'
3+
import {
4+
BindingTypes,
5+
type CompilerError,
6+
NodeTypes,
7+
createCompilerError,
8+
} from '@vue/compiler-core'
49
import {
510
assertCode,
611
compileSFCScript as compile,
@@ -2221,3 +2226,39 @@ describe('compileScript', () => {
22212226
})
22222227
})
22232228
})
2229+
2230+
test('calls user onWarn for inline template warnings', () => {
2231+
const warnings: CompilerError[] = []
2232+
compile(
2233+
`
2234+
<script setup>
2235+
const msg = 'hello'
2236+
</script>
2237+
<template>
2238+
<div>{{ msg }}</div>
2239+
</template>
2240+
`,
2241+
{
2242+
inlineTemplate: true,
2243+
templateOptions: {
2244+
compilerOptions: {
2245+
onWarn: w => warnings.push(w),
2246+
nodeTransforms: [
2247+
(node, ctx) => {
2248+
if (node.type === NodeTypes.ROOT) {
2249+
ctx.onWarn(
2250+
createCompilerError(-1, node.loc, {
2251+
[-1]: 'custom warning',
2252+
}),
2253+
)
2254+
}
2255+
},
2256+
],
2257+
},
2258+
},
2259+
},
2260+
)
2261+
2262+
expect(warnings).toHaveLength(1)
2263+
expect(warnings[0].message).toContain('custom warning')
2264+
})

‎packages/compiler-sfc/__tests__/compileScript/__snapshots__/defineModel.spec.ts.snap‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,3 +390,28 @@ return { modelValue }
390390
391391
})"
392392
`;
393+
394+
exports[`defineModel() > w/ types, production mode, generic type alias w/ default type parameter 1`] = `
395+
"import { useModel as _useModel, defineComponent as _defineComponent } from 'vue'
396+
type Flag<T = boolean> = T
397+
type Model<T = boolean> = { value: T }
398+
399+
export default /*@__PURE__*/_defineComponent({
400+
props: {
401+
"flag": { type: Boolean },
402+
"flagModifiers": {},
403+
"checked": { type: Boolean },
404+
"checkedModifiers": {},
405+
},
406+
emits: ["update:flag", "update:checked"],
407+
setup(__props, { expose: __expose }) {
408+
__expose();
409+
410+
const flag = _useModel<Flag>(__props, 'flag')
411+
const checked = _useModel<Model['value']>(__props, 'checked')
412+
413+
return { flag, checked }
414+
}
415+
416+
})"
417+
`;

‎packages/compiler-sfc/__tests__/compileScript/defineModel.spec.ts‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,21 @@ describe('defineModel()', () => {
211211
expect(content).toMatch('"modelValue": { type: [Boolean, String, Object] }')
212212
})
213213

214+
test('w/ types, production mode, generic type alias w/ default type parameter', () => {
215+
const { content } = compile(
216+
`<script setup lang="ts">
217+
type Flag<T = boolean> = T
218+
type Model<T = boolean> = { value: T }
219+
const flag = defineModel<Flag>('flag')
220+
const checked = defineModel<Model['value']>('checked')
221+
</script>`,
222+
{ isProd: true },
223+
)
224+
assertCode(content)
225+
expect(content).toMatch('"flag": { type: Boolean }')
226+
expect(content).toMatch('"checked": { type: Boolean }')
227+
})
228+
214229
test('w/ types, production mode, function + runtime opts + multiple types', () => {
215230
const { content } = compile(
216231
`

‎packages/compiler-sfc/__tests__/compileScript/defineProps.spec.ts‎

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { BindingTypes } from '@vue/compiler-core'
22
import { assertCode, compileSFCScript as compile } from '../utils'
3+
import { invalidateTypeCache } from '../../src/script/resolveType'
34

45
describe('defineProps', () => {
56
test('basic usage', () => {
@@ -829,4 +830,97 @@ const props = defineProps({ foo: String })
829830
expect(content).toMatch(`foo: { default: 5.5, type: Number }`)
830831
assertCode(content)
831832
})
833+
834+
test.each([false, true])(
835+
'keeps imported composite defaults from adding Boolean casting (isProd: %s)',
836+
isProd => {
837+
const files: Record<string, string> = {
838+
'/composite-props.ts': `
839+
type Local = string
840+
export type Props<T, U = T | Local> = { flag?: U }
841+
`,
842+
}
843+
invalidateTypeCache('/composite-props.ts')
844+
const { content } = compile(
845+
`<script setup lang="ts">
846+
import type { Props } from './composite-props'
847+
type Local = boolean
848+
defineProps<Props<number>>()
849+
</script>`,
850+
{
851+
isProd,
852+
fs: {
853+
fileExists: file => file in files,
854+
readFile: file => files[file],
855+
},
856+
},
857+
{ filename: '/Consumer.vue' },
858+
)
859+
expect(content).toContain(
860+
isProd
861+
? 'flag: {}'
862+
: 'flag: { type: [Number, String], required: false }',
863+
)
864+
},
865+
)
866+
867+
test.each([false, true])(
868+
'infers mapped values for each property key (isProd: %s)',
869+
isProd => {
870+
const { content } = compile(
871+
`<script setup lang="ts">
872+
type Values = { enabled: boolean; label: string }
873+
type Props = { [K in 'enabled' | 'label']?: Values[K] }
874+
defineProps<Props>()
875+
</script>`,
876+
{ isProd },
877+
)
878+
expect(content).toContain(
879+
isProd
880+
? 'enabled: { type: Boolean }'
881+
: 'enabled: { type: Boolean, required: false }',
882+
)
883+
expect(content).toContain(
884+
isProd ? 'label: {}' : 'label: { type: String, required: false }',
885+
)
886+
},
887+
)
888+
889+
test.each([false, true])(
890+
'preserves caller scope when extracting array elements (isProd: %s)',
891+
isProd => {
892+
const files: Record<string, string> = {
893+
'/array-helpers.ts': `
894+
type Local = boolean
895+
export type Element<T extends readonly unknown[]> = T[number]
896+
`,
897+
}
898+
invalidateTypeCache('/array-helpers.ts')
899+
const { content } = compile(
900+
`<script setup lang="ts">
901+
import type { Element } from './array-helpers'
902+
type Local = string
903+
defineProps<{
904+
array?: Element<Local[]>
905+
tuple?: Element<[Local]>
906+
namedTuple?: Element<[value: Local]>
907+
reference?: Element<Array<Local>>
908+
}>()
909+
</script>`,
910+
{
911+
isProd,
912+
fs: {
913+
fileExists: file => file in files,
914+
readFile: file => files[file],
915+
},
916+
},
917+
{ filename: '/ArrayConsumer.vue' },
918+
)
919+
for (const key of ['array', 'tuple', 'namedTuple', 'reference']) {
920+
expect(content).toContain(
921+
isProd ? `${key}: {}` : `${key}: { type: String, required: false }`,
922+
)
923+
}
924+
},
925+
)
832926
})

0 commit comments

Comments
 (0)