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 CompilerSFC StyleProcessor 1 imports 1 dependents 4 functions

Entity Profile

Dependency Diagram

graph LR
  f560c9f4_8dee_e0de_543a_3e1999e5b868["compiler.ts"]
  1eb2f1f6_ab9d_0f9b_7050_d8d983ed4e04["types"]
  f560c9f4_8dee_e0de_543a_3e1999e5b868 --> 1eb2f1f6_ab9d_0f9b_7050_d8d983ed4e04
  8c54f2a2_a72b_0919_f6c3_bb6b0e61fdae["vnode.ts"]
  8c54f2a2_a72b_0919_f6c3_bb6b0e61fdae --> f560c9f4_8dee_e0de_543a_3e1999e5b868
  style f560c9f4_8dee_e0de_543a_3e1999e5b868 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 CompilerSFC domain, StyleProcessor 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: CompilerSFC, subdomain: StyleProcessor, directory: src/types).

Analyze Your Own Codebase

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

Try Supermodel Free