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
  a2b98b33_4dee_c42a_a647_d6771594b2f7["constructor()"]
  ca5d32ef_4800_e9f8_8615_813fc33986aa["constructor()"]
  ca5d32ef_4800_e9f8_8615_813fc33986aa -->|calls| a2b98b33_4dee_c42a_a647_d6771594b2f7
  ca5d32ef_4800_e9f8_8615_813fc33986aa["constructor()"]
  a2b98b33_4dee_c42a_a647_d6771594b2f7 -->|calls| ca5d32ef_4800_e9f8_8615_813fc33986aa
  cea6614d_372d_a476_38a8_864e011e13f9["parseTemplate()"]
  a2b98b33_4dee_c42a_a647_d6771594b2f7 -->|calls| cea6614d_372d_a476_38a8_864e011e13f9
  e32edb73_257e_fe8f_37f0_4d04caee72ba["createMapper()"]
  a2b98b33_4dee_c42a_a647_d6771594b2f7 -->|calls| e32edb73_257e_fe8f_37f0_4d04caee72ba
  style a2b98b33_4dee_c42a_a647_d6771594b2f7 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.
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