dochtml

package
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AssetPrefix is the HTTP prefix under which built assets are served.
	AssetPrefix = "/_bifrost/"
)

Variables

This section is empty.

Functions

func FrontendAssetURL

func FrontendAssetURL(value string) string

FrontendAssetURL converts a build artifact path into a browser URL. Absolute URLs pass through for the Vite development server.

func Open

func Open(document protocol.DocumentAttributes) string

Open writes the opening tags for a document with the given attributes.

Types

type Shell

type Shell struct {
	// contains filtered or unexported fields
}

Shell is an immutable HTML document shell for one client asset set. The streaming runtime uses WritePreamble and WriteSuffix around body frames; the build command uses Render to assemble a complete static document.

func NewShell

func NewShell(assets protocol.AssetSet) (Shell, error)

NewShell builds the shell for the given client assets.

func (Shell) ClientDocument

func (s Shell) ClientDocument(props json.RawMessage) ([]byte, error)

ClientDocument assembles a mount-only document with empty props.

func (Shell) Render

func (s Shell) Render(w io.Writer, head, body []byte, props json.RawMessage, document protocol.DocumentAttributes) error

Render assembles a complete document from pre-rendered head and body bytes.

func (Shell) WritePreamble

func (s Shell) WritePreamble(w io.Writer, head []byte, document protocol.DocumentAttributes) error

WritePreamble writes the document opening, dynamic head, and the fixed head/body transition.

func (Shell) WriteSuffix

func (s Shell) WriteSuffix(w io.Writer, props json.RawMessage) error

WriteSuffix writes the closing body and hydration scripts.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL