Home / Function/ createBasicRenderer() — vue Function Reference

createBasicRenderer() — vue Function Reference

Architecture documentation for the createBasicRenderer() function in create-basic-renderer.ts from the vue codebase.

Entity Profile

Dependency Diagram

graph TD
  8fc1e361_2499_d43c_4026_dc6b2b43c02b["createBasicRenderer()"]
  4c21c903_0357_dce5_cb90_83c67295a504["createRenderFunction()"]
  8fc1e361_2499_d43c_4026_dc6b2b43c02b -->|calls| 4c21c903_0357_dce5_cb90_83c67295a504
  06fee7d4_f38c_cb80_f7c8_47dea21e6cb4["createWriteFunction()"]
  8fc1e361_2499_d43c_4026_dc6b2b43c02b -->|calls| 06fee7d4_f38c_cb80_f7c8_47dea21e6cb4
  style 8fc1e361_2499_d43c_4026_dc6b2b43c02b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/server-renderer/src/create-basic-renderer.ts lines 6–37

export function createBasicRenderer({
  modules = [],
  directives = {},
  isUnaryTag = () => false,
  cache
}: RenderOptions = {}) {
  const render = createRenderFunction(modules, directives, isUnaryTag, cache)

  return function renderToString(
    component: Component,
    context?: any,
    done?: any
  ): void {
    if (typeof context === 'function') {
      done = context
      context = {}
    }
    let result = ''
    const write = createWriteFunction(text => {
      result += text
      return false
    }, done)
    try {
      //@ts-expect-error
      render(component, write, context, () => {
        done(null, result)
      })
    } catch (e: any) {
      done(e)
    }
  }
}

Subdomains

Frequently Asked Questions

What does createBasicRenderer() do?
createBasicRenderer() is a function in the vue codebase.
What does createBasicRenderer() call?
createBasicRenderer() calls 2 function(s): createRenderFunction, createWriteFunction.

Analyze Your Own Codebase

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

Try Supermodel Free