compiler

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 6 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package compiler runs TSX apps: App runs the bundle the nsgo tool compiled ahead (package bundler), or under go run and go test compiles the app's sources as it starts, and under nsgo dev follows the dev server's new bundles.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func App

func App(fsys fs.FS, entry string) func(cx *core.Scope) core.Node

App returns the app whose TSX entry is entry in fsys, for nsgo.Run and nsgotest.Start. It runs the bundle the nsgo tool compiled ahead for entry when the build has one, so the app links no compiler; otherwise, under go run and go test, it compiles fsys's sources as it starts.

//go:embed *.tsx
var src embed.FS

func main() { nsgo.Run(compiler.App(src, "App.tsx")) }

func Bundled

func Bundled(entry, script string)

Bundled gives App the script the nsgo tool compiled ahead for entry. The tool's builds call it from a file they add to the app's main package; apps do not.

func BundledChunks

func BundledChunks(entry string, urls map[string]string)

BundledChunks says that entry's bundle is split (bundler.CompileSplit) and where its chunks are, by key: URLs relative to the web page, which App fetches as the app's import()s need them. The tool's web builds call it with Bundled.

Types

This section is empty.

Jump to

Keyboard shortcuts

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