Home / File/ parseComponent.ts — vue Source File

parseComponent.ts — vue Source File

Architecture documentation for parseComponent.ts, a typescript file in the vue codebase. 9 imports, 6 dependents.

File typescript CompilerSFC ScriptAnalyzer 9 imports 6 dependents 2 functions

Entity Profile

Dependency Diagram

graph LR
  ecb7777f_63cc_7bf6_1f6a_fedf933d43a4["parseComponent.ts"]
  1502a238_61f0_9afa_8c3c_71d2bb769820["types.ts"]
  ecb7777f_63cc_7bf6_1f6a_fedf933d43a4 --> 1502a238_61f0_9afa_8c3c_71d2bb769820
  3865741e_556d_ec8c_c327_fe6fdcb59cfd["BindingMetadata"]
  ecb7777f_63cc_7bf6_1f6a_fedf933d43a4 --> 3865741e_556d_ec8c_c327_fe6fdcb59cfd
  333cfdf9_515e_e6a3_80fb_5ff2a2c28fe6["RawSourceMap"]
  ecb7777f_63cc_7bf6_1f6a_fedf933d43a4 --> 333cfdf9_515e_e6a3_80fb_5ff2a2c28fe6
  b9f12a63_b611_1b00_0717_3ff21d7ce156["compileScript.ts"]
  ecb7777f_63cc_7bf6_1f6a_fedf933d43a4 --> b9f12a63_b611_1b00_0717_3ff21d7ce156
  bbaa1639_ef4b_ec53_75fd_ad19ee5ab26c["ImportBinding"]
  ecb7777f_63cc_7bf6_1f6a_fedf933d43a4 --> bbaa1639_ef4b_ec53_75fd_ad19ee5ab26c
  9e3539d7_bc2e_5dd1_4fd0_011243ee539e["de-indent"]
  ecb7777f_63cc_7bf6_1f6a_fedf933d43a4 --> 9e3539d7_bc2e_5dd1_4fd0_011243ee539e
  83c0a9fa_ae42_1e64_04f8_e28937d6980e["html-parser"]
  ecb7777f_63cc_7bf6_1f6a_fedf933d43a4 --> 83c0a9fa_ae42_1e64_04f8_e28937d6980e
  156bf2e1_8a13_f22d_5437_54f14bcef8fa["util"]
  ecb7777f_63cc_7bf6_1f6a_fedf933d43a4 --> 156bf2e1_8a13_f22d_5437_54f14bcef8fa
  47ae9f26_59d1_fab2_349f_966f5d15495a["compiler"]
  ecb7777f_63cc_7bf6_1f6a_fedf933d43a4 --> 47ae9f26_59d1_fab2_349f_966f5d15495a
  b9f12a63_b611_1b00_0717_3ff21d7ce156["compileScript.ts"]
  b9f12a63_b611_1b00_0717_3ff21d7ce156 --> ecb7777f_63cc_7bf6_1f6a_fedf933d43a4
  b08241c7_738d_9e08_b885_fad82facd4f3["cssVars.ts"]
  b08241c7_738d_9e08_b885_fad82facd4f3 --> ecb7777f_63cc_7bf6_1f6a_fedf933d43a4
  c09840ce_bc86_fdc3_93a1_cf7e368a9a93["parse.ts"]
  c09840ce_bc86_fdc3_93a1_cf7e368a9a93 --> ecb7777f_63cc_7bf6_1f6a_fedf933d43a4
  1502a238_61f0_9afa_8c3c_71d2bb769820["types.ts"]
  1502a238_61f0_9afa_8c3c_71d2bb769820 --> ecb7777f_63cc_7bf6_1f6a_fedf933d43a4
  eb9ca9a5_0615_aacb_1fe8_010ce4bd0d2e["compileTemplate.spec.ts"]
  eb9ca9a5_0615_aacb_1fe8_010ce4bd0d2e --> ecb7777f_63cc_7bf6_1f6a_fedf933d43a4
  9dc5438b_e4a2_d57a_8bd9_415f662bfceb["parseComponent.spec.ts"]
  9dc5438b_e4a2_d57a_8bd9_415f662bfceb --> ecb7777f_63cc_7bf6_1f6a_fedf933d43a4
  style ecb7777f_63cc_7bf6_1f6a_fedf933d43a4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import deindent from 'de-indent'
import { parseHTML } from 'compiler/parser/html-parser'
import { makeMap } from 'shared/util'
import { ASTAttr, WarningMessage } from 'types/compiler'
import { BindingMetadata, RawSourceMap } from './types'
import type { ImportBinding } from './compileScript'

export const DEFAULT_FILENAME = 'anonymous.vue'

const splitRE = /\r?\n/g
const replaceRE = /./g
const isSpecialTag = makeMap('script,style,template', true)

export interface SFCCustomBlock {
  type: string
  content: string
  attrs: { [key: string]: string | true }
  start: number
  end: number
  src?: string
  map?: RawSourceMap
}

export interface SFCBlock extends SFCCustomBlock {
  lang?: string
  scoped?: boolean
  module?: string | boolean
}

export interface SFCScriptBlock extends SFCBlock {
  type: 'script'
  setup?: string | boolean
  bindings?: BindingMetadata
  imports?: Record<string, ImportBinding>
  /**
   * import('\@babel/types').Statement
   */
  scriptAst?: any[]
  /**
   * import('\@babel/types').Statement
   */
  scriptSetupAst?: any[]
}

export interface SFCDescriptor {
  source: string
  filename: string
  template: SFCBlock | null
  script: SFCScriptBlock | null
  scriptSetup: SFCScriptBlock | null
  styles: SFCBlock[]
  customBlocks: SFCCustomBlock[]
  cssVars: string[]

  errors: (string | WarningMessage)[]

  /**
   * compare with an existing descriptor to determine whether HMR should perform
   * a reload vs. re-render.
   *
// ... (161 more lines)

Domain

Subdomains

Dependencies

Frequently Asked Questions

What does parseComponent.ts do?
parseComponent.ts is a source file in the vue codebase, written in typescript. It belongs to the CompilerSFC domain, ScriptAnalyzer subdomain.
What functions are defined in parseComponent.ts?
parseComponent.ts defines 2 function(s): parseComponent, prevImports.
What does parseComponent.ts depend on?
parseComponent.ts imports 9 module(s): BindingMetadata, ImportBinding, RawSourceMap, compileScript.ts, compiler, de-indent, html-parser, types.ts, and 1 more.
What files import parseComponent.ts?
parseComponent.ts is imported by 6 file(s): compileScript.ts, compileTemplate.spec.ts, cssVars.ts, parse.ts, parseComponent.spec.ts, types.ts.
Where is parseComponent.ts in the architecture?
parseComponent.ts is located at packages/compiler-sfc/src/parseComponent.ts (domain: CompilerSFC, subdomain: ScriptAnalyzer, directory: packages/compiler-sfc/src).

Analyze Your Own Codebase

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

Try Supermodel Free