/**
* (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().
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
# @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
rootRefs: string[]
importedHelpers: string[]
} {
- // TODO remove when out of experimental
warnExperimental()
const userImports: Record<string, ImportBinding> = Object.create(null)
}
}
}
-
- // 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) {
}
}
-const RFC_LINK = `https://github.com/vuejs/rfcs/discussions/369`
const hasWarned: Record<string, boolean> = {}
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`
)
}