Home / Function/ generateComponentTrace() — vue Function Reference

generateComponentTrace() — vue Function Reference

Architecture documentation for the generateComponentTrace() function in debug.ts from the vue codebase.

Function typescript VueCore Instance calls 2 called by 2

Entity Profile

Dependency Diagram

graph TD
  09627f77_a9f0_d54c_8a26_ee951d89dfbc["generateComponentTrace()"]
  4be43750_5259_d6e1_902d_9b3e2df2b9c4["debug.ts"]
  09627f77_a9f0_d54c_8a26_ee951d89dfbc -->|defined in| 4be43750_5259_d6e1_902d_9b3e2df2b9c4
  48bc61b1_05ca_3121_50a7_2f02cdcf2f03["warn()"]
  48bc61b1_05ca_3121_50a7_2f02cdcf2f03 -->|calls| 09627f77_a9f0_d54c_8a26_ee951d89dfbc
  8385657d_94f4_6bbf_de2d_c3f62b33c77d["tip()"]
  8385657d_94f4_6bbf_de2d_c3f62b33c77d -->|calls| 09627f77_a9f0_d54c_8a26_ee951d89dfbc
  13e67835_6595_b47a_7f36_3fb9a4164f54["repeat()"]
  09627f77_a9f0_d54c_8a26_ee951d89dfbc -->|calls| 13e67835_6595_b47a_7f36_3fb9a4164f54
  f9fc3444_e4f6_0de8_4a6b_dea19c134650["formatComponentName()"]
  09627f77_a9f0_d54c_8a26_ee951d89dfbc -->|calls| f9fc3444_e4f6_0de8_4a6b_dea19c134650
  style 09627f77_a9f0_d54c_8a26_ee951d89dfbc fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/core/util/debug.ts lines 67–104

  generateComponentTrace = (vm: Component | undefined) => {
    if ((vm as any)._isVue && vm!.$parent) {
      const tree: any[] = []
      let currentRecursiveSequence = 0
      while (vm) {
        if (tree.length > 0) {
          const last = tree[tree.length - 1]
          if (last.constructor === vm.constructor) {
            currentRecursiveSequence++
            vm = vm.$parent!
            continue
          } else if (currentRecursiveSequence > 0) {
            tree[tree.length - 1] = [last, currentRecursiveSequence]
            currentRecursiveSequence = 0
          }
        }
        tree.push(vm)
        vm = vm.$parent!
      }
      return (
        '\n\nfound in\n\n' +
        tree
          .map(
            (vm, i) =>
              `${i === 0 ? '---> ' : repeat(' ', 5 + i * 2)}${
                isArray(vm)
                  ? `${formatComponentName(vm[0])}... (${
                      vm[1]
                    } recursive calls)`
                  : formatComponentName(vm)
              }`
          )
          .join('\n')
      )
    } else {
      return `\n\n(found in ${formatComponentName(vm!)})`
    }
  }

Domain

Subdomains

Called By

Frequently Asked Questions

What does generateComponentTrace() do?
generateComponentTrace() is a function in the vue codebase, defined in src/core/util/debug.ts.
Where is generateComponentTrace() defined?
generateComponentTrace() is defined in src/core/util/debug.ts at line 67.
What does generateComponentTrace() call?
generateComponentTrace() calls 2 function(s): formatComponentName, repeat.
What calls generateComponentTrace()?
generateComponentTrace() is called by 2 function(s): tip, warn.

Analyze Your Own Codebase

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

Try Supermodel Free