diff --git a/packages/compiler-sfc/src/compileScript.ts b/packages/compiler-sfc/src/compileScript.ts index b7e4c0ea778..310a9e374ec 100644 --- a/packages/compiler-sfc/src/compileScript.ts +++ b/packages/compiler-sfc/src/compileScript.ts @@ -91,26 +91,11 @@ export interface SFCScriptCompileOptions { /** * (Experimental) Enable syntax transform for using refs without `.value` and * using destructured props with reactivity + * @deprecated the Reactivity Transform proposal has been dropped. This + * feature will be removed from Vue core in 3.4. If you intend to continue + * using it, disable this and switch to the [Vue Macros implementation](https://vue-macros.sxzz.moe/features/reactivity-transform.html). */ reactivityTransform?: boolean - /** - * (Experimental) Enable syntax transform for using refs without `.value` - * https://github.com/vuejs/rfcs/discussions/369 - * @deprecated now part of `reactivityTransform` - * @default false - */ - refTransform?: boolean - /** - * (Experimental) Enable syntax transform for destructuring from defineProps() - * https://github.com/vuejs/rfcs/discussions/394 - * @deprecated now part of `reactivityTransform` - * @default false - */ - propsDestructureTransform?: boolean - /** - * @deprecated use `reactivityTransform` instead. - */ - refSugar?: boolean /** * Compile the template and inline the resulting render function * directly inside setup(). @@ -154,12 +139,8 @@ export function compileScript( let { script, scriptSetup, source, filename } = sfc // feature flags // TODO remove support for deprecated options when out of experimental - const enableReactivityTransform = - !!options.reactivityTransform || - !!options.refSugar || - !!options.refTransform - const enablePropsTransform = - !!options.reactivityTransform || !!options.propsDestructureTransform + const enableReactivityTransform = !!options.reactivityTransform + const enablePropsTransform = !!options.reactivityTransform const isProd = !!options.isProd const genSourceMap = options.sourceMap !== false let refBindings: string[] | undefined diff --git a/packages/reactivity-transform/README.md b/packages/reactivity-transform/README.md index 92277a8b288..931702b3b0d 100644 --- a/packages/reactivity-transform/README.md +++ b/packages/reactivity-transform/README.md @@ -1,8 +1,10 @@ # @vue/reactivity-transform -> ⚠️ This is experimental and currently only provided for testing and feedback. It may break during patches or even be removed. Use at your own risk! +> ⚠️ This is experimental and the proposal has been dropped. +> The feature is now marked as deprecated and will be removed from Vue core +> in 3.4. > -> Follow https://github.com/vuejs/rfcs/discussions/369 for details and updates. +> See reason for deprecation [here](https://github.com/vuejs/rfcs/discussions/369#discussioncomment-5059028). ## Basic Rules diff --git a/packages/reactivity-transform/src/reactivityTransform.ts b/packages/reactivity-transform/src/reactivityTransform.ts index 4223df527fc..16cf88e5ac8 100644 --- a/packages/reactivity-transform/src/reactivityTransform.ts +++ b/packages/reactivity-transform/src/reactivityTransform.ts @@ -129,7 +129,6 @@ export function transformAST( rootRefs: string[] importedHelpers: string[] } { - // TODO remove when out of experimental warnExperimental() const userImports: Record = Object.create(null) @@ -729,22 +728,6 @@ export function transformAST( } } } - - // TODO remove when out of experimental - if (callee === '$raw') { - error( - `$raw() has been replaced by $$(). ` + - `See ${RFC_LINK} for latest updates.`, - node - ) - } - if (callee === '$fromRef') { - error( - `$fromRef() has been replaced by $(). ` + - `See ${RFC_LINK} for latest updates.`, - node - ) - } } }, leave(node: Node, parent?: Node) { @@ -771,7 +754,6 @@ export function transformAST( } } -const RFC_LINK = `https://github.com/vuejs/rfcs/discussions/369` const hasWarned: Record = {} function warnExperimental() { @@ -780,10 +762,10 @@ function warnExperimental() { return } warnOnce( - `Reactivity transform is an experimental feature.\n` + - `Experimental features may change behavior between patch versions.\n` + - `It is recommended to pin your vue dependencies to exact versions to avoid breakage.\n` + - `You can follow the proposal's status at ${RFC_LINK}.` + `Reactivity Transform was an experimental feature and has now been deprecated. ` + + `It will be removed from Vue core in 3.4. If you intend to continue using it, ` + + `switch to https://vue-macros.sxzz.moe/features/reactivity-transform.html.\n` + + `See reason for deprecation here: https://github.com/vuejs/rfcs/discussions/369#discussioncomment-5059028` ) }