servercomponents

package
v4.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Collect

func Collect(parseManifest *Manifest, parseProps Props)

Collect appends a server-only descriptor to a manifest.

func ServerOnly

func ServerOnly(parseProps Props) ui.Node

ServerOnly renders its server implementation on non-wasm targets.

Types

type ClientReference

type ClientReference struct {
	ID     string            `json:"id"`
	Name   string            `json:"name"`
	Props  map[string]string `json:"props,omitempty"`
	Export string            `json:"export,omitempty"`
}

ClientReference identifies a client-side island passed through a server-only tree.

type Descriptor

type Descriptor struct {
	ID          string            `json:"id"`
	Name        string            `json:"name"`
	Props       map[string]string `json:"props,omitempty"`
	ClientSlots []ClientReference `json:"clientSlots,omitempty"`
}

Descriptor is the serializable server-component model shared with build tools.

type Manifest

type Manifest struct {
	Components []Descriptor `json:"components"`
}

Manifest is emitted by server rendering so bundlers can omit server-only code from the wasm entry.

type Props

type Props struct {
	ID          string
	Name        string
	Props       map[string]string
	ClientSlots []ClientReference
	Render      func() ui.Node
	Placeholder ui.Node
}

Props configures one server-only component boundary.

Jump to

Keyboard shortcuts

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