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
  09c92be2_3342_6d70_1f49_4c1e5ee5baa0["constructor()"]
  9c7314d0_97a6_db5b_54f9_c54d4840cef5["constructor()"]
  9c7314d0_97a6_db5b_54f9_c54d4840cef5 -->|calls| 09c92be2_3342_6d70_1f49_4c1e5ee5baa0
  9c7314d0_97a6_db5b_54f9_c54d4840cef5["constructor()"]
  09c92be2_3342_6d70_1f49_4c1e5ee5baa0 -->|calls| 9c7314d0_97a6_db5b_54f9_c54d4840cef5
  4f45e2ec_fdd9_e0e9_f623_db3195192a2f["parseTemplate()"]
  09c92be2_3342_6d70_1f49_4c1e5ee5baa0 -->|calls| 4f45e2ec_fdd9_e0e9_f623_db3195192a2f
  eeaba5cf_0735_692a_9928_a1b87f324f5a["createMapper()"]
  09c92be2_3342_6d70_1f49_4c1e5ee5baa0 -->|calls| eeaba5cf_0735_692a_9928_a1b87f324f5a
  style 09c92be2_3342_6d70_1f49_4c1e5ee5baa0 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