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

web_entrypoint_browser

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: 5 Imported by: 0

README

Web Browser

The browser target implements deploying an app to a web page.

The user navigates to the app, which loads the Go runtime in a WebWorker. The root WebView cannot be closed (as per browser policy). A service worker is used to intercept requests and forward them to the Go runtime for processing. The root page can create and close more pages through the WebView API.

A controlled page attaches to the running runtime before checking for service-worker updates. Service-worker activation only establishes control; offline downloads run through separate events. A forced browser reload that bypasses an installed worker gets one recovery reload. Caching a new release does not reload active pages. An already cached release descriptor returns immediately while the service worker checks for a newer generation in the background. Missing boot-version metadata initializes in place, without deleting storage or reloading a fresh browser. Explicit older versions retain their migration path.

Browser distributions publish an offline inventory containing the entrypoint, split runtime modules, web packages, and immutable kvfile. Startup reads the manifest DAG on demand through HTTP ranges. The service worker downloads complete assets in the background and serves ranges from its cache. Remote Release World plugin manifests are copied into local storage after the startup group is ready. Transient range failures are retried on the next read instead of being cached. The local provider accepts the browser distribution's same-origin signaling URL (/), so its configuration can start instead of leaving Quickstart waiting.

The SharedWorker OPFS workaround currently selects a dedicated runtime worker. Web Locks elect its owning tab; other tabs attach through the service worker. Closing the owner requires another tab to start a replacement runtime. The bundled Drive startup benchmark measures cold startup, a second tab with a live owner, and restarts with warm storage separately.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {

	// WebRuntimeId is the unique ID of the runtime.
	//
	// must be set
	// used to determine the broadcast channel ids
	// determined by the webpage that started the worker
	WebRuntimeId string `protobuf:"bytes,1,opt,name=web_runtime_id,json=webRuntimeId,proto3" json:"webRuntimeId,omitempty"`
	// MessagePort is the global value to lookup for the MessagePort.
	// This MessagePort is used to pass other MessagePorts to open clients for the WebRuntimeHost.
	// usually BLDR_WEB_RUNTIME_CLIENT_OPEN.
	MessagePort string `protobuf:"bytes,2,opt,name=message_port,json=messagePort,proto3" json:"messagePort,omitempty"`
	// contains filtered or unexported fields
}

Config is the configuration for the browser controller. Expects to be running in a WebWorker.

func (*Config) CloneMessageVT

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

func (*Config) CloneVT

func (m *Config) CloneVT() *Config

func (*Config) EqualMessageVT

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

func (*Config) EqualVT

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

func (*Config) GetMessagePort

func (x *Config) GetMessagePort() string

func (*Config) GetWebRuntimeId

func (x *Config) GetWebRuntimeId() string

func (*Config) MarshalJSON

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

MarshalJSON marshals the Config to JSON.

func (*Config) MarshalProtoJSON

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

MarshalProtoJSON marshals the Config message to JSON.

func (*Config) MarshalProtoText

func (x *Config) MarshalProtoText() string

func (*Config) MarshalToSizedBufferVT

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

func (*Config) MarshalToVT

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

func (*Config) MarshalVT

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

func (*Config) ProtoMessage

func (*Config) ProtoMessage()

func (*Config) Reset

func (x *Config) Reset()

func (*Config) SizeVT

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

func (*Config) String

func (x *Config) String() string

func (*Config) UnmarshalJSON

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

UnmarshalJSON unmarshals the Config from JSON.

func (*Config) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the Config message from JSON.

func (*Config) UnmarshalVT

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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