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
  8b87376c_256c_64f8_ab42_175e3d577f20["createBasicRenderer()"]
  4787865a_0f93_3075_722a_b4664a321f6d["create-basic-renderer.ts"]
  8b87376c_256c_64f8_ab42_175e3d577f20 -->|defined in| 4787865a_0f93_3075_722a_b4664a321f6d
  7ae3edb4_84c6_0281_9ecf_c1bb0face36e["createRenderFunction()"]
  8b87376c_256c_64f8_ab42_175e3d577f20 -->|calls| 7ae3edb4_84c6_0281_9ecf_c1bb0face36e
  208f6731_ceac_754f_49df_75211ecf996c["createWriteFunction()"]
  8b87376c_256c_64f8_ab42_175e3d577f20 -->|calls| 208f6731_ceac_754f_49df_75211ecf996c
  style 8b87376c_256c_64f8_ab42_175e3d577f20 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, defined in packages/server-renderer/src/create-basic-renderer.ts.
Where is createBasicRenderer() defined?
createBasicRenderer() is defined in packages/server-renderer/src/create-basic-renderer.ts at line 6.
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