Documentation
¶
Overview ¶
Package runtimeassets is the single registry + HTTP handler for the Gothic framework's WASM-runtime assets that used to be COPIED into every project's public/ folder at `gothic init` / build time. Instead of shipping bytes into the user's tree, the framework now serves them straight from its own embed under a dedicated route prefix (/_gothic/), so a framework upgrade updates the runtime for every project with no file churn and no stale copies.
The five runtime assets served here:
gothic-core.js the shared idempotent client runtime (pkg/helpers/gothiccore) gothic-core.wasm the prebuilt full-Go static core module (pkg/helpers/corewasm) gothic-core-exec.js the standard-Go wasm_exec shim matched to the core (corewasm) gothic-core-boot.js the generated core boot loader (corewasm) wasm_exec.js the TinyGo wasm_exec shim (pkg/data/wasm_exec)
NOTE the user's own GOROOT-matched wasm_exec_go.js stays in public/ (it is version-tied to the user's Go toolchain, copied at build time — not a framework artifact) and the per-page user WASM binaries stay under /public/wasm/.
This is a LEAF package over the three asset-owning leaf packages (gothiccore, corewasm, wasmexec). Those packages must NOT import runtimeassets or a cycle forms — runtimeassets sits one level above them.
Index ¶
Constants ¶
const Prefix = "/_gothic/"
Prefix is the route namespace the framework serves its runtime assets under. It is deliberately distinct from /public/ so it never collides with a user's static files and can carry its own edge-cache behavior at the CDN.
Variables ¶
This section is empty.
Functions ¶
func Handler ¶
Handler serves the runtime assets under Prefix. It strips the prefix, looks the file up in the registry, sets the right Content-Type, marks it immutable when a ?v= cache-buster is present (mirroring immutableCacheMiddleware), and writes the bytes. Unknown names 404. Only GET/HEAD are meaningful; other methods 405.