Documentation ¶
Index ¶
- func CompileJSX(name, jsx string, options api.TransformOptions) (program *goja.Program, err error)
- type Bundle
- func (b Bundle) Render(program *goja.Program, data any) (rendered string, err error)
- func (b *Bundle) RenderJSX(name, jsx string, data any) (rendered string, err error)
- func (b Bundle) WithDataVariable(varName string) Bundle
- func (b Bundle) WithProgramCache(cache ProgramCache) Bundle
- func (b Bundle) WithRenderCache(cache RenderCache) Bundle
- func (b Bundle) WithRenderFunction(funcName string) Bundle
- type Hashable
- type Loader
- type LoaderFunc
- type ProgramCache
- type RenderCache
- type RenderEngine
- type TransformError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompileJSX ¶
CompileJSX to a goja Program.
Types ¶
type Bundle ¶
type Bundle struct {
// contains filtered or unexported fields
}
func NewBundle ¶
func NewBundle(engine RenderEngine, modules ...Loader) Bundle
func (Bundle) WithDataVariable ¶
func (Bundle) WithProgramCache ¶
func (b Bundle) WithProgramCache(cache ProgramCache) Bundle
func (Bundle) WithRenderCache ¶
func (b Bundle) WithRenderCache(cache RenderCache) Bundle
func (Bundle) WithRenderFunction ¶
type Loader ¶
A Loader loads a module into a runtime environment.
func ComponentJSX ¶
func ComponentJSX(name, source string, options api.TransformOptions) Loader
type LoaderFunc ¶
type ProgramCache ¶
type RenderCache ¶
type RenderEngine ¶
type RenderEngine interface { Loader // GetJSXOptions to transpile to vanilla JS. GetJSXOptions() api.TransformOptions // GetRenderFunction after it has been loaded into the runtime environment. // This function should take exactly 1 argument and produce a string. GetRenderFunction(*goja.Runtime) (goja.Callable, error) }
Click to show internal directories.
Click to hide internal directories.