wip: template binding optimization

This commit is contained in:
Evan You
2020-07-10 22:12:25 -04:00
parent b51b79f5c4
commit b6cdd5621e
12 changed files with 81 additions and 30 deletions

View File

@@ -57,6 +57,10 @@ export type HoistTransform = (
parent: ParentNode
) => void
export interface BindingMetadata {
[key: string]: 'data' | 'props' | 'setup' | 'options'
}
export interface TransformOptions {
/**
* An array of node transforms to be applied to every AST node.
@@ -122,6 +126,11 @@ export interface TransformOptions {
* `ssrRender` option instead of `render`.
*/
ssr?: boolean
/**
* Optional binding metadata analyzed from script - used to optimize
* binding access when `prefixIdentifiers` is enabled.
*/
bindingMetadata?: BindingMetadata
onError?: (error: CompilerError) => void
}
@@ -169,6 +178,7 @@ export interface CodegenOptions {
runtimeGlobalName?: string
// we need to know this during codegen to generate proper preambles
prefixIdentifiers?: boolean
bindingMetadata?: BindingMetadata
// generate ssr-specific code?
ssr?: boolean
}