gothiccore

package
v1.5.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package gothiccore owns gothic-core.js: the shared, idempotent client runtime globals that used to be inlined into every per-instance WASM bootstrap script.

They are extracted into a single static asset so the browser fetches and parses them ONCE per page (cached across renders and HTMX fragments) instead of re-shipping the ~4 KB preamble inside every component's inline <script>. The layout references it once in <head>; the per-instance bootstrap only fetches/instantiates/registers its own module and defensively ensures the core is present.

It is a leaf package (no internal deps) so BOTH the routes bootstrap layer and the wasm build layer can import it without a dependency cycle.

Index

Constants

View Source
const FileName = "gothic-core.js"

FileName is the emitted asset's basename under public/.

View Source
const JS = `` /* 12660-byte string literal not displayed */

JS is the shared idempotent runtime installed once per page. Every block is guarded so N components (or repeated HTMX re-mounts) never redeclare a global. This is byte-for-byte the preamble that used to live in the per-instance bootstrap (topic buffer pool, async dispatch, findScope, instances registry, per-scope teardown, the unmount MutationObserver) PLUS the multiplexing structures and the once-installed mux teardown wrapper — with one change: the MutationObserver install is deferred to DOMContentLoaded when document.body is not yet present (this script runs from <head>, before the body exists).

Variables

This section is empty.

Functions

func AssetPath

func AssetPath() string

AssetPath is the URL the layout and the per-instance bootstrap load, including the content-hash cache-buster: /_gothic/gothic-core.js?v=<hash>. Served from the framework embed via the /_gothic/ route (no longer copied into public/).

func Minified added in v1.3.0

func Minified() []byte

Minified returns the minified gothic-core.js bytes actually served under /_gothic/ (and emitted by Write). Its content hash is Version().

func Version

func Version() string

Version returns the content hash used as the ?v= cache-buster.

func Write

func Write(publicDir string) error

Write emits the (minified) gothic-core.js into publicDir (creating it if needed). Called at init (to seed the file) and on every build (so existing projects pick up a new core when the CLI is upgraded). Idempotent: overwrites in place. It writes the same bytes the /_gothic/ handler serves.

Types

This section is empty.

Jump to

Keyboard shortcuts

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