runtime

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package runtime embeds a pinned copy of the solid-js client runtime and resolves imports of it during bundling, so consumers need 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.

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 IsRuntimeModule

func IsRuntimeModule(specifier string) bool

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

Types

type Config

type Config struct {
	// Fallback is consulted when a specifier is not part of the embedded
	// runtime. Returning ("", false) lets the bundler resolve it normally,
	// which is what allows a consumer to keep a node_modules directory for
	// their own dependencies while still getting solid-js from here.
	Fallback func(specifier string) (contents string, ok bool)

	// Override replaces an embedded module wholesale, which is the escape
	// hatch for a consumer pinned to a different solid-js version.
	Override map[string]string
}

Config controls resolution.

func (Config) Resolve

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

Resolve returns the source of an embedded module. Relative specifiers are resolved against the importer.

Jump to

Keyboard shortcuts

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