Skip to content

Commit b1260e0

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents 2d30c71 + b5ff930 commit b1260e0

File tree

67 files changed

+2026
-1048
lines changed

Some content is hidden

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

67 files changed

+2026
-1048
lines changed

.github/renovate.json5

+19-10
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
{
22
$schema: 'https://docs.renovatebot.com/renovate-schema.json',
3-
extends: ['config:base', 'schedule:weekly', 'group:allNonMajor'],
3+
extends: ['config:recommended', 'schedule:weekly', 'group:allNonMajor'],
44
labels: ['dependencies'],
55
ignorePaths: ['**/__tests__/**'],
66
rangeStrategy: 'bump',
77
packageRules: [
88
{
9-
depTypeList: ['peerDependencies'],
9+
matchDepTypes: ['peerDependencies'],
1010
enabled: false,
1111
},
1212
{
1313
groupName: 'test',
14-
matchPackageNames: ['vitest', 'jsdom', 'puppeteer'],
15-
matchPackagePrefixes: ['@vitest'],
14+
matchPackageNames: ['vitest', 'jsdom', 'puppeteer', '@vitest{/,}**'],
1615
},
1716
{
1817
groupName: 'playground',
@@ -23,18 +22,28 @@
2322
},
2423
{
2524
groupName: 'compiler',
26-
matchPackageNames: ['magic-string'],
27-
matchPackagePrefixes: ['@babel', 'postcss'],
25+
matchPackageNames: ['magic-string', '@babel{/,}**', 'postcss{/,}**'],
2826
},
2927
{
3028
groupName: 'build',
31-
matchPackageNames: ['vite', '@swc/core'],
32-
matchPackagePrefixes: ['rollup', 'esbuild', '@rollup', '@vitejs'],
29+
matchPackageNames: [
30+
'vite',
31+
'@swc/core',
32+
'rollup{/,}**',
33+
'esbuild{/,}**',
34+
'@rollup{/,}**',
35+
'@vitejs{/,}**',
36+
],
3337
},
3438
{
3539
groupName: 'lint',
36-
matchPackageNames: ['simple-git-hooks', 'lint-staged'],
37-
matchPackagePrefixes: ['typescript-eslint', 'eslint', 'prettier'],
40+
matchPackageNames: [
41+
'simple-git-hooks',
42+
'lint-staged',
43+
'typescript-eslint{/,}**',
44+
'eslint{/,}**',
45+
'prettier{/,}**',
46+
],
3847
},
3948
],
4049
ignoreDeps: [

CHANGELOG.md

+31
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,34 @@
1+
## [3.5.12](https://github.com/vuejs/core/compare/v3.5.11...v3.5.12) (2024-10-11)
2+
3+
4+
### Bug Fixes
5+
6+
* **compiler-dom:** avoid stringify option with null value ([#12096](https://github.com/vuejs/core/issues/12096)) ([f6d9926](https://github.com/vuejs/core/commit/f6d99262364b7444ebab8742158599e8cdd79eaa)), closes [#12093](https://github.com/vuejs/core/issues/12093)
7+
* **compiler-sfc:** do not skip TSInstantiationExpression when transforming props destructure ([#12064](https://github.com/vuejs/core/issues/12064)) ([d3ecde8](https://github.com/vuejs/core/commit/d3ecde8a696ff62c8d0ab067fd1d7ee0565b63c5))
8+
* **compiler-sfc:** use sass modern api if available and avoid deprecation warning ([#11992](https://github.com/vuejs/core/issues/11992)) ([4474c11](https://github.com/vuejs/core/commit/4474c113d1fb1c26298dd6794275d5b5c7cc4d93))
9+
* **compiler:** clone loc to `ifNode` ([#12131](https://github.com/vuejs/core/issues/12131)) ([cde2c06](https://github.com/vuejs/core/commit/cde2c0671b00d4f6111fcbd7aa76e45872f20b0c)), closes [vuejs/language-tools#4911](https://github.com/vuejs/language-tools/issues/4911)
10+
* **custom-element:** properly remove hyphenated attribute ([#12143](https://github.com/vuejs/core/issues/12143)) ([e16e9a7](https://github.com/vuejs/core/commit/e16e9a7341e7cfb3c443da4e5e5b06e8158712c3)), closes [#12139](https://github.com/vuejs/core/issues/12139)
11+
* **defineModel:** handle kebab-case model correctly ([#12063](https://github.com/vuejs/core/issues/12063)) ([c0418a3](https://github.com/vuejs/core/commit/c0418a3b8fa96a0b108ab71b7aab5d3388f90557)), closes [#12060](https://github.com/vuejs/core/issues/12060)
12+
* **deps:** update dependency monaco-editor to ^0.52.0 ([#12119](https://github.com/vuejs/core/issues/12119)) ([f7cbea2](https://github.com/vuejs/core/commit/f7cbea2111c7770a180b640f36f6a5d4d6abc698))
13+
* **hydration:** provide compat fallback for idle callback hydration strategy ([#11935](https://github.com/vuejs/core/issues/11935)) ([1ae545a](https://github.com/vuejs/core/commit/1ae545a3786abef983be1c969726489685569c92))
14+
* **reactivity:** trigger reactivity for Map key `undefined` ([#12055](https://github.com/vuejs/core/issues/12055)) ([7ad289e](https://github.com/vuejs/core/commit/7ad289e1e7fea654524008ff91e43a8b8a55ef22)), closes [#12054](https://github.com/vuejs/core/issues/12054)
15+
* **runtime-core:** allow symbol values for slot prop key ([#12069](https://github.com/vuejs/core/issues/12069)) ([d9d4d4e](https://github.com/vuejs/core/commit/d9d4d4e158cd51a9ddda249f29de8467f60b2792)), closes [#12068](https://github.com/vuejs/core/issues/12068)
16+
* **runtime-core:** fix required prop check false positive for kebab-case edge cases ([#12034](https://github.com/vuejs/core/issues/12034)) ([9da1ac1](https://github.com/vuejs/core/commit/9da1ac156552ac449754e1373aac7e349841becb)), closes [#12011](https://github.com/vuejs/core/issues/12011)
17+
* **runtime-dom:** prevent unnecessary updates in v-model checkbox when value is unchanged ([#12146](https://github.com/vuejs/core/issues/12146)) ([ea943af](https://github.com/vuejs/core/commit/ea943afe404c4ca4b729906c5e8daf7aa2ccde9b)), closes [#12144](https://github.com/vuejs/core/issues/12144)
18+
* **teleport:** handle disabled teleport with updateCssVars ([#12113](https://github.com/vuejs/core/issues/12113)) ([76a8223](https://github.com/vuejs/core/commit/76a8223199c148b79a5c0ea19e235164809760cd)), closes [#12112](https://github.com/vuejs/core/issues/12112)
19+
* **transition/ssr:** make transition appear work with Suspense in SSR ([#12047](https://github.com/vuejs/core/issues/12047)) ([f1a4f67](https://github.com/vuejs/core/commit/f1a4f67aedfe83e440c54222213f070774faa421)), closes [#12046](https://github.com/vuejs/core/issues/12046)
20+
* **types:** ensure `this.$props` type does not include `string` ([#12123](https://github.com/vuejs/core/issues/12123)) ([704173e](https://github.com/vuejs/core/commit/704173e24276706de672cca6c9507e4dd9651197)), closes [#12122](https://github.com/vuejs/core/issues/12122)
21+
* **types:** retain union type narrowing with defaults applied ([#12108](https://github.com/vuejs/core/issues/12108)) ([05685a9](https://github.com/vuejs/core/commit/05685a9d7c42d4cd37169b867833776b91154fed)), closes [#12106](https://github.com/vuejs/core/issues/12106)
22+
* **useId:** ensure useId consistency when using serverPrefetch ([#12128](https://github.com/vuejs/core/issues/12128)) ([b4d3534](https://github.com/vuejs/core/commit/b4d35349d8bc39aa15bd3f1094d230e5928b177c)), closes [#12102](https://github.com/vuejs/core/issues/12102)
23+
* **watch:** watchEffect clean-up with SSR ([#12097](https://github.com/vuejs/core/issues/12097)) ([b094c72](https://github.com/vuejs/core/commit/b094c72b3d40c52c7124f145a9db028509a11202)), closes [#11956](https://github.com/vuejs/core/issues/11956)
24+
25+
26+
### Performance Improvements
27+
28+
* **reactivity:** avoid unnecessary recursion in removeSub ([#12135](https://github.com/vuejs/core/issues/12135)) ([ec917cf](https://github.com/vuejs/core/commit/ec917cfdb9d0169cd0835d3a0e28244242657dc9))
29+
30+
31+
132
## [3.5.11](https://github.com/vuejs/core/compare/v3.5.10...v3.5.11) (2024-10-03)
233

334

eslint.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import importX from 'eslint-plugin-import-x'
22
import tseslint from 'typescript-eslint'
3-
import vitest from 'eslint-plugin-vitest'
3+
import vitest from '@vitest/eslint-plugin'
44
import { builtinModules } from 'node:module'
55

66
const DOMGlobals = ['window', 'document']

package.json

+17-17
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
3-
"version": "3.5.11",
4-
"packageManager": "[email protected].0",
3+
"version": "3.5.12",
4+
"packageManager": "[email protected].3",
55
"type": "module",
66
"scripts": {
77
"dev": "node scripts/dev.js vue vue-vapor",
@@ -62,13 +62,13 @@
6262
"@babel/parser": "catalog:",
6363
"@babel/types": "catalog:",
6464
"@rollup/plugin-alias": "^5.1.1",
65-
"@rollup/plugin-commonjs": "^26.0.3",
65+
"@rollup/plugin-commonjs": "^28.0.1",
6666
"@rollup/plugin-json": "^6.1.0",
6767
"@rollup/plugin-node-resolve": "^15.3.0",
6868
"@rollup/plugin-replace": "5.0.4",
69-
"@swc/core": "^1.7.28",
69+
"@swc/core": "^1.9.1",
7070
"@types/hash-sum": "^1.0.2",
71-
"@types/node": "^20.16.10",
71+
"@types/node": "^22.8.7",
7272
"@types/semver": "^7.5.8",
7373
"@types/serve-handler": "^6.1.4",
7474
"@vitest/coverage-v8": "^2.1.1",
@@ -78,35 +78,35 @@
7878
"enquirer": "^2.4.1",
7979
"esbuild": "^0.24.0",
8080
"esbuild-plugin-polyfill-node": "^0.3.0",
81-
"eslint": "^9.10.0",
82-
"eslint-plugin-import-x": "^4.2.1",
83-
"eslint-plugin-vitest": "^0.5.4",
81+
"eslint": "^9.14.0",
82+
"eslint-plugin-import-x": "^4.4.0",
83+
"@vitest/eslint-plugin": "^1.0.1",
8484
"estree-walker": "catalog:",
8585
"jsdom": "^25.0.0",
8686
"lint-staged": "^15.2.10",
8787
"lodash": "^4.17.21",
88-
"magic-string": "^0.30.11",
89-
"markdown-table": "^3.0.3",
88+
"magic-string": "^0.30.12",
89+
"markdown-table": "^3.0.4",
9090
"marked": "13.0.3",
91-
"npm-run-all2": "^6.2.3",
92-
"picocolors": "^1.1.0",
91+
"npm-run-all2": "^7.0.1",
92+
"picocolors": "^1.1.1",
9393
"prettier": "^3.3.3",
9494
"pretty-bytes": "^6.1.1",
9595
"pug": "^3.0.3",
9696
"puppeteer": "~23.3.0",
9797
"rimraf": "^6.0.1",
98-
"rollup": "^4.24.0",
98+
"rollup": "^4.25.0",
9999
"rollup-plugin-dts": "^6.1.1",
100100
"rollup-plugin-esbuild": "^6.1.1",
101101
"rollup-plugin-polyfill-node": "^0.13.0",
102102
"semver": "^7.6.3",
103-
"serve": "^14.2.3",
104-
"serve-handler": "^6.1.5",
103+
"serve": "^14.2.4",
104+
"serve-handler": "^6.1.6",
105105
"simple-git-hooks": "^2.11.1",
106106
"todomvc-app-css": "^2.4.3",
107-
"tslib": "^2.7.0",
107+
"tslib": "^2.8.1",
108108
"typescript": "~5.6.2",
109-
"typescript-eslint": "^8.5.0",
109+
"typescript-eslint": "^8.12.2",
110110
"vite": "catalog:",
111111
"vitest": "^2.1.1"
112112
},

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

+10
Original file line numberDiff line numberDiff line change
@@ -2068,3 +2068,13 @@ expectString(instance.actionText)
20682068
// public prop on $props should be optional
20692069
// @ts-expect-error
20702070
expectString(instance.$props.actionText)
2071+
2072+
// #12122
2073+
defineComponent({
2074+
props: { foo: String },
2075+
render() {
2076+
expectType<{ readonly foo?: string }>(this.$props)
2077+
// @ts-expect-error
2078+
expectType<string>(this.$props)
2079+
},
2080+
})

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

+17
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,23 @@ describe('withDefaults w/ defineProp type is different from the defaults type',
240240
res1.value
241241
})
242242

243+
describe('withDefaults w/ defineProp discriminate union type', () => {
244+
const props = withDefaults(
245+
defineProps<
246+
{ type: 'button'; buttonType?: 'submit' } | { type: 'link'; href: string }
247+
>(),
248+
{
249+
type: 'button',
250+
},
251+
)
252+
if (props.type === 'button') {
253+
expectType<'submit' | undefined>(props.buttonType)
254+
}
255+
if (props.type === 'link') {
256+
expectType<string>(props.href)
257+
}
258+
})
259+
243260
describe('defineProps w/ runtime declaration', () => {
244261
// runtime declaration
245262
const props = defineProps({

packages-private/sfc-playground/src/App.vue

+1
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ onMounted(() => {
198198
:ssr="useSSRMode"
199199
:vapor="useVaporMode"
200200
:autoSave="autoSave"
201+
:theme="theme"
201202
@toggle-theme="toggleTheme"
202203
@toggle-prod="toggleProdMode"
203204
@toggle-ssr="toggleSSR"

packages-private/sfc-playground/src/Header.vue

+6-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const props = defineProps<{
1616
ssr: boolean
1717
vapor: boolean
1818
autoSave: boolean
19+
theme: 'dark' | 'light'
1920
}>()
2021
const emit = defineEmits([
2122
'toggle-theme',
@@ -127,7 +128,11 @@ function toggleDark() {
127128
>
128129
<span>{{ autoSave ? 'AutoSave ON' : 'AutoSave OFF' }}</span>
129130
</button>
130-
<button title="Toggle dark mode" class="toggle-dark" @click="toggleDark">
131+
<button
132+
:title="`Switch to ${theme === 'dark' ? 'light' : 'dark'} theme`"
133+
class="toggle-dark"
134+
@click="toggleDark"
135+
>
131136
<Sun class="light" />
132137
<Moon class="dark" />
133138
</button>

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"vue": "^3.4.0"
1212
},
1313
"devDependencies": {
14-
"@vitejs/plugin-vue": "^5.1.4",
15-
"vite": "^5.4.8"
14+
"@vitejs/plugin-vue": "^5.1.5",
15+
"vite": "^5.4.10"
1616
}
1717
}

packages-private/template-explorer/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
},
1313
"dependencies": {
1414
"@vue/compiler-vapor": "workspace:^",
15-
"monaco-editor": "^0.51.0",
15+
"monaco-editor": "^0.52.0",
1616
"source-map-js": "^1.2.1"
1717
}
1818
}

packages/compiler-core/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/compiler-core",
3-
"version": "3.5.11",
3+
"version": "3.5.12",
44
"description": "@vue/compiler-core",
55
"main": "index.js",
66
"module": "dist/compiler-core.esm-bundler.js",

packages/compiler-core/src/parser.ts

+4
Original file line numberDiff line numberDiff line change
@@ -933,6 +933,10 @@ function getLoc(start: number, end?: number): SourceLocation {
933933
}
934934
}
935935

936+
export function cloneLoc(loc: SourceLocation): SourceLocation {
937+
return getLoc(loc.start.offset, loc.end.offset)
938+
}
939+
936940
function setLocEnd(loc: SourceLocation, end: number) {
937941
loc.end = tokenizer.getPos(end)
938942
loc.source = getSlice(loc.start.offset, end)

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import {
3030
import { ErrorCodes, createCompilerError } from '../errors'
3131
import { processExpression } from './transformExpression'
3232
import { validateBrowserExpression } from '../validateExpression'
33+
import { cloneLoc } from '../parser'
3334
import { CREATE_COMMENT, FRAGMENT } from '../runtimeHelpers'
3435
import { findDir, findProp, getMemoedVNodeCall, injectProp } from '../utils'
3536
import { PatchFlags } from '@vue/shared'
@@ -110,7 +111,7 @@ export function processIf(
110111
const branch = createIfBranch(node, dir)
111112
const ifNode: IfNode = {
112113
type: NodeTypes.IF,
113-
loc: node.loc,
114+
loc: cloneLoc(node.loc),
114115
branches: [branch],
115116
}
116117
context.replaceNode(ifNode)

packages/compiler-dom/__tests__/transforms/__snapshots__/stringifyStatic.spec.ts.snap

+17
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,23 @@ return function render(_ctx, _cache) {
3232
}"
3333
`;
3434

35+
exports[`stringify static html > should bail for <option> elements with null values 1`] = `
36+
"const { createElementVNode: _createElementVNode, openBlock: _openBlock, createElementBlock: _createElementBlock } = Vue
37+
38+
return function render(_ctx, _cache) {
39+
return (_openBlock(), _createElementBlock("div", null, _cache[0] || (_cache[0] = [
40+
_createElementVNode("select", null, [
41+
_createElementVNode("option", { value: null }),
42+
_createElementVNode("option", { value: "1" }),
43+
_createElementVNode("option", { value: "1" }),
44+
_createElementVNode("option", { value: "1" }),
45+
_createElementVNode("option", { value: "1" }),
46+
_createElementVNode("option", { value: "1" })
47+
], -1 /* HOISTED */)
48+
])))
49+
}"
50+
`;
51+
3552
exports[`stringify static html > should bail for <option> elements with number values 1`] = `
3653
"const { createElementVNode: _createElementVNode, openBlock: _openBlock, createElementBlock: _createElementBlock } = Vue
3754

packages/compiler-dom/__tests__/transforms/stringifyStatic.spec.ts

+11
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,17 @@ describe('stringify static html', () => {
470470
expect(code).toMatchSnapshot()
471471
})
472472

473+
test('should bail for <option> elements with null values', () => {
474+
const { ast, code } = compileWithStringify(
475+
`<div><select><option :value="null" />${repeat(
476+
`<option value="1" />`,
477+
StringifyThresholds.ELEMENT_WITH_BINDING_COUNT,
478+
)}</select></div>`,
479+
)
480+
expect(ast.cached).toMatchObject([cachedArrayBailedMatcher()])
481+
expect(code).toMatchSnapshot()
482+
})
483+
473484
test('eligible content (elements > 20) + non-eligible content', () => {
474485
const { code } = compileWithStringify(
475486
`<div>${repeat(

packages/compiler-dom/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/compiler-dom",
3-
"version": "3.5.11",
3+
"version": "3.5.12",
44
"description": "@vue/compiler-dom",
55
"main": "index.js",
66
"module": "dist/compiler-dom.esm-bundler.js",

packages/compiler-dom/src/transforms/stringifyStatic.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,7 @@ function analyzeNode(node: StringifiableNode): [number, number] | false {
261261
isOptionTag &&
262262
isStaticArgOf(p.arg, 'value') &&
263263
p.exp &&
264-
p.exp.ast &&
265-
p.exp.ast.type !== 'StringLiteral'
264+
!p.exp.isStatic
266265
) {
267266
return bail()
268267
}

0 commit comments

Comments
 (0)