Home / File/ create-functional-component.ts — vue Source File

create-functional-component.ts — vue Source File

Architecture documentation for create-functional-component.ts, a typescript file in the vue codebase. 16 imports, 1 dependents.

File typescript CoreRuntime Instance 16 imports 1 dependents 4 functions

Entity Profile

Dependency Diagram

graph LR
  dfa00dc1_b5e1_fc4b_364c_221e22660e03["create-functional-component.ts"]
  a13b4a2c_7af7_bcfd_03a9_13286f908ca0["vnode.ts"]
  dfa00dc1_b5e1_fc4b_364c_221e22660e03 --> a13b4a2c_7af7_bcfd_03a9_13286f908ca0
  ed56e0c4_2667_3b26_6b70_35cd51b08810["create-element.ts"]
  dfa00dc1_b5e1_fc4b_364c_221e22660e03 --> ed56e0c4_2667_3b26_6b70_35cd51b08810
  2c55eb58_ce03_1c5e_ac99_4fc1ef41c3cd["createElement"]
  dfa00dc1_b5e1_fc4b_364c_221e22660e03 --> 2c55eb58_ce03_1c5e_ac99_4fc1ef41c3cd
  4ac7e661_4a8f_08cb_4f7e_e4704e6ee6bd["inject.ts"]
  dfa00dc1_b5e1_fc4b_364c_221e22660e03 --> 4ac7e661_4a8f_08cb_4f7e_e4704e6ee6bd
  38a042a8_e008_9381_562a_4c9fe664057e["resolveInject"]
  dfa00dc1_b5e1_fc4b_364c_221e22660e03 --> 38a042a8_e008_9381_562a_4c9fe664057e
  d69da2e1_41ea_0fe7_418f_f2b93ff8744d["normalize-children.ts"]
  dfa00dc1_b5e1_fc4b_364c_221e22660e03 --> d69da2e1_41ea_0fe7_418f_f2b93ff8744d
  525c172b_db5f_072d_3b30_fb5ba93487bb["normalizeChildren"]
  dfa00dc1_b5e1_fc4b_364c_221e22660e03 --> 525c172b_db5f_072d_3b30_fb5ba93487bb
  f7e6d498_cf3b_d729_68d1_b772bf90e35f["resolve-slots.ts"]
  dfa00dc1_b5e1_fc4b_364c_221e22660e03 --> f7e6d498_cf3b_d729_68d1_b772bf90e35f
  23d9ce46_8163_f008_2464_0fc0040f465c["resolveSlots"]
  dfa00dc1_b5e1_fc4b_364c_221e22660e03 --> 23d9ce46_8163_f008_2464_0fc0040f465c
  81712410_81a9_d297_5ff3_adabfc4f54fd["normalize-scoped-slots.ts"]
  dfa00dc1_b5e1_fc4b_364c_221e22660e03 --> 81712410_81a9_d297_5ff3_adabfc4f54fd
  1e1e5127_e2df_8612_b7e7_d738cde5407a["normalizeScopedSlots"]
  dfa00dc1_b5e1_fc4b_364c_221e22660e03 --> 1e1e5127_e2df_8612_b7e7_d738cde5407a
  8456d994_c5db_04c1_7466_74c5274c4133["index.ts"]
  dfa00dc1_b5e1_fc4b_364c_221e22660e03 --> 8456d994_c5db_04c1_7466_74c5274c4133
  73f108f4_8cd2_0f8d_324a_421770bd17ea["installRenderHelpers"]
  dfa00dc1_b5e1_fc4b_364c_221e22660e03 --> 73f108f4_8cd2_0f8d_324a_421770bd17ea
  2a298df2_21b8_7e5a_c372_51ba50c9d92d["index.ts"]
  dfa00dc1_b5e1_fc4b_364c_221e22660e03 --> 2a298df2_21b8_7e5a_c372_51ba50c9d92d
  style dfa00dc1_b5e1_fc4b_364c_221e22660e03 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import VNode, { cloneVNode } from './vnode'
import { createElement } from './create-element'
import { resolveInject } from '../instance/inject'
import { normalizeChildren } from '../vdom/helpers/normalize-children'
import { resolveSlots } from '../instance/render-helpers/resolve-slots'
import { normalizeScopedSlots } from '../vdom/helpers/normalize-scoped-slots'
import { installRenderHelpers } from '../instance/render-helpers/index'

import {
  isDef,
  isTrue,
  hasOwn,
  isArray,
  camelize,
  emptyObject,
  validateProp
} from '../util/index'
import type { Component } from 'types/component'
import type { VNodeData } from 'types/vnode'

export function FunctionalRenderContext(
  data: VNodeData,
  props: Object,
  children: Array<VNode> | undefined,
  parent: Component,
  Ctor: typeof Component
) {
  const options = Ctor.options
  // ensure the createElement function in functional components
  // gets a unique context - this is necessary for correct named slot check
  let contextVm
  if (hasOwn(parent, '_uid')) {
    contextVm = Object.create(parent)
    contextVm._original = parent
  } else {
    // the context vm passed in is a functional context as well.
    // in this case we want to make sure we are able to get a hold to the
    // real context instance.
    contextVm = parent
    // @ts-ignore
    parent = parent._original
  }
  const isCompiled = isTrue(options._compiled)
  const needNormalization = !isCompiled

  this.data = data
  this.props = props
  this.children = children
  this.parent = parent
  this.listeners = data.on || emptyObject
  this.injections = resolveInject(options.inject, parent)
  this.slots = () => {
    if (!this.$slots) {
      normalizeScopedSlots(
        parent,
        data.scopedSlots,
        (this.$slots = resolveSlots(children, parent))
      )
    }
    return this.$slots
// ... (121 more lines)

Domain

Subdomains

Frequently Asked Questions

What does create-functional-component.ts do?
create-functional-component.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 create-functional-component.ts?
create-functional-component.ts defines 4 function(s): FunctionalRenderContext, cloneAndMarkFunctionalResult, createFunctionalComponent, mergeProps.
What does create-functional-component.ts depend on?
create-functional-component.ts imports 16 module(s): component, create-element.ts, createElement, index.ts, index.ts, inject.ts, installRenderHelpers, normalize-children.ts, and 8 more.
What files import create-functional-component.ts?
create-functional-component.ts is imported by 1 file(s): create-component.ts.
Where is create-functional-component.ts in the architecture?
create-functional-component.ts is located at src/core/vdom/create-functional-component.ts (domain: CoreRuntime, subdomain: Instance, directory: src/core/vdom).

Analyze Your Own Codebase

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

Try Supermodel Free