Home / File/ compiler.ts — vue Source File

compiler.ts — vue Source File

Architecture documentation for compiler.ts, a typescript file in the vue codebase. 1 imports, 1 dependents.

File typescript VueCore GlobalAPI 1 imports 1 dependents 4 functions

Entity Profile

Dependency Diagram

graph LR
  155f72a7_8db4_5e38_a27c_e709852883ee["compiler.ts"]
  ef923298_cc6e_de19_be6c_0cc8a0309511["types"]
  155f72a7_8db4_5e38_a27c_e709852883ee --> ef923298_cc6e_de19_be6c_0cc8a0309511
  648722e5_d55d_648d_6861_55bad881e189["vnode.ts"]
  648722e5_d55d_648d_6861_55bad881e189 --> 155f72a7_8db4_5e38_a27c_e709852883ee
  style 155f72a7_8db4_5e38_a27c_e709852883ee fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { BindingMetadata } from 'sfc/types'

export type CompilerOptions = {
  warn?: Function // allow customizing warning in different environments; e.g. node
  modules?: Array<ModuleOptions> // platform specific modules; e.g. style; class
  directives?: { [key: string]: Function } // platform specific directives
  staticKeys?: string // a list of AST properties to be considered static; for optimization
  isUnaryTag?: (tag: string) => boolean | undefined // check if a tag is unary for the platform
  canBeLeftOpenTag?: (tag: string) => boolean | undefined // check if a tag can be left opened
  isReservedTag?: (tag: string) => boolean | undefined // check if a tag is a native for the platform
  preserveWhitespace?: boolean // preserve whitespace between elements? (Deprecated)
  whitespace?: 'preserve' | 'condense' // whitespace handling strategy
  optimize?: boolean // optimize static content?

  // web specific
  mustUseProp?: (tag: string, type: string | null, name: string) => boolean // check if an attribute should be bound as a property
  isPreTag?: (attr: string) => boolean | null // check if a tag needs to preserve whitespace
  getTagNamespace?: (tag: string) => string | undefined // check the namespace for a tag
  expectHTML?: boolean // only false for non-web builds
  isFromDOM?: boolean
  shouldDecodeTags?: boolean
  shouldDecodeNewlines?: boolean
  shouldDecodeNewlinesForHref?: boolean
  outputSourceRange?: boolean
  shouldKeepComment?: boolean

  // runtime user-configurable
  delimiters?: [string, string] // template delimiters
  comments?: boolean // preserve comments in template

  // for ssr optimization compiler
  scopeId?: string

  // SFC analyzed script bindings from `compileScript()`
  bindings?: BindingMetadata
}

export type WarningMessage = {
  msg: string
  start?: number
  end?: number
}

export type CompiledResult = {
  ast: ASTElement | null
  render: string
  staticRenderFns: Array<string>
  stringRenderFns?: Array<string>
  errors?: Array<string | WarningMessage>
  tips?: Array<string | WarningMessage>
}

export type ModuleOptions = {
  // transform an AST node before any attributes are processed
  // returning an ASTElement from pre/transforms replaces the element
  preTransformNode?: (el: ASTElement) => ASTElement | null | void
  // transform an AST node after built-ins like v-if, v-for are processed
  transformNode?: (el: ASTElement) => ASTElement | null | void
  // transform an AST node after its children have been processed
  // cannot return replacement in postTransform because tree is already finalized
// ... (148 more lines)

Domain

Subdomains

Dependencies

  • types

Imported By

Frequently Asked Questions

What does compiler.ts do?
compiler.ts is a source file in the vue codebase, written in typescript. It belongs to the VueCore domain, GlobalAPI subdomain.
What functions are defined in compiler.ts?
compiler.ts defines 4 function(s): attr, code, el, tag.
What does compiler.ts depend on?
compiler.ts imports 1 module(s): types.
What files import compiler.ts?
compiler.ts is imported by 1 file(s): vnode.ts.
Where is compiler.ts in the architecture?
compiler.ts is located at src/types/compiler.ts (domain: VueCore, subdomain: GlobalAPI, directory: src/types).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free