Documentation
¶
Overview ¶
Package livetree is a stand-in for the Vuka live session's protocol v2 until the session speaks it: it runs a v1 session and turns the HTML of each changed instance into render trees and their changes, in the format of Vuka's "Protocol v2: render trees" (docs/features/components.md). The trees come from the markup, not from the compiler: every text node and attribute is a dynamic, every run of keyed sibling elements a block. Tests install it (Install) to drive the browser runtime's v2 path.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
Encoder is a connection's server side of protocol v2: the trees the client holds and the statics and strings it has been sent.
type Entry ¶
type Entry struct {
ID string `json:"id"`
Full bool `json:"full,omitempty"`
Tree any `json:"tree,omitempty"`
HTML *string `json:"html,omitempty"`
}
Entry is one instance's item of a message's trees.
type Message ¶
type Message struct {
Type string `json:"type"`
Ref int `json:"ref,omitempty"`
V int `json:"v,omitempty"`
Trees []Entry `json:"trees,omitempty"`
JS []live.JSPush `json:"js,omitempty"`
Error string `json:"error,omitempty"`
URL string `json:"url,omitempty"`
}
Message is a v2 server message.