Home / File/ render-context.ts — vue Source File

render-context.ts — vue Source File

Architecture documentation for render-context.ts, a typescript file in the vue codebase. 3 imports, 1 dependents.

File typescript ServerRenderer BundleRenderer 3 imports 1 dependents 1 functions 1 classes

Entity Profile

Dependency Diagram

graph LR
  a6a05c58_4962_0886_8e94_eeaa15c02b42["render-context.ts"]
  973389ac_8625_30a3_53ce_b1b48fae58c5["vnode"]
  a6a05c58_4962_0886_8e94_eeaa15c02b42 --> 973389ac_8625_30a3_53ce_b1b48fae58c5
  09aa5370_2caa_6b33_3f44_6ac5211bd11b["util"]
  a6a05c58_4962_0886_8e94_eeaa15c02b42 --> 09aa5370_2caa_6b33_3f44_6ac5211bd11b
  64c87498_c46a_6944_ab9d_8e45519852a8["component"]
  a6a05c58_4962_0886_8e94_eeaa15c02b42 --> 64c87498_c46a_6944_ab9d_8e45519852a8
  439dcf36_0570_3186_196e_91c09d6d3ea6["render.ts"]
  439dcf36_0570_3186_196e_91c09d6d3ea6 --> a6a05c58_4962_0886_8e94_eeaa15c02b42
  style a6a05c58_4962_0886_8e94_eeaa15c02b42 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import VNode from 'core/vdom/vnode'
import { isUndef } from 'shared/util'
import { Component } from 'types/component'

type RenderState =
  | {
      type: 'Element'
      rendered: number
      total: number
      children: Array<VNode>
      endTag: string
    }
  | {
      type: 'Fragment'
      rendered: number
      total: number
      children: Array<VNode>
    }
  | {
      type: 'Component'
      prevActive: Component
    }
  | {
      type: 'ComponentWithCache'
      buffer: Array<string>
      bufferIndex: number
      componentBuffer: Array<Set<Component>>
      key: string
    }

export class RenderContext {
  userContext: Record<string, any> | null
  activeInstance: Component
  renderStates: Array<RenderState>
  write: (text: string, next: Function) => void
  renderNode: (node: VNode, isRoot: boolean, context: RenderContext) => void
  done: (err?: Error) => void

  modules: Array<(node: VNode) => string | null>
  directives: Object
  isUnaryTag: (tag: string) => boolean

  cache: any
  get?: (key: string, cb: Function) => void
  has?: (key: string, cb: Function) => void

  constructor(options: Record<string, any>) {
    this.userContext = options.userContext
    this.activeInstance = options.activeInstance
    this.renderStates = []

    this.write = options.write
    this.done = options.done
    this.renderNode = options.renderNode

    this.isUnaryTag = options.isUnaryTag
    this.modules = options.modules
    this.directives = options.directives

    const cache = options.cache
// ... (75 more lines)

Subdomains

Functions

Classes

Types

Dependencies

  • component
  • util
  • vnode

Frequently Asked Questions

What does render-context.ts do?
render-context.ts is a source file in the vue codebase, written in typescript. It belongs to the ServerRenderer domain, BundleRenderer subdomain.
What functions are defined in render-context.ts?
render-context.ts defines 1 function(s): normalizeAsync.
What does render-context.ts depend on?
render-context.ts imports 3 module(s): component, util, vnode.
What files import render-context.ts?
render-context.ts is imported by 1 file(s): render.ts.
Where is render-context.ts in the architecture?
render-context.ts is located at packages/server-renderer/src/render-context.ts (domain: ServerRenderer, subdomain: BundleRenderer, directory: packages/server-renderer/src).

Analyze Your Own Codebase

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

Try Supermodel Free