Skip to content

Commit

Permalink
chore: mark reactivity transform apis as deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed May 19, 2023
1 parent f0691e4 commit 372ec35
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/compiler-sfc/src/index.ts
Expand Up @@ -7,6 +7,8 @@ export { compileStyle, compileStyleAsync } from './compileStyle'
export { compileScript } from './compileScript'
export { rewriteDefault, rewriteDefaultAST } from './rewriteDefault'
export { resolveTypeElements, inferRuntimeType } from './script/resolveType'

// TODO remove in 3.4
export {
shouldTransform as shouldTransformRef,
transform as transformRef,
Expand Down
9 changes: 9 additions & 0 deletions packages/reactivity-transform/src/reactivityTransform.ts
Expand Up @@ -33,6 +33,9 @@ const IMPORT_SOURCE = 'vue/macros'
const shorthands = ['ref', 'computed', 'shallowRef', 'toRef', 'customRef']
const transformCheckRE = /[^\w]\$(?:\$|ref|computed|shallowRef)?\s*(\(|\<)/

/**
* @deprecated will be removed in 3.4
*/
export function shouldTransform(src: string): boolean {
return transformCheckRE.test(src)
}
Expand Down Expand Up @@ -64,6 +67,9 @@ export interface ImportBinding {
specifier: ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier
}

/**
* @deprecated will be removed in 3.4
*/
export function transform(
src: string,
{
Expand Down Expand Up @@ -112,6 +118,9 @@ export function transform(
}
}

/**
* @deprecated will be removed in 3.4
*/
export function transformAST(
ast: Program,
s: MagicString,
Expand Down

0 comments on commit 372ec35

Please sign in to comment.