Home / File/ parseComponent.ts — vue Source File

parseComponent.ts — vue Source File

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

File typescript SfcCompiler ScriptCompiler 8 imports 6 dependents 2 functions

Entity Profile

Dependency Diagram

graph LR
  0efbfda6_f2a2_633c_6405_ea7a32c8a88d["parseComponent.ts"]
  1a27e6b3_7515_332e_8d02_d958c72a568c["types.ts"]
  0efbfda6_f2a2_633c_6405_ea7a32c8a88d --> 1a27e6b3_7515_332e_8d02_d958c72a568c
  5d984136_f02d_b459_9f20_2306143d1d20["BindingMetadata"]
  0efbfda6_f2a2_633c_6405_ea7a32c8a88d --> 5d984136_f02d_b459_9f20_2306143d1d20
  a9f9b30f_bda1_1f21_7614_3a5f474a5c6f["RawSourceMap"]
  0efbfda6_f2a2_633c_6405_ea7a32c8a88d --> a9f9b30f_bda1_1f21_7614_3a5f474a5c6f
  c9346cac_54e3_f6ca_68a7_03c6e82c9609["compileScript.ts"]
  0efbfda6_f2a2_633c_6405_ea7a32c8a88d --> c9346cac_54e3_f6ca_68a7_03c6e82c9609
  478c7626_e69c_3d08_4b37_be734a516412["de-indent"]
  0efbfda6_f2a2_633c_6405_ea7a32c8a88d --> 478c7626_e69c_3d08_4b37_be734a516412
  9aedf0a6_5e96_3dfd_0fd4_f5b61551de48["html-parser"]
  0efbfda6_f2a2_633c_6405_ea7a32c8a88d --> 9aedf0a6_5e96_3dfd_0fd4_f5b61551de48
  09aa5370_2caa_6b33_3f44_6ac5211bd11b["util"]
  0efbfda6_f2a2_633c_6405_ea7a32c8a88d --> 09aa5370_2caa_6b33_3f44_6ac5211bd11b
  a80b8e3b_d720_9146_3bf6_594d4ee5dd77["compiler"]
  0efbfda6_f2a2_633c_6405_ea7a32c8a88d --> a80b8e3b_d720_9146_3bf6_594d4ee5dd77
  c9346cac_54e3_f6ca_68a7_03c6e82c9609["compileScript.ts"]
  c9346cac_54e3_f6ca_68a7_03c6e82c9609 --> 0efbfda6_f2a2_633c_6405_ea7a32c8a88d
  445bc304_0400_2ae2_a33b_eaa1d5e1788a["cssVars.ts"]
  445bc304_0400_2ae2_a33b_eaa1d5e1788a --> 0efbfda6_f2a2_633c_6405_ea7a32c8a88d
  a74639a8_41f7_d409_723a_4c6194e0c72d["parse.ts"]
  a74639a8_41f7_d409_723a_4c6194e0c72d --> 0efbfda6_f2a2_633c_6405_ea7a32c8a88d
  1a27e6b3_7515_332e_8d02_d958c72a568c["types.ts"]
  1a27e6b3_7515_332e_8d02_d958c72a568c --> 0efbfda6_f2a2_633c_6405_ea7a32c8a88d
  51833d06_cbb0_1947_80b4_a5e77c1ca073["compileTemplate.spec.ts"]
  51833d06_cbb0_1947_80b4_a5e77c1ca073 --> 0efbfda6_f2a2_633c_6405_ea7a32c8a88d
  299be8c4_acdf_7d21_e697_6f85f553a1ce["parseComponent.spec.ts"]
  299be8c4_acdf_7d21_e697_6f85f553a1ce --> 0efbfda6_f2a2_633c_6405_ea7a32c8a88d
  style 0efbfda6_f2a2_633c_6405_ea7a32c8a88d 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 SfcCompiler domain, ScriptCompiler 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 8 module(s): BindingMetadata, RawSourceMap, compileScript.ts, compiler, de-indent, html-parser, types.ts, util.
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: SfcCompiler, subdomain: ScriptCompiler, 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