runtime

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package runtime embeds the solid-js client runtime so that bundling a Solid application needs no npm install and no node_modules directory.

The embedded files are not committed by hand. Run

go generate ./runtime

to fetch the pinned release. Transform output is coupled to the runtime version, so changing Version means re-running the test suite.

Use github.com/lilybw/go-solid-compiler/esbuildsolid.Runtime to serve these files to esbuild; Config.Resolve is the underlying lookup for other bundlers.

Index

Constants

View Source
const Version = "1.9.14"

Version is the solid-js release this runtime was vendored from.

Variables

This section is empty.

Functions

func Available

func Available() bool

Available reports whether the embedded runtime has been populated by go generate.

func Files

func Files() []string

Files lists the embedded module paths, which is useful for diagnostics.

func Handles added in v0.2.0

func Handles(specifier string) bool

Handles reports whether a specifier is served by the embedded runtime.

func Specifiers added in v0.2.0

func Specifiers() []string

Specifiers lists the import specifiers the embedded runtime serves.

Types

type Config

type Config struct {
	// Development serves the development builds, which carry Solid's runtime
	// warnings. Entry points without a development build fall back to the
	// production one.
	Development bool

	// Override replaces a module's source entirely, keyed by import specifier.
	// It is the escape hatch for pinning a different solid-js version without
	// abandoning the embedded runtime.
	Override map[string]string
}

Config selects which build to serve.

func (Config) Resolve

func (c Config) Resolve(specifier string) (string, bool, error)

Resolve returns the source of an embedded module.

It reports false for a specifier the runtime does not serve, and an error for one it should serve but cannot, which distinguishes "not mine" from "mine and broken".

Jump to

Keyboard shortcuts

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