Home / File/ index.ts — vue Source File

index.ts — vue Source File

Architecture documentation for index.ts, a typescript file in the vue codebase. 11 imports, 3 dependents.

File typescript ServerRenderer TemplateRenderer 11 imports 3 dependents 4 functions 1 classes

Entity Profile

Dependency Diagram

graph LR
  70b92f4c_021d_4bb1_d973_4e94bcad69f8["index.ts"]
  a0033b88_b768_84c8_da01_e6315f54737c["util.ts"]
  70b92f4c_021d_4bb1_d973_4e94bcad69f8 --> a0033b88_b768_84c8_da01_e6315f54737c
  09887243_f3f5_896b_f40a_d39463c65d67["isJS"]
  70b92f4c_021d_4bb1_d973_4e94bcad69f8 --> 09887243_f3f5_896b_f40a_d39463c65d67
  938df857_4b1d_ef91_68b0_dadb067bddea["isCSS"]
  70b92f4c_021d_4bb1_d973_4e94bcad69f8 --> 938df857_4b1d_ef91_68b0_dadb067bddea
  93d70dd6_8b08_c5e1_f821_d322263718c1["template-stream.ts"]
  70b92f4c_021d_4bb1_d973_4e94bcad69f8 --> 93d70dd6_8b08_c5e1_f821_d322263718c1
  f05845f9_ab92_f302_7c35_d458f3105a3d["TemplateStream"]
  70b92f4c_021d_4bb1_d973_4e94bcad69f8 --> f05845f9_ab92_f302_7c35_d458f3105a3d
  d44d125e_e152_100e_7961_1e6a838d88bf["parse-template.ts"]
  70b92f4c_021d_4bb1_d973_4e94bcad69f8 --> d44d125e_e152_100e_7961_1e6a838d88bf
  5e6bd556_e2df_8a9e_92d8_4dd8802c1afb["parseTemplate"]
  70b92f4c_021d_4bb1_d973_4e94bcad69f8 --> 5e6bd556_e2df_8a9e_92d8_4dd8802c1afb
  619ed059_733e_d046_032d_afa289d21abc["create-async-file-mapper.ts"]
  70b92f4c_021d_4bb1_d973_4e94bcad69f8 --> 619ed059_733e_d046_032d_afa289d21abc
  3374bf24_e427_7785_d006_3cebda20e675["createMapper"]
  70b92f4c_021d_4bb1_d973_4e94bcad69f8 --> 3374bf24_e427_7785_d006_3cebda20e675
  3957a359_b7cd_d9a7_574a_514933e95fd3["ParsedTemplate"]
  70b92f4c_021d_4bb1_d973_4e94bcad69f8 --> 3957a359_b7cd_d9a7_574a_514933e95fd3
  ade23468_5c6f_da33_0553_a15b92011dd3["AsyncFileMapper"]
  70b92f4c_021d_4bb1_d973_4e94bcad69f8 --> ade23468_5c6f_da33_0553_a15b92011dd3
  38cdd14a_61b8_35ed_893f_b542594d7017["create-renderer.ts"]
  38cdd14a_61b8_35ed_893f_b542594d7017 --> 70b92f4c_021d_4bb1_d973_4e94bcad69f8
  619ed059_733e_d046_032d_afa289d21abc["create-async-file-mapper.ts"]
  619ed059_733e_d046_032d_afa289d21abc --> 70b92f4c_021d_4bb1_d973_4e94bcad69f8
  93d70dd6_8b08_c5e1_f821_d322263718c1["template-stream.ts"]
  93d70dd6_8b08_c5e1_f821_d322263718c1 --> 70b92f4c_021d_4bb1_d973_4e94bcad69f8
  style 70b92f4c_021d_4bb1_d973_4e94bcad69f8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

const path = require('path')
const serialize = require('serialize-javascript')

import { isJS, isCSS } from '../util'
import TemplateStream from './template-stream'
import { parseTemplate } from './parse-template'
import { createMapper } from './create-async-file-mapper'
import type { ParsedTemplate } from './parse-template'
import type { AsyncFileMapper } from './create-async-file-mapper'

type TemplateRendererOptions = {
  template?:
    | string
    | ((content: string, context: any) => string | Promise<string>)
  inject?: boolean
  clientManifest?: ClientManifest
  shouldPreload?: (file: string, type: string) => boolean
  shouldPrefetch?: (file: string, type: string) => boolean
  serializer?: Function
}

export type ClientManifest = {
  publicPath: string
  all: Array<string>
  initial: Array<string>
  async: Array<string>
  modules: {
    [id: string]: Array<number>
  }
  hasNoCssVersion?: {
    [file: string]: boolean
  }
}

type Resource = {
  file: string
  extension: string
  fileWithoutQuery: string
  asType: string
}

export default class TemplateRenderer {
  options: TemplateRendererOptions
  inject: boolean
  parsedTemplate: ParsedTemplate | Function | null
  //@ts-expect-error
  publicPath: string
  //@ts-expect-error
  clientManifest: ClientManifest
  //@ts-expect-error
  preloadFiles: Array<Resource>
  //@ts-expect-error
  prefetchFiles: Array<Resource>
  //@ts-expect-error
  mapFiles: AsyncFileMapper
  serialize: Function

  constructor(options: TemplateRendererOptions) {
    this.options = options
    this.inject = options.inject !== false
// ... (247 more lines)

Subdomains

Frequently Asked Questions

What does index.ts do?
index.ts is a source file in the vue codebase, written in typescript. It belongs to the ServerRenderer domain, TemplateRenderer subdomain.
What functions are defined in index.ts?
index.ts defines 4 function(s): content, file, getPreloadType, normalizeFile.
What does index.ts depend on?
index.ts imports 11 module(s): AsyncFileMapper, ParsedTemplate, TemplateStream, create-async-file-mapper.ts, createMapper, isCSS, isJS, parse-template.ts, and 3 more.
What files import index.ts?
index.ts is imported by 3 file(s): create-async-file-mapper.ts, create-renderer.ts, template-stream.ts.
Where is index.ts in the architecture?
index.ts is located at packages/server-renderer/src/template-renderer/index.ts (domain: ServerRenderer, subdomain: TemplateRenderer, directory: packages/server-renderer/src/template-renderer).

Analyze Your Own Codebase

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

Try Supermodel Free