diff --git a/packages/compiler-sfc/__tests__/compileScript/defineModel.spec.ts b/packages/compiler-sfc/__tests__/compileScript/defineModel.spec.ts index 46890109cd1..45e5be895dd 100644 --- a/packages/compiler-sfc/__tests__/compileScript/defineModel.spec.ts +++ b/packages/compiler-sfc/__tests__/compileScript/defineModel.spec.ts @@ -10,8 +10,7 @@ describe('defineModel()', () => { const c = defineModel('count') const toString = defineModel('toString', { type: Function }) - `, - { defineModel: true } + ` ) assertCode(content) expect(content).toMatch('props: {') @@ -44,8 +43,7 @@ describe('defineModel()', () => { defineEmits(['change']) const count = defineModel({ default: 0 }) - `, - { defineModel: true } + ` ) assertCode(content) expect(content).toMatch(`props: /*#__PURE__*/_mergeModels({ foo: String }`) @@ -66,8 +64,7 @@ describe('defineModel()', () => { defineProps(['foo', 'bar']) const count = defineModel('count') - `, - { defineModel: true } + ` ) assertCode(content) expect(content).toMatch(`props: /*#__PURE__*/_mergeModels(['foo', 'bar'], { @@ -94,8 +91,7 @@ describe('defineModel()', () => { const local = true const hoist = defineModel('hoist', { local }) - `, - { defineModel: true } + ` ) assertCode(content) expect(content).toMatch(`_useModel(__props, "modelValue", { local: true })`) @@ -115,8 +111,7 @@ describe('defineModel()', () => { const disabled = defineModel('disabled', { required: false }) const any = defineModel('any') - `, - { defineModel: true } + ` ) assertCode(content) expect(content).toMatch('"modelValue": { type: [Boolean, String] }') @@ -155,7 +150,7 @@ describe('defineModel()', () => { const optional = defineModel('optional', { required: false }) `, - { defineModel: true, isProd: true } + { isProd: true } ) assertCode(content) expect(content).toMatch('"modelValue": { type: Boolean }') diff --git a/packages/compiler-sfc/src/compileScript.ts b/packages/compiler-sfc/src/compileScript.ts index 1783c6db9ee..3d232bcc637 100644 --- a/packages/compiler-sfc/src/compileScript.ts +++ b/packages/compiler-sfc/src/compileScript.ts @@ -98,11 +98,6 @@ export interface SFCScriptCompileOptions { * @default true */ hoistStatic?: boolean - /** - * (**Experimental**) Enable macro `defineModel` - * @default false - */ - defineModel?: boolean /** * (**Experimental**) Enable reactive destructure for `defineProps` * @default false diff --git a/packages/compiler-sfc/src/script/defineModel.ts b/packages/compiler-sfc/src/script/defineModel.ts index c104eb306ae..2d1eb523217 100644 --- a/packages/compiler-sfc/src/script/defineModel.ts +++ b/packages/compiler-sfc/src/script/defineModel.ts @@ -8,7 +8,6 @@ import { toRuntimeTypeString } from './utils' import { BindingTypes, unwrapTSNode } from '@vue/compiler-dom' -import { warnOnce } from '../warn' export const DEFINE_MODEL = 'defineModel' @@ -27,21 +26,6 @@ export function processDefineModel( return false } - if (!ctx.options.defineModel) { - warnOnce( - `defineModel() is an experimental feature and disabled by default.\n` + - `To enable it, follow the RFC at https://github.com/vuejs/rfcs/discussions/503.` - ) - return false - } - - warnOnce( - `This project is using defineModel(), which is an experimental ` + - `feature. It may receive breaking changes or be removed in the future, so ` + - `use at your own risk.\n` + - `To stay updated, follow the RFC at https://github.com/vuejs/rfcs/discussions/503.` - ) - ctx.hasDefineModelCall = true const type = diff --git a/packages/runtime-core/src/apiSetupHelpers.ts b/packages/runtime-core/src/apiSetupHelpers.ts index e3910182509..943f21e5f9a 100644 --- a/packages/runtime-core/src/apiSetupHelpers.ts +++ b/packages/runtime-core/src/apiSetupHelpers.ts @@ -217,7 +217,7 @@ export function defineSlots< } /** - * (**Experimental**) Vue `