import { CompilerError, defaultOnError } from './errors'
import { TO_STRING, COMMENT, CREATE_VNODE, FRAGMENT } from './runtimeConstants'
import { isVSlot, createBlockExpression, isSlotOutlet } from './utils'
-import { hoistStaticTrees } from './transforms/hoistStatic'
+import { hoistStatic } from './transforms/hoistStatic'
// There are two types of transforms:
//
nodeTransforms?: NodeTransform[]
directiveTransforms?: { [name: string]: DirectiveTransform }
prefixIdentifiers?: boolean
- hoistStaticTrees?: boolean
+ hoistStatic?: boolean
onError?: (error: CompilerError) => void
}
root: RootNode,
{
prefixIdentifiers = false,
- hoistStaticTrees = false,
+ hoistStatic = false,
nodeTransforms = [],
directiveTransforms = {},
onError = defaultOnError
vOnce: 0
},
prefixIdentifiers,
- hoistStaticTrees,
+ hoistStatic,
nodeTransforms,
directiveTransforms,
onError,
export function transform(root: RootNode, options: TransformOptions) {
const context = createTransformContext(root, options)
traverseNode(root, context)
- if (options.hoistStaticTrees) {
- hoistStaticTrees(root, context)
+ if (options.hoistStatic) {
+ hoistStatic(root, context)
}
finalizeRoot(root, context)
}
import { CREATE_VNODE } from '../runtimeConstants'
import { PropsExpression } from './transformElement'
-export function hoistStaticTrees(root: RootNode, context: TransformContext) {
+export function hoistStatic(root: RootNode, context: TransformContext) {
walk(root.children, context, new Set<TemplateChildNode>())
}