Home / Function/ constructor() — vue Function Reference

constructor() — vue Function Reference

Architecture documentation for the constructor() function in index.ts from the vue codebase.

Entity Profile

Dependency Diagram

graph TD
  4f56eba8_4bcc_ea76_3d31_b69c48b1836e["constructor()"]
  a6b6f41b_6598_1b32_00b3_8bbaa08b8c64["TemplateRenderer"]
  4f56eba8_4bcc_ea76_3d31_b69c48b1836e -->|defined in| a6b6f41b_6598_1b32_00b3_8bbaa08b8c64
  0ef556f7_d362_84b8_707e_50d668e67c3e["constructor()"]
  0ef556f7_d362_84b8_707e_50d668e67c3e -->|calls| 4f56eba8_4bcc_ea76_3d31_b69c48b1836e
  0ef556f7_d362_84b8_707e_50d668e67c3e["constructor()"]
  4f56eba8_4bcc_ea76_3d31_b69c48b1836e -->|calls| 0ef556f7_d362_84b8_707e_50d668e67c3e
  22b51046_d37a_5886_126a_16f7c975c955["parseTemplate()"]
  4f56eba8_4bcc_ea76_3d31_b69c48b1836e -->|calls| 22b51046_d37a_5886_126a_16f7c975c955
  de56f276_bd14_cdff_b17e_876de3db40b6["createMapper()"]
  4f56eba8_4bcc_ea76_3d31_b69c48b1836e -->|calls| de56f276_bd14_cdff_b17e_876de3db40b6
  style 4f56eba8_4bcc_ea76_3d31_b69c48b1836e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/server-renderer/src/template-renderer/index.ts lines 58–92

  constructor(options: TemplateRendererOptions) {
    this.options = options
    this.inject = options.inject !== false
    // if no template option is provided, the renderer is created
    // as a utility object for rendering assets like preload links and scripts.

    const { template } = options
    this.parsedTemplate = template
      ? typeof template === 'string'
        ? parseTemplate(template)
        : template
      : null

    // function used to serialize initial state JSON
    this.serialize =
      options.serializer ||
      (state => {
        return serialize(state, { isJSON: true })
      })

    // extra functionality with client manifest
    if (options.clientManifest) {
      const clientManifest = (this.clientManifest = options.clientManifest)
      // ensure publicPath ends with /
      this.publicPath =
        clientManifest.publicPath === ''
          ? ''
          : clientManifest.publicPath.replace(/([^\/])$/, '$1/')
      // preload/prefetch directives
      this.preloadFiles = (clientManifest.initial || []).map(normalizeFile)
      this.prefetchFiles = (clientManifest.async || []).map(normalizeFile)
      // initial async chunk mapping
      this.mapFiles = createMapper(clientManifest)
    }
  }

Subdomains

Called By

Frequently Asked Questions

What does constructor() do?
constructor() is a function in the vue codebase, defined in packages/server-renderer/src/template-renderer/index.ts.
Where is constructor() defined?
constructor() is defined in packages/server-renderer/src/template-renderer/index.ts at line 58.
What does constructor() call?
constructor() calls 3 function(s): constructor, createMapper, parseTemplate.
What calls constructor()?
constructor() is called by 1 function(s): constructor.

Analyze Your Own Codebase

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

Try Supermodel Free