Compare commits

..

No commits in common. "main" and "v3.5.23" have entirely different histories.

23 changed files with 59 additions and 91 deletions

View File

@ -1,12 +1,3 @@
## [3.5.24](https://github.com/vuejs/core/compare/v3.5.23...v3.5.24) (2025-11-07)
### Reverts
* 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)
## [3.5.23](https://github.com/vuejs/core/compare/v3.5.22...v3.5.23) (2025-11-06) ## [3.5.23](https://github.com/vuejs/core/compare/v3.5.22...v3.5.23) (2025-11-06)

View File

@ -1,6 +1,6 @@
{ {
"private": true, "private": true,
"version": "3.5.24", "version": "3.5.23",
"packageManager": "pnpm@10.20.0", "packageManager": "pnpm@10.20.0",
"type": "module", "type": "module",
"scripts": { "scripts": {

View File

@ -2107,38 +2107,3 @@ defineComponent({
expectType<string>(this.$props) expectType<string>(this.$props)
}, },
}) })
// #14117
defineComponent({
setup() {
const setup1 = ref('setup1')
const setup2 = ref('setup2')
return { setup1, setup2 }
},
data() {
return {
data1: 1,
}
},
props: {
props1: {
type: String,
},
},
methods: {
methods1() {
return `methods1`
},
},
computed: {
computed1() {
this.setup1
this.setup2
this.data1
this.props1
this.methods1()
return `computed1`
},
},
expose: ['setup1'],
})

View File

@ -14,6 +14,16 @@ return function render(_ctx, _cache, $props, $setup, $data, $options) {
}" }"
`; `;
exports[`compiler: expression transform > expression with type 1`] = `
"const { openBlock: _openBlock, createElementBlock: _createElementBlock } = Vue
return function render(_ctx, _cache) {
return (_openBlock(), _createElementBlock("div", {
onClick: _ctx.handleClick
}, null, 8 /* PROPS */, ["onClick"]))
}"
`;
exports[`compiler: expression transform > should allow leak of var declarations in for loop 1`] = ` exports[`compiler: expression transform > should allow leak of var declarations in for loop 1`] = `
"const { openBlock: _openBlock, createElementBlock: _createElementBlock } = Vue "const { openBlock: _openBlock, createElementBlock: _createElementBlock } = Vue

View File

@ -754,4 +754,12 @@ describe('compiler: expression transform', () => {
expect(code).toMatch(`_ctx.bar`) expect(code).toMatch(`_ctx.bar`)
}) })
}) })
test('expression with type', () => {
const { code } = compile(
`<div @click="(<number>handleClick as any)"></div>`,
)
expect(code).toMatch(`onClick: _ctx.handleClick`)
expect(code).toMatchSnapshot()
})
}) })

View File

@ -1,6 +1,6 @@
{ {
"name": "@vue/compiler-core", "name": "@vue/compiler-core",
"version": "3.5.24", "version": "3.5.23",
"description": "@vue/compiler-core", "description": "@vue/compiler-core",
"main": "index.js", "main": "index.js",
"module": "dist/compiler-core.esm-bundler.js", "module": "dist/compiler-core.esm-bundler.js",

View File

@ -18,6 +18,7 @@ import {
createSimpleExpression, createSimpleExpression,
} from '../ast' } from '../ast'
import { import {
TS_NODE_TYPES,
isInDestructureAssignment, isInDestructureAssignment,
isInNewExpression, isInNewExpression,
isStaticProperty, isStaticProperty,
@ -347,16 +348,19 @@ export function processExpression(
// an ExpressionNode has the `.children` property, it will be used instead of // an ExpressionNode has the `.children` property, it will be used instead of
// `.content`. // `.content`.
const children: CompoundExpressionNode['children'] = [] const children: CompoundExpressionNode['children'] = []
const isTSNode = TS_NODE_TYPES.includes(ast.type)
ids.sort((a, b) => a.start - b.start) ids.sort((a, b) => a.start - b.start)
ids.forEach((id, i) => { ids.forEach((id, i) => {
// range is offset by -1 due to the wrapping parens when parsed // range is offset by -1 due to the wrapping parens when parsed
const start = id.start - 1 const start = id.start - 1
const end = id.end - 1 const end = id.end - 1
const last = ids[i - 1] const last = ids[i - 1]
if (!(isTSNode && i === 0)) {
const leadingText = rawExp.slice(last ? last.end - 1 : 0, start) const leadingText = rawExp.slice(last ? last.end - 1 : 0, start)
if (leadingText.length || id.prefix) { if (leadingText.length || id.prefix) {
children.push(leadingText + (id.prefix || ``)) children.push(leadingText + (id.prefix || ``))
} }
}
const source = rawExp.slice(start, end) const source = rawExp.slice(start, end)
children.push( children.push(
createSimpleExpression( createSimpleExpression(
@ -372,7 +376,7 @@ export function processExpression(
: ConstantTypes.NOT_CONSTANT, : ConstantTypes.NOT_CONSTANT,
), ),
) )
if (i === ids.length - 1 && end < rawExp.length) { if (i === ids.length - 1 && end < rawExp.length && !isTSNode) {
children.push(rawExp.slice(end)) children.push(rawExp.slice(end))
} }
}) })

View File

@ -1,6 +1,6 @@
{ {
"name": "@vue/compiler-dom", "name": "@vue/compiler-dom",
"version": "3.5.24", "version": "3.5.23",
"description": "@vue/compiler-dom", "description": "@vue/compiler-dom",
"main": "index.js", "main": "index.js",
"module": "dist/compiler-dom.esm-bundler.js", "module": "dist/compiler-dom.esm-bundler.js",

View File

@ -1,6 +1,6 @@
{ {
"name": "@vue/compiler-sfc", "name": "@vue/compiler-sfc",
"version": "3.5.24", "version": "3.5.23",
"description": "@vue/compiler-sfc", "description": "@vue/compiler-sfc",
"main": "dist/compiler-sfc.cjs.js", "main": "dist/compiler-sfc.cjs.js",
"module": "dist/compiler-sfc.esm-browser.js", "module": "dist/compiler-sfc.esm-browser.js",

View File

@ -1,6 +1,6 @@
{ {
"name": "@vue/compiler-ssr", "name": "@vue/compiler-ssr",
"version": "3.5.24", "version": "3.5.23",
"description": "@vue/compiler-ssr", "description": "@vue/compiler-ssr",
"main": "dist/compiler-ssr.cjs.js", "main": "dist/compiler-ssr.cjs.js",
"types": "dist/compiler-ssr.d.ts", "types": "dist/compiler-ssr.d.ts",

View File

@ -83,11 +83,11 @@ export const ssrTransformModel: DirectiveTransform = (dir, node, context) => {
if (node.tagType === ElementTypes.ELEMENT) { if (node.tagType === ElementTypes.ELEMENT) {
const res: DirectiveTransformResult = { props: [] } const res: DirectiveTransformResult = { props: [] }
if (node.tag === 'input') {
const defaultProps = [ const defaultProps = [
// default value binding for text type inputs // default value binding for text type inputs
createObjectProperty(`value`, model), createObjectProperty(`value`, model),
] ]
if (node.tag === 'input') {
const type = findProp(node, 'type') const type = findProp(node, 'type')
if (type) { if (type) {
const value = findValueBinding(node) const value = findValueBinding(node)

View File

@ -1,6 +1,6 @@
{ {
"name": "@vue/reactivity", "name": "@vue/reactivity",
"version": "3.5.24", "version": "3.5.23",
"description": "@vue/reactivity", "description": "@vue/reactivity",
"main": "index.js", "main": "index.js",
"module": "dist/reactivity.esm-bundler.js", "module": "dist/reactivity.esm-bundler.js",

View File

@ -470,6 +470,11 @@ function removeDep(link: Link) {
} }
} }
export interface ReactiveEffectRunner<T = any> {
(): T
effect: ReactiveEffect
}
export function effect<T = any>( export function effect<T = any>(
fn: () => T, fn: () => T,
options?: ReactiveEffectOptions, options?: ReactiveEffectOptions,

View File

@ -1,6 +1,6 @@
{ {
"name": "@vue/runtime-core", "name": "@vue/runtime-core",
"version": "3.5.24", "version": "3.5.23",
"description": "@vue/runtime-core", "description": "@vue/runtime-core",
"main": "index.js", "main": "index.js",
"module": "dist/runtime-core.esm-bundler.js", "module": "dist/runtime-core.esm-bundler.js",

View File

@ -272,7 +272,7 @@ export function defineComponent<
Slots, Slots,
LocalComponents, LocalComponents,
Directives, Directives,
string Exposed
> >
>, >,
): DefineComponent< ): DefineComponent<

View File

@ -1194,7 +1194,7 @@ export type ComponentOptionsWithoutProps<
S, S,
LC, LC,
Directives, Directives,
string Exposed
> >
> >
@ -1256,7 +1256,7 @@ export type ComponentOptionsWithArrayProps<
S, S,
LC, LC,
Directives, Directives,
string Exposed
> >
> >

View File

@ -1,6 +1,6 @@
{ {
"name": "@vue/runtime-dom", "name": "@vue/runtime-dom",
"version": "3.5.24", "version": "3.5.23",
"description": "@vue/runtime-dom", "description": "@vue/runtime-dom",
"main": "index.js", "main": "index.js",
"module": "dist/runtime-dom.esm-bundler.js", "module": "dist/runtime-dom.esm-bundler.js",

View File

@ -17,7 +17,6 @@ import {
} from '@vue/runtime-core' } from '@vue/runtime-core'
import { nodeOps } from './nodeOps' import { nodeOps } from './nodeOps'
import { patchProp } from './patchProp' import { patchProp } from './patchProp'
export { nodeOps, patchProp }
// Importing from the compiler, will be tree-shaken in prod // Importing from the compiler, will be tree-shaken in prod
import { import {
NOOP, NOOP,

View File

@ -286,19 +286,6 @@ export interface HTMLAttributes extends AriaAttributes, EventHandlers<Events> {
contextmenu?: string | undefined contextmenu?: string | undefined
dir?: string | undefined dir?: string | undefined
draggable?: Booleanish | undefined draggable?: Booleanish | undefined
enterkeyhint?:
| 'enter'
| 'done'
| 'go'
| 'next'
| 'previous'
| 'search'
| 'send'
| undefined
/**
* @deprecated Use `enterkeyhint` instead.
*/
enterKeyHint?: HTMLAttributes['enterkeyhint']
hidden?: Booleanish | '' | 'hidden' | 'until-found' | undefined hidden?: Booleanish | '' | 'hidden' | 'until-found' | undefined
id?: string | undefined id?: string | undefined
inert?: Booleanish | undefined inert?: Booleanish | undefined
@ -359,14 +346,6 @@ export interface HTMLAttributes extends AriaAttributes, EventHandlers<Events> {
* @see https://html.spec.whatwg.org/multipage/custom-elements.html#attr-is * @see https://html.spec.whatwg.org/multipage/custom-elements.html#attr-is
*/ */
is?: string | undefined is?: string | undefined
/**
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/exportparts
*/
exportparts?: string
/**
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/part
*/
part?: string
} }
type HTMLAttributeReferrerPolicy = type HTMLAttributeReferrerPolicy =
@ -519,7 +498,6 @@ export interface ImgHTMLAttributes extends HTMLAttributes {
alt?: string | undefined alt?: string | undefined
crossorigin?: 'anonymous' | 'use-credentials' | '' | undefined crossorigin?: 'anonymous' | 'use-credentials' | '' | undefined
decoding?: 'async' | 'auto' | 'sync' | undefined decoding?: 'async' | 'auto' | 'sync' | undefined
fetchpriority?: 'high' | 'low' | 'auto' | undefined
height?: Numberish | undefined height?: Numberish | undefined
loading?: 'eager' | 'lazy' | undefined loading?: 'eager' | 'lazy' | undefined
referrerpolicy?: HTMLAttributeReferrerPolicy | undefined referrerpolicy?: HTMLAttributeReferrerPolicy | undefined
@ -569,6 +547,15 @@ export interface InputHTMLAttributes extends HTMLAttributes {
checked?: Booleanish | any[] | Set<any> | undefined // for IDE v-model multi-checkbox support checked?: Booleanish | any[] | Set<any> | undefined // for IDE v-model multi-checkbox support
crossorigin?: string | undefined crossorigin?: string | undefined
disabled?: Booleanish | undefined disabled?: Booleanish | undefined
enterKeyHint?:
| 'enter'
| 'done'
| 'go'
| 'next'
| 'previous'
| 'search'
| 'send'
| undefined
form?: string | undefined form?: string | undefined
formaction?: string | undefined formaction?: string | undefined
formenctype?: string | undefined formenctype?: string | undefined
@ -1301,7 +1288,6 @@ export interface IntrinsicElementAttributes {
polyline: SVGAttributes polyline: SVGAttributes
radialGradient: SVGAttributes radialGradient: SVGAttributes
rect: SVGAttributes rect: SVGAttributes
set: SVGAttributes
stop: SVGAttributes stop: SVGAttributes
switch: SVGAttributes switch: SVGAttributes
symbol: SVGAttributes symbol: SVGAttributes

View File

@ -1,6 +1,6 @@
{ {
"name": "@vue/server-renderer", "name": "@vue/server-renderer",
"version": "3.5.24", "version": "3.5.23",
"description": "@vue/server-renderer", "description": "@vue/server-renderer",
"main": "index.js", "main": "index.js",
"module": "dist/server-renderer.esm-bundler.js", "module": "dist/server-renderer.esm-bundler.js",

View File

@ -1,6 +1,6 @@
{ {
"name": "@vue/shared", "name": "@vue/shared",
"version": "3.5.24", "version": "3.5.23",
"description": "internal utils shared across @vue packages", "description": "internal utils shared across @vue packages",
"main": "index.js", "main": "index.js",
"module": "dist/shared.esm-bundler.js", "module": "dist/shared.esm-bundler.js",

View File

@ -1,6 +1,6 @@
{ {
"name": "@vue/compat", "name": "@vue/compat",
"version": "3.5.24", "version": "3.5.23",
"description": "Vue 3 compatibility build for Vue 2", "description": "Vue 3 compatibility build for Vue 2",
"main": "index.js", "main": "index.js",
"module": "dist/vue.runtime.esm-bundler.js", "module": "dist/vue.runtime.esm-bundler.js",

View File

@ -1,6 +1,6 @@
{ {
"name": "vue", "name": "vue",
"version": "3.5.24", "version": "3.5.23",
"description": "The progressive JavaScript framework for building modern web UI.", "description": "The progressive JavaScript framework for building modern web UI.",
"main": "index.js", "main": "index.js",
"module": "dist/vue.runtime.esm-bundler.js", "module": "dist/vue.runtime.esm-bundler.js",