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 CoreRuntime Instance 14 imports 2 dependents 3 functions

Entity Profile

Dependency Diagram

graph LR
  a8c0285c_59b2_d81b_1af0_c0cd9c2afe2d["render.ts"]
  2a298df2_21b8_7e5a_c372_51ba50c9d92d["index.ts"]
  a8c0285c_59b2_d81b_1af0_c0cd9c2afe2d --> 2a298df2_21b8_7e5a_c372_51ba50c9d92d
  ed56e0c4_2667_3b26_6b70_35cd51b08810["create-element.ts"]
  a8c0285c_59b2_d81b_1af0_c0cd9c2afe2d --> ed56e0c4_2667_3b26_6b70_35cd51b08810
  2c55eb58_ce03_1c5e_ac99_4fc1ef41c3cd["createElement"]
  a8c0285c_59b2_d81b_1af0_c0cd9c2afe2d --> 2c55eb58_ce03_1c5e_ac99_4fc1ef41c3cd
  8456d994_c5db_04c1_7466_74c5274c4133["index.ts"]
  a8c0285c_59b2_d81b_1af0_c0cd9c2afe2d --> 8456d994_c5db_04c1_7466_74c5274c4133
  73f108f4_8cd2_0f8d_324a_421770bd17ea["installRenderHelpers"]
  a8c0285c_59b2_d81b_1af0_c0cd9c2afe2d --> 73f108f4_8cd2_0f8d_324a_421770bd17ea
  f7e6d498_cf3b_d729_68d1_b772bf90e35f["resolve-slots.ts"]
  a8c0285c_59b2_d81b_1af0_c0cd9c2afe2d --> f7e6d498_cf3b_d729_68d1_b772bf90e35f
  23d9ce46_8163_f008_2464_0fc0040f465c["resolveSlots"]
  a8c0285c_59b2_d81b_1af0_c0cd9c2afe2d --> 23d9ce46_8163_f008_2464_0fc0040f465c
  81712410_81a9_d297_5ff3_adabfc4f54fd["normalize-scoped-slots.ts"]
  a8c0285c_59b2_d81b_1af0_c0cd9c2afe2d --> 81712410_81a9_d297_5ff3_adabfc4f54fd
  1e1e5127_e2df_8612_b7e7_d738cde5407a["normalizeScopedSlots"]
  a8c0285c_59b2_d81b_1af0_c0cd9c2afe2d --> 1e1e5127_e2df_8612_b7e7_d738cde5407a
  a13b4a2c_7af7_bcfd_03a9_13286f908ca0["vnode.ts"]
  a8c0285c_59b2_d81b_1af0_c0cd9c2afe2d --> a13b4a2c_7af7_bcfd_03a9_13286f908ca0
  f3560440_54c1_5663_36f8_c7de54d7310b["lifecycle.ts"]
  a8c0285c_59b2_d81b_1af0_c0cd9c2afe2d --> f3560440_54c1_5663_36f8_c7de54d7310b
  907f4994_ea28_43b1_7976_0db9f0e97637["component"]
  a8c0285c_59b2_d81b_1af0_c0cd9c2afe2d --> 907f4994_ea28_43b1_7976_0db9f0e97637
  5de22f6c_6406_d60a_f5e8_6b3e166124cc["currentInstance"]
  a8c0285c_59b2_d81b_1af0_c0cd9c2afe2d --> 5de22f6c_6406_d60a_f5e8_6b3e166124cc
  648c881d_0a8b_2e54_833a_913760ae9a68["apiSetup"]
  a8c0285c_59b2_d81b_1af0_c0cd9c2afe2d --> 648c881d_0a8b_2e54_833a_913760ae9a68
  style a8c0285c_59b2_d81b_1af0_c0cd9c2afe2d 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 CoreRuntime 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: CoreRuntime, 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