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

bldr_frontend

package
v0.57.21 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const AttachedServicePrefix = "frontend/"

AttachedServicePrefix identifies services with a retained authoring Resource.

View Source
const SRPCFrontendServiceID = "bldr.frontend.Frontend"

Variables

This section is empty.

Functions

func NewSRPCFrontendHandler

func NewSRPCFrontendHandler(impl SRPCFrontendServer, serviceID string) srpc.Handler

NewSRPCFrontendHandler constructs a new RPC handler. serviceID: if empty, uses default: bldr.frontend.Frontend

func RouteService

func RouteService(requestPath string) (string, error)

RouteService selects a frontend service from a browser module path. Ordinary development URLs use the document's existing devtool connection.

func SRPCRegisterFrontend

func SRPCRegisterFrontend(mux srpc.Mux, impl SRPCFrontendServer) error

SRPCRegisterFrontend registers the implementation with the mux. Uses the default serviceID: bldr.frontend.Frontend

func ServiceRoutePrefix

func ServiceRoutePrefix(serviceID string) string

ServiceRoutePrefix gives an attached frontend service its same-origin namespace.

Types

type Binding

type Binding struct {

	// Entrypoint is the configured source path relative to the project root.
	Entrypoint string `protobuf:"bytes,1,opt,name=entrypoint,proto3" json:"entrypoint,omitempty"`
	// contains filtered or unexported fields
}

Binding attaches a manifest-loaded view to a configured project entrypoint. It is stable across compiler sessions and is absent from snapshot builds.

func (*Binding) CloneMessageVT

func (m *Binding) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*Binding) CloneVT

func (m *Binding) CloneVT() *Binding

func (*Binding) EqualMessageVT

func (this *Binding) EqualMessageVT(thatMsg any) bool

func (*Binding) EqualVT

func (this *Binding) EqualVT(that *Binding) bool

func (*Binding) GetEntrypoint

func (x *Binding) GetEntrypoint() string

func (*Binding) MarshalJSON

func (x *Binding) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Binding to JSON.

func (*Binding) MarshalProtoJSON

func (x *Binding) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the Binding message to JSON.

func (*Binding) MarshalProtoText

func (x *Binding) MarshalProtoText() string

func (*Binding) MarshalToSizedBufferVT

func (m *Binding) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Binding) MarshalToVT

func (m *Binding) MarshalToVT(dAtA []byte) (int, error)

func (*Binding) MarshalVT

func (m *Binding) MarshalVT() (dAtA []byte, err error)

func (*Binding) ProtoMessage

func (*Binding) ProtoMessage()

func (*Binding) Reset

func (x *Binding) Reset()

func (*Binding) SizeVT

func (m *Binding) SizeVT() (n int)

func (*Binding) String

func (x *Binding) String() string

func (*Binding) UnmarshalJSON

func (x *Binding) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the Binding from JSON.

func (*Binding) UnmarshalProtoJSON

func (x *Binding) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the Binding message from JSON.

func (*Binding) UnmarshalVT

func (m *Binding) UnmarshalVT(dAtA []byte) error

type Event

type Event struct {

	// Session is present on the initial snapshot of every stream.
	Session *Session `protobuf:"bytes,1,opt,name=session,proto3" json:"session,omitempty"`
	// Sequence is the latest update number in the initial snapshot, then increases
	// by one for each payload. It is scoped to Session.Id.
	Sequence uint64 `protobuf:"varint,2,opt,name=sequence,proto3" json:"sequence,omitempty"`
	// Payload is the upstream Vite HMR JSON message, interpreted by Vite's client.
	// Bldr treats it as opaque data, not an application protocol.
	Payload string `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"`
	// contains filtered or unexported fields
}

Event is an ordered message from one compiler session.

func (*Event) CloneMessageVT

func (m *Event) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*Event) CloneVT

func (m *Event) CloneVT() *Event

func (*Event) EqualMessageVT

func (this *Event) EqualMessageVT(thatMsg any) bool

func (*Event) EqualVT

func (this *Event) EqualVT(that *Event) bool

func (*Event) GetPayload

func (x *Event) GetPayload() string

func (*Event) GetSequence

func (x *Event) GetSequence() uint64

func (*Event) GetSession

func (x *Event) GetSession() *Session

func (*Event) MarshalJSON

func (x *Event) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Event to JSON.

func (*Event) MarshalProtoJSON

func (x *Event) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the Event message to JSON.

func (*Event) MarshalProtoText

func (x *Event) MarshalProtoText() string

func (*Event) MarshalToSizedBufferVT

func (m *Event) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Event) MarshalToVT

func (m *Event) MarshalToVT(dAtA []byte) (int, error)

func (*Event) MarshalVT

func (m *Event) MarshalVT() (dAtA []byte, err error)

func (*Event) ProtoMessage

func (*Event) ProtoMessage()

func (*Event) Reset

func (x *Event) Reset()

func (*Event) SizeVT

func (m *Event) SizeVT() (n int)

func (*Event) String

func (x *Event) String() string

func (*Event) UnmarshalJSON

func (x *Event) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the Event from JSON.

func (*Event) UnmarshalProtoJSON

func (x *Event) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the Event message from JSON.

func (*Event) UnmarshalVT

func (m *Event) UnmarshalVT(dAtA []byte) error

type SRPCFrontendClient

type SRPCFrontendClient interface {
	// SRPCClient returns the underlying SRPC client.
	SRPCClient() srpc.Client

	// Watch starts with the current session and sequence, then streams updates.
	// A new session or a sequence gap requires reloading the document.
	Watch(ctx context.Context, in *WatchRequest) (SRPCFrontend_WatchClient, error)
	// Send delivers a client HMR message to the selected compiler session.
	Send(ctx context.Context, in *SendRequest) (*SendResponse, error)
	// Fetch serves modules from the session named by the request URL.
	Fetch(ctx context.Context) (SRPCFrontend_FetchClient, error)
}

func NewSRPCFrontendClient

func NewSRPCFrontendClient(cc srpc.Client) SRPCFrontendClient

func NewSRPCFrontendClientWithServiceID

func NewSRPCFrontendClientWithServiceID(cc srpc.Client, serviceID string) SRPCFrontendClient

type SRPCFrontendHandler

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

func (SRPCFrontendHandler) GetMethodIDs

func (SRPCFrontendHandler) GetMethodIDs() []string

func (*SRPCFrontendHandler) GetServiceID

func (d *SRPCFrontendHandler) GetServiceID() string

func (*SRPCFrontendHandler) InvokeMethod

func (d *SRPCFrontendHandler) InvokeMethod(
	serviceID, methodID string,
	strm srpc.Stream,
) (bool, error)

func (SRPCFrontendHandler) InvokeMethod_Fetch

func (SRPCFrontendHandler) InvokeMethod_Fetch(impl SRPCFrontendServer, strm srpc.Stream) error

func (SRPCFrontendHandler) InvokeMethod_Send

func (SRPCFrontendHandler) InvokeMethod_Send(impl SRPCFrontendServer, strm srpc.Stream) error

func (SRPCFrontendHandler) InvokeMethod_Watch

func (SRPCFrontendHandler) InvokeMethod_Watch(impl SRPCFrontendServer, strm srpc.Stream) error

type SRPCFrontendServer

type SRPCFrontendServer interface {
	// Watch starts with the current session and sequence, then streams updates.
	// A new session or a sequence gap requires reloading the document.
	Watch(*WatchRequest, SRPCFrontend_WatchStream) error
	// Send delivers a client HMR message to the selected compiler session.
	Send(context.Context, *SendRequest) (*SendResponse, error)
	// Fetch serves modules from the session named by the request URL.
	Fetch(SRPCFrontend_FetchStream) error
}

type SRPCFrontend_FetchClient

type SRPCFrontend_FetchClient interface {
	srpc.Stream
	Send(*web_fetch.FetchRequest) error
	Recv() (*web_fetch.FetchResponse, error)
	RecvTo(*web_fetch.FetchResponse) error
}

type SRPCFrontend_FetchStream

type SRPCFrontend_FetchStream interface {
	srpc.Stream
	Send(*web_fetch.FetchResponse) error
	SendAndClose(*web_fetch.FetchResponse) error
	Recv() (*web_fetch.FetchRequest, error)
	RecvTo(*web_fetch.FetchRequest) error
}

type SRPCFrontend_SendStream

type SRPCFrontend_SendStream interface {
	srpc.Stream
}

type SRPCFrontend_WatchClient

type SRPCFrontend_WatchClient interface {
	srpc.Stream
	Recv() (*Event, error)
	RecvTo(*Event) error
}

type SRPCFrontend_WatchStream

type SRPCFrontend_WatchStream interface {
	srpc.Stream
	Send(*Event) error
	SendAndClose(*Event) error
}

type SendRequest

type SendRequest struct {

	// SessionId identifies the compiler environment; stale sessions are rejected.
	SessionId string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"sessionId,omitempty"`
	// Payload contains an upstream Vite client HMR JSON message.
	Payload string `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"`
	// contains filtered or unexported fields
}

SendRequest sends one upstream client message to its originating session.

func (*SendRequest) CloneMessageVT

func (m *SendRequest) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*SendRequest) CloneVT

func (m *SendRequest) CloneVT() *SendRequest

func (*SendRequest) EqualMessageVT

func (this *SendRequest) EqualMessageVT(thatMsg any) bool

func (*SendRequest) EqualVT

func (this *SendRequest) EqualVT(that *SendRequest) bool

func (*SendRequest) GetPayload

func (x *SendRequest) GetPayload() string

func (*SendRequest) GetSessionId

func (x *SendRequest) GetSessionId() string

func (*SendRequest) MarshalJSON

func (x *SendRequest) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SendRequest to JSON.

func (*SendRequest) MarshalProtoJSON

func (x *SendRequest) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SendRequest message to JSON.

func (*SendRequest) MarshalProtoText

func (x *SendRequest) MarshalProtoText() string

func (*SendRequest) MarshalToSizedBufferVT

func (m *SendRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SendRequest) MarshalToVT

func (m *SendRequest) MarshalToVT(dAtA []byte) (int, error)

func (*SendRequest) MarshalVT

func (m *SendRequest) MarshalVT() (dAtA []byte, err error)

func (*SendRequest) ProtoMessage

func (*SendRequest) ProtoMessage()

func (*SendRequest) Reset

func (x *SendRequest) Reset()

func (*SendRequest) SizeVT

func (m *SendRequest) SizeVT() (n int)

func (*SendRequest) String

func (x *SendRequest) String() string

func (*SendRequest) UnmarshalJSON

func (x *SendRequest) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SendRequest from JSON.

func (*SendRequest) UnmarshalProtoJSON

func (x *SendRequest) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SendRequest message from JSON.

func (*SendRequest) UnmarshalVT

func (m *SendRequest) UnmarshalVT(dAtA []byte) error

type SendResponse

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

SendResponse acknowledges delivery to the selected environment.

func (*SendResponse) CloneMessageVT

func (m *SendResponse) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*SendResponse) CloneVT

func (m *SendResponse) CloneVT() *SendResponse

func (*SendResponse) EqualMessageVT

func (this *SendResponse) EqualMessageVT(thatMsg any) bool

func (*SendResponse) EqualVT

func (this *SendResponse) EqualVT(that *SendResponse) bool

func (*SendResponse) MarshalJSON

func (x *SendResponse) MarshalJSON() ([]byte, error)

MarshalJSON marshals the SendResponse to JSON.

func (*SendResponse) MarshalProtoJSON

func (x *SendResponse) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the SendResponse message to JSON.

func (*SendResponse) MarshalProtoText

func (x *SendResponse) MarshalProtoText() string

func (*SendResponse) MarshalToSizedBufferVT

func (m *SendResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*SendResponse) MarshalToVT

func (m *SendResponse) MarshalToVT(dAtA []byte) (int, error)

func (*SendResponse) MarshalVT

func (m *SendResponse) MarshalVT() (dAtA []byte, err error)

func (*SendResponse) ProtoMessage

func (*SendResponse) ProtoMessage()

func (*SendResponse) Reset

func (x *SendResponse) Reset()

func (*SendResponse) SizeVT

func (m *SendResponse) SizeVT() (n int)

func (*SendResponse) String

func (x *SendResponse) String() string

func (*SendResponse) UnmarshalJSON

func (x *SendResponse) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the SendResponse from JSON.

func (*SendResponse) UnmarshalProtoJSON

func (x *SendResponse) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the SendResponse message from JSON.

func (*SendResponse) UnmarshalVT

func (m *SendResponse) UnmarshalVT(dAtA []byte) error

type Session

type Session struct {

	// Id changes whenever the compiler environment is replaced.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// RoutePrefix is the same-origin Bldr route ending in a slash.
	RoutePrefix string `protobuf:"bytes,2,opt,name=route_prefix,json=routePrefix,proto3" json:"routePrefix,omitempty"`
	// Entrypoints contains the source paths allowed as frontend attachments.
	Entrypoints []string `protobuf:"bytes,3,rep,name=entrypoints,proto3" json:"entrypoints,omitempty"`
	// ViteVersion identifies the upstream format of opaque HMR payloads.
	ViteVersion string `protobuf:"bytes,4,opt,name=vite_version,json=viteVersion,proto3" json:"viteVersion,omitempty"`
	// contains filtered or unexported fields
}

Session identifies one retained compiler graph and its browser namespace.

func (*Session) CloneMessageVT

func (m *Session) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*Session) CloneVT

func (m *Session) CloneVT() *Session

func (*Session) EqualMessageVT

func (this *Session) EqualMessageVT(thatMsg any) bool

func (*Session) EqualVT

func (this *Session) EqualVT(that *Session) bool

func (*Session) GetEntrypoints

func (x *Session) GetEntrypoints() []string

func (*Session) GetId

func (x *Session) GetId() string

func (*Session) GetRoutePrefix

func (x *Session) GetRoutePrefix() string

func (*Session) GetViteVersion

func (x *Session) GetViteVersion() string

func (*Session) MarshalJSON

func (x *Session) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Session to JSON.

func (*Session) MarshalProtoJSON

func (x *Session) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the Session message to JSON.

func (*Session) MarshalProtoText

func (x *Session) MarshalProtoText() string

func (*Session) MarshalToSizedBufferVT

func (m *Session) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Session) MarshalToVT

func (m *Session) MarshalToVT(dAtA []byte) (int, error)

func (*Session) MarshalVT

func (m *Session) MarshalVT() (dAtA []byte, err error)

func (*Session) ProtoMessage

func (*Session) ProtoMessage()

func (*Session) Reset

func (x *Session) Reset()

func (*Session) SizeVT

func (m *Session) SizeVT() (n int)

func (*Session) String

func (x *Session) String() string

func (*Session) UnmarshalJSON

func (x *Session) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the Session from JSON.

func (*Session) UnmarshalProtoJSON

func (x *Session) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the Session message from JSON.

func (*Session) UnmarshalVT

func (m *Session) UnmarshalVT(dAtA []byte) error

type WatchRequest

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

WatchRequest subscribes to the current project frontend environment.

func (*WatchRequest) CloneMessageVT

func (m *WatchRequest) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*WatchRequest) CloneVT

func (m *WatchRequest) CloneVT() *WatchRequest

func (*WatchRequest) EqualMessageVT

func (this *WatchRequest) EqualMessageVT(thatMsg any) bool

func (*WatchRequest) EqualVT

func (this *WatchRequest) EqualVT(that *WatchRequest) bool

func (*WatchRequest) MarshalJSON

func (x *WatchRequest) MarshalJSON() ([]byte, error)

MarshalJSON marshals the WatchRequest to JSON.

func (*WatchRequest) MarshalProtoJSON

func (x *WatchRequest) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the WatchRequest message to JSON.

func (*WatchRequest) MarshalProtoText

func (x *WatchRequest) MarshalProtoText() string

func (*WatchRequest) MarshalToSizedBufferVT

func (m *WatchRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*WatchRequest) MarshalToVT

func (m *WatchRequest) MarshalToVT(dAtA []byte) (int, error)

func (*WatchRequest) MarshalVT

func (m *WatchRequest) MarshalVT() (dAtA []byte, err error)

func (*WatchRequest) ProtoMessage

func (*WatchRequest) ProtoMessage()

func (*WatchRequest) Reset

func (x *WatchRequest) Reset()

func (*WatchRequest) SizeVT

func (m *WatchRequest) SizeVT() (n int)

func (*WatchRequest) String

func (x *WatchRequest) String() string

func (*WatchRequest) UnmarshalJSON

func (x *WatchRequest) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the WatchRequest from JSON.

func (*WatchRequest) UnmarshalProtoJSON

func (x *WatchRequest) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the WatchRequest message from JSON.

func (*WatchRequest) UnmarshalVT

func (m *WatchRequest) UnmarshalVT(dAtA []byte) error

Jump to

Keyboard shortcuts

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