Home / File/ render.ts — vue Source File

render.ts — vue Source File

Architecture documentation for render.ts, a typescript file in the vue codebase. 14 imports, 2 dependents.

File typescript VueCore Instance 14 imports 2 dependents 3 functions

Entity Profile

Dependency Diagram

graph LR
  2c65c43e_4691_415f_689a_805ec38ae46c["render.ts"]
  76672dd6_4e87_4468_a48b_f4da793fd211["index.ts"]
  2c65c43e_4691_415f_689a_805ec38ae46c --> 76672dd6_4e87_4468_a48b_f4da793fd211
  4b23edff_adcb_6cfb_ca7d_b6d38b4a1921["create-element.ts"]
  2c65c43e_4691_415f_689a_805ec38ae46c --> 4b23edff_adcb_6cfb_ca7d_b6d38b4a1921
  02c4c5f0_14bc_07b8_fddc_e3511462f997["createElement"]
  2c65c43e_4691_415f_689a_805ec38ae46c --> 02c4c5f0_14bc_07b8_fddc_e3511462f997
  8ffc8513_97a6_feaa_6bc2_e31c949e66cd["index.ts"]
  2c65c43e_4691_415f_689a_805ec38ae46c --> 8ffc8513_97a6_feaa_6bc2_e31c949e66cd
  d77f5342_b1e8_4d01_7f2b_c320dfa66cc5["installRenderHelpers"]
  2c65c43e_4691_415f_689a_805ec38ae46c --> d77f5342_b1e8_4d01_7f2b_c320dfa66cc5
  d1e549a1_8d2d_9fe4_1d06_3f7035b5e697["resolve-slots.ts"]
  2c65c43e_4691_415f_689a_805ec38ae46c --> d1e549a1_8d2d_9fe4_1d06_3f7035b5e697
  104d091a_5520_5f91_df65_4a79135c9791["resolveSlots"]
  2c65c43e_4691_415f_689a_805ec38ae46c --> 104d091a_5520_5f91_df65_4a79135c9791
  091d06a8_6793_746a_7499_d22a1d025196["normalize-scoped-slots.ts"]
  2c65c43e_4691_415f_689a_805ec38ae46c --> 091d06a8_6793_746a_7499_d22a1d025196
  e490d83e_fe82_d38d_a362_5157771a3160["normalizeScopedSlots"]
  2c65c43e_4691_415f_689a_805ec38ae46c --> e490d83e_fe82_d38d_a362_5157771a3160
  5164a61d_92b2_9c7f_8acb_b18093afdb59["vnode.ts"]
  2c65c43e_4691_415f_689a_805ec38ae46c --> 5164a61d_92b2_9c7f_8acb_b18093afdb59
  d937f76e_061f_a631_9587_336503c9a15c["lifecycle.ts"]
  2c65c43e_4691_415f_689a_805ec38ae46c --> d937f76e_061f_a631_9587_336503c9a15c
  64c87498_c46a_6944_ab9d_8e45519852a8["component"]
  2c65c43e_4691_415f_689a_805ec38ae46c --> 64c87498_c46a_6944_ab9d_8e45519852a8
  72fd8695_a700_b0bb_c497_9baf5b0b19e0["currentInstance"]
  2c65c43e_4691_415f_689a_805ec38ae46c --> 72fd8695_a700_b0bb_c497_9baf5b0b19e0
  43c3281b_9e19_70a9_3981_1b8502959f5d["apiSetup"]
  2c65c43e_4691_415f_689a_805ec38ae46c --> 43c3281b_9e19_70a9_3981_1b8502959f5d
  style 2c65c43e_4691_415f_689a_805ec38ae46c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import {
  warn,
  nextTick,
  emptyObject,
  handleError,
  defineReactive,
  isArray
} from '../util/index'

import { createElement } from '../vdom/create-element'
import { installRenderHelpers } from './render-helpers/index'
import { resolveSlots } from './render-helpers/resolve-slots'
import { normalizeScopedSlots } from '../vdom/helpers/normalize-scoped-slots'
import VNode, { createEmptyVNode } from '../vdom/vnode'

import { isUpdatingChildComponent } from './lifecycle'
import type { Component } from 'types/component'
import { currentInstance, setCurrentInstance } from 'v3/currentInstance'
import { syncSetupSlots } from 'v3/apiSetup'

export function initRender(vm: Component) {
  vm._vnode = null // the root of the child tree
  vm._staticTrees = null // v-once cached trees
  const options = vm.$options
  const parentVnode = (vm.$vnode = options._parentVnode!) // the placeholder node in parent tree
  const renderContext = parentVnode && (parentVnode.context as Component)
  vm.$slots = resolveSlots(options._renderChildren, renderContext)
  vm.$scopedSlots = parentVnode
    ? normalizeScopedSlots(
        vm.$parent!,
        parentVnode.data!.scopedSlots,
        vm.$slots
      )
    : emptyObject
  // bind the createElement fn to this instance
  // so that we get proper render context inside it.
  // args order: tag, data, children, normalizationType, alwaysNormalize
  // internal version is used by render functions compiled from templates
  // @ts-expect-error
  vm._c = (a, b, c, d) => createElement(vm, a, b, c, d, false)
  // normalization is always applied for the public version, used in
  // user-written render functions.
  // @ts-expect-error
  vm.$createElement = (a, b, c, d) => createElement(vm, a, b, c, d, true)

  // $attrs & $listeners are exposed for easier HOC creation.
  // they need to be reactive so that HOCs using them are always updated
  const parentData = parentVnode && parentVnode.data

  /* istanbul ignore else */
  if (__DEV__) {
    defineReactive(
      vm,
      '$attrs',
      (parentData && parentData.attrs) || emptyObject,
      () => {
        !isUpdatingChildComponent && warn(`$attrs is readonly.`, vm)
      },
      true
    )
// ... (113 more lines)

Domain

Subdomains

Frequently Asked Questions

What does render.ts do?
render.ts is a source file in the vue codebase, written in typescript. It belongs to the VueCore domain, Instance subdomain.
What functions are defined in render.ts?
render.ts defines 3 function(s): initRender, renderMixin, setCurrentRenderingInstance.
What does render.ts depend on?
render.ts imports 14 module(s): apiSetup, component, create-element.ts, createElement, currentInstance, index.ts, index.ts, installRenderHelpers, and 6 more.
What files import render.ts?
render.ts is imported by 2 file(s): index.ts, init.ts.
Where is render.ts in the architecture?
render.ts is located at src/core/instance/render.ts (domain: VueCore, subdomain: Instance, directory: src/core/instance).

Analyze Your Own Codebase

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

Try Supermodel Free