Home / File/ test.ts — vue Source File

test.ts — vue Source File

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

File typescript CompilerSFC ScriptAnalyzer 6 imports 2 functions 1 classes

Entity Profile

Dependency Diagram

graph LR
  9963c06a_8a15_dfd0_c2c4_c74ea1c7747d["test.ts"]
  09422b63_6947_479f_f3b8_a48790187388["./index"]
  9963c06a_8a15_dfd0_c2c4_c74ea1c7747d --> 09422b63_6947_479f_f3b8_a48790187388
  208b3c62_5467_dd42_ca49_db7bfd39eaf3["../client-plugin"]
  9963c06a_8a15_dfd0_c2c4_c74ea1c7747d --> 208b3c62_5467_dd42_ca49_db7bfd39eaf3
  df6fba7a_859c_00c1_150a_f558fa77afb2["../server-plugin"]
  9963c06a_8a15_dfd0_c2c4_c74ea1c7747d --> df6fba7a_859c_00c1_150a_f558fa77afb2
  9089d520_e665_fc17_b5b1_613b68f5ea80["webpack"]
  9963c06a_8a15_dfd0_c2c4_c74ea1c7747d --> 9089d520_e665_fc17_b5b1_613b68f5ea80
  15fb2871_fa15_812f_7029_71edadc5e785["fs"]
  9963c06a_8a15_dfd0_c2c4_c74ea1c7747d --> 15fb2871_fa15_812f_7029_71edadc5e785
  3c4121f7_4f33_693b_8c33_5827cd1b2a69["."]
  9963c06a_8a15_dfd0_c2c4_c74ea1c7747d --> 3c4121f7_4f33_693b_8c33_5827cd1b2a69
  style 9963c06a_8a15_dfd0_c2c4_c74ea1c7747d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import Vue, { VNode, VNodeDirective } from '../../../types/index'
import VueSSRClientPlugin from '../client-plugin'
import VueSSRServerPlugin from '../server-plugin'
import webpack from 'webpack'
import { readFileSync } from 'fs'
import { createRenderer, createBundleRenderer } from '.'

function createApp(context: any) {
  return new Vue({
    data: {
      url: context.url
    },
    template: `<div>The visited URL is: {{ url }}</div>`
  })
}

// Renderer test
const app = createApp({ url: 'http://localhost:8000/' })

const renderer = createRenderer({
  template: readFileSync('./index.template.html', 'utf-8')
})

const context = {
  title: 'Hello',
  meta: `
    <meta name="description" content="Vue.js SSR Example">
  `
}

renderer.renderToString(app, (err, html) => {
  if (err) throw err
  const res: string = html
})

renderer.renderToString(app, context, (err, html) => {
  if (err) throw err
  const res: string = html
})

renderer
  .renderToString(app)
  .then(html => {
    const res: string = html
  })
  .catch(err => {
    throw err
  })

renderer
  .renderToString(app, context)
  .then(html => {
    const res: string = html
  })
  .catch(err => {
    throw err
  })

renderer.renderToStream(app, context).on('data', chunk => {
  const html = chunk.toString()
// ... (74 more lines)

Domain

Subdomains

Classes

Dependencies

  • .
  • ../client-plugin
  • ../server-plugin
  • ./index
  • fs
  • webpack

Frequently Asked Questions

What does test.ts do?
test.ts is a source file in the vue codebase, written in typescript. It belongs to the CompilerSFC domain, ScriptAnalyzer subdomain.
What functions are defined in test.ts?
test.ts defines 2 function(s): bundleRenderer.shouldPreload, createApp.
What does test.ts depend on?
test.ts imports 6 module(s): ., ../client-plugin, ../server-plugin, ./index, fs, webpack.
Where is test.ts in the architecture?
test.ts is located at packages/server-renderer/types/test.ts (domain: CompilerSFC, subdomain: ScriptAnalyzer, directory: packages/server-renderer/types).

Analyze Your Own Codebase

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

Try Supermodel Free