Documentation
¶
Overview ¶
Package websrc holds the scripts a page's realm runs: the realm's helpers and the sources of the runtime's programs. A release's page loads them as files of its own (Script and Bundle write them), so a Content-Security-Policy needs no 'unsafe-eval'; every other build compiles the same sources itself (docs/architecture/tsx.md).
Index ¶
Constants ¶
const ( // ProgramsGlobal is the global object a runtime file registers the // realm's programs on, by name. ProgramsGlobal = "__nsgoPrograms" // ScriptsGlobal is the global object an app's files register its // scripts on, by name: its bundles and their chunks. ScriptsGlobal = "__nsgoScripts" )
Variables ¶
var ( // Helper makes the realm's helpers, which its JavaScript reaches Go // through: the dispatch, release and throw of the engine's calls. Helper = Source{"helpers", helperJS} // Time patches Date to read the app's clock. Time = Source{"time.js", timeJS} // Web is the web APIs, as globals. Web = Source{"web.js", webJS} // Split and Merge are the component calls' props helpers. Split = Source{"split.js", splitJS} Merge = Source{"merge.js", mergeJS} // Harden is a sandbox's: it closes what makes code from strings. Harden = Source{"harden.js", hardenJS} )