Skip to content

Commit 815e894

Browse files
committed
chore: Merge branch 'minor' into edison/refactor/vaporUseCssVars
2 parents 25afc4a + 3a2cd69 commit 815e894

File tree

65 files changed

+1269
-520
lines changed

Some content is hidden

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

65 files changed

+1269
-520
lines changed

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
1+
# [3.6.0-alpha.4](https://github.com/vuejs/core/compare/v3.5.24...v3.6.0-alpha.4) (2025-11-14)
2+
3+
4+
### Bug Fixes
5+
6+
* **compiler-vapor:** handle boolean as constant node ([#13994](https://github.com/vuejs/core/issues/13994)) ([c1f2289](https://github.com/vuejs/core/commit/c1f228913b5849ea8a548313c9c0603ccf07d6af))
7+
* **compiler-vapor:** handle numbers as static text ([#13957](https://github.com/vuejs/core/issues/13957)) ([4b9399a](https://github.com/vuejs/core/commit/4b9399ae8243abda99cd73dfdb178887284c69d6))
8+
* **compiler-vapor:** wrap event handler in parentheses for TSExpression ([#14061](https://github.com/vuejs/core/issues/14061)) ([0f4edb4](https://github.com/vuejs/core/commit/0f4edb47cbab64c304d79b7565985c02dec877b6))
9+
* **runtime-dom:** useCssModule vapor support ([#13711](https://github.com/vuejs/core/issues/13711)) ([abe8fc2](https://github.com/vuejs/core/commit/abe8fc29e493e1e5f7bd92df4c26b5ca835526be))
10+
* **runtime-vapor:** force defer mount when teleport has insertion state ([#14049](https://github.com/vuejs/core/issues/14049)) ([b005811](https://github.com/vuejs/core/commit/b005811f65016b199b5bc426e67cd9d8b825a3f7))
11+
* **runtime-vapor:** preserve correct parent instance for slotted content ([#14095](https://github.com/vuejs/core/issues/14095)) ([fe3a998](https://github.com/vuejs/core/commit/fe3a998b4182ef5712c8dddd0ba9459d86ce818c))
12+
* **transition-group:** support reusable transition group ([#14077](https://github.com/vuejs/core/issues/14077)) ([171f3f5](https://github.com/vuejs/core/commit/171f3f56947d668072e6a811b4b1f1c045f6ea1d))
13+
* **vapor:** v-model and v-model:model co-usage ([#13070](https://github.com/vuejs/core/issues/13070)) ([bf2d2b2](https://github.com/vuejs/core/commit/bf2d2b2fde3315c575628a7462a0397c8b49d076))
14+
15+
16+
### Features
17+
18+
* **compiler-vapor:** handle asset imports ([#13630](https://github.com/vuejs/core/issues/13630)) ([7d4ab91](https://github.com/vuejs/core/commit/7d4ab91e9cac5dc177f1a55ac1137246fee9407c))
19+
* **vapor:** implement defineVaporCustomElement ([#14017](https://github.com/vuejs/core/issues/14017)) ([615db5e](https://github.com/vuejs/core/commit/615db5e95986c6fedfa7936c3c3bb71dc87bf1e6))
20+
* **runtime-vapor:** dynamic component fallback work with dynamic slots ([#14064](https://github.com/vuejs/core/issues/14064)) ([f4b3613](https://github.com/vuejs/core/commit/f4b3613f66d4604186e3008231a44b68196a45c7))
21+
* **vapor:** support svg and MathML ([#13703](https://github.com/vuejs/core/issues/13703)) ([f0d0cfd](https://github.com/vuejs/core/commit/f0d0cfd1d48a61ea5f5e094f6546272a758363c9))
22+
* **vapor:** dom event error handling ([#13769](https://github.com/vuejs/core/issues/13769)) ([d2eebe4](https://github.com/vuejs/core/commit/d2eebe45a87e8af2c19f4e2792d8aff0fb0fff24))
23+
24+
25+
126
# [3.6.0-alpha.3](https://github.com/vuejs/core/compare/v3.5.23...v3.6.0-alpha.3) (2025-11-06)
227

328

changelogs/CHANGELOG-3.5.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
## [3.5.24](https://github.com/vuejs/core/compare/v3.5.23...v3.5.24) (2025-11-07)
2+
3+
4+
### Reverts
5+
6+
* Revert "fix(compiler-core): correctly handle ts type assertions in expression…" (#14062) ([11ec51a](https://github.com/vuejs/core/commit/11ec51aa5a7914745fee10ed2b9f9464fab4d02c)), closes [#14062](https://github.com/vuejs/core/issues/14062) [#14060](https://github.com/vuejs/core/issues/14060)
7+
8+
9+
110
## [3.5.23](https://github.com/vuejs/core/compare/v3.5.22...v3.5.23) (2025-11-06)
211

312

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
3-
"version": "3.6.0-alpha.3",
4-
"packageManager": "pnpm@10.12.4",
3+
"version": "3.6.0-alpha.4",
4+
"packageManager": "pnpm@10.20.0",
55
"type": "module",
66
"scripts": {
77
"dev": "node scripts/dev.js",

packages/compiler-core/__tests__/transforms/__snapshots__/transformExpressions.spec.ts.snap

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,6 @@ return function render(_ctx, _cache, $props, $setup, $data, $options) {
1414
}"
1515
`;
1616

17-
exports[`compiler: expression transform > expression with type 1`] = `
18-
"const { openBlock: _openBlock, createElementBlock: _createElementBlock } = Vue
19-
20-
return function render(_ctx, _cache) {
21-
return (_openBlock(), _createElementBlock("div", {
22-
onClick: _ctx.handleClick
23-
}, null, 8 /* PROPS */, ["onClick"]))
24-
}"
25-
`;
26-
2717
exports[`compiler: expression transform > should allow leak of var declarations in for loop 1`] = `
2818
"const { openBlock: _openBlock, createElementBlock: _createElementBlock } = Vue
2919

packages/compiler-core/__tests__/transforms/transformExpressions.spec.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -754,12 +754,4 @@ describe('compiler: expression transform', () => {
754754
expect(code).toMatch(`_ctx.bar`)
755755
})
756756
})
757-
758-
test('expression with type', () => {
759-
const { code } = compile(
760-
`<div @click="(<number>handleClick as any)"></div>`,
761-
)
762-
expect(code).toMatch(`onClick: _ctx.handleClick`)
763-
expect(code).toMatchSnapshot()
764-
})
765757
})

packages/compiler-core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/compiler-core",
3-
"version": "3.6.0-alpha.3",
3+
"version": "3.6.0-alpha.4",
44
"description": "@vue/compiler-core",
55
"main": "index.js",
66
"module": "dist/compiler-core.esm-bundler.js",

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

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import {
1818
createSimpleExpression,
1919
} from '../ast'
2020
import {
21-
TS_NODE_TYPES,
2221
isInDestructureAssignment,
2322
isInNewExpression,
2423
isStaticProperty,
@@ -349,18 +348,15 @@ export function processExpression(
349348
// an ExpressionNode has the `.children` property, it will be used instead of
350349
// `.content`.
351350
const children: CompoundExpressionNode['children'] = []
352-
const isTSNode = TS_NODE_TYPES.includes(ast.type)
353351
ids.sort((a, b) => a.start - b.start)
354352
ids.forEach((id, i) => {
355353
// range is offset by -1 due to the wrapping parens when parsed
356354
const start = id.start - 1
357355
const end = id.end - 1
358356
const last = ids[i - 1]
359-
if (!(isTSNode && i === 0)) {
360-
const leadingText = rawExp.slice(last ? last.end - 1 : 0, start)
361-
if (leadingText.length || id.prefix) {
362-
children.push(leadingText + (id.prefix || ``))
363-
}
357+
const leadingText = rawExp.slice(last ? last.end - 1 : 0, start)
358+
if (leadingText.length || id.prefix) {
359+
children.push(leadingText + (id.prefix || ``))
364360
}
365361
const source = rawExp.slice(start, end)
366362
children.push(
@@ -377,7 +373,7 @@ export function processExpression(
377373
: ConstantTypes.NOT_CONSTANT,
378374
),
379375
)
380-
if (i === ids.length - 1 && end < rawExp.length && !isTSNode) {
376+
if (i === ids.length - 1 && end < rawExp.length) {
381377
children.push(rawExp.slice(end))
382378
}
383379
})

packages/compiler-core/src/utils.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
type MemoExpression,
1313
NodeTypes,
1414
type ObjectExpression,
15+
type ParentNode,
1516
type Position,
1617
type Property,
1718
type RenderSlotCall,
@@ -568,4 +569,38 @@ export function getMemoedVNodeCall(
568569
}
569570
}
570571

572+
export function filterNonCommentChildren(
573+
node: ParentNode,
574+
): TemplateChildNode[] {
575+
return node.children.filter(n => n.type !== NodeTypes.COMMENT)
576+
}
577+
578+
export function hasSingleChild(node: ParentNode): boolean {
579+
return filterNonCommentChildren(node).length === 1
580+
}
581+
582+
export function isSingleIfBlock(parent: ParentNode): boolean {
583+
// detect cases where the parent v-if is not the only root level node
584+
let hasEncounteredIf = false
585+
for (const c of filterNonCommentChildren(parent)) {
586+
if (
587+
c.type === NodeTypes.IF ||
588+
(c.type === NodeTypes.ELEMENT && findDir(c, 'if'))
589+
) {
590+
// multiple root v-if
591+
if (hasEncounteredIf) return false
592+
hasEncounteredIf = true
593+
} else if (
594+
// node before v-if
595+
!hasEncounteredIf ||
596+
// non else nodes
597+
!(c.type === NodeTypes.ELEMENT && findDir(c, /^else(-if)?$/, true))
598+
) {
599+
return false
600+
}
601+
}
602+
603+
return true
604+
}
605+
571606
export const forAliasRE: RegExp = /([\s\S]*?)\s+(?:in|of)\s+(\S[\s\S]*)/

packages/compiler-dom/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/compiler-dom",
3-
"version": "3.6.0-alpha.3",
3+
"version": "3.6.0-alpha.4",
44
"description": "@vue/compiler-dom",
55
"main": "index.js",
66
"module": "dist/compiler-dom.esm-bundler.js",

packages/compiler-sfc/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue/compiler-sfc",
3-
"version": "3.6.0-alpha.3",
3+
"version": "3.6.0-alpha.4",
44
"description": "@vue/compiler-sfc",
55
"main": "dist/compiler-sfc.cjs.js",
66
"module": "dist/compiler-sfc.esm-browser.js",

0 commit comments

Comments
 (0)