Help us shape the future of Go! Take the 2026 Go Developer Survey

dochtml

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AssetPrefix is the HTTP prefix under which built assets are served.
	AssetPrefix = "/_bifrost/"
	// DevPrefix is the HTTP prefix under which the Vite development server is
	// proxied during development. It is Vite's base path, so proxied request
	// paths pass through unchanged.
	DevPrefix = "/_bifrost/dev/"
)

Variables

This section is empty.

Functions

func FrontendAssetURL

func FrontendAssetURL(value string) string

FrontendAssetURL converts a build artifact path into a browser URL. Root- relative URLs pass through for the proxied Vite development server, and absolute URLs pass through for external development servers.

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