Documentation
¶
Overview ¶
Package bundler compiles TSX apps into the scripts the tsx package runs, as NSH's bundler does (nsh-bundler): esbuild strips TypeScript, lowers syntax goja lacks and bundles the app's modules into one script, and jsx.go compiles the JSX into calls of the renderer, as NSH's compiler does. Imports of NSGo's modules (nsgo, nsgo/*, nsgo:rt) stay, as require calls the runtime answers. No Node is needed.
The nsgo tool links it, so it imports from NSGo only core and internal/driver, never the runtime (layering_test.go).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Compile ¶
Compile compiles the app whose entry is entry in fsys, and the modules it imports, into one script with its source map inline.
func CompileHot ¶
CompileHot compiles the app as Compile does, for hot updates: a newer bundle run in the VM of an older one (tsx.Hot) runs again only the modules whose code changed and renders their components' instances again, so the rest of the app keeps its state.
func CompileSplit ¶
CompileSplit compiles the app whose entry is entry in fsys as Compile does, but for its import()s of its own modules: main is the entry's script, and chunks the scripts the runtime loads for them, by key.