Expand description
§islands-build — the islands.rs build pipeline, as a library
Everything needed to build an islands.rs app, decoupled from any one
repository’s layout. A thin xtask (this repo’s, or a downstream consumer’s)
constructs a BuildPlan — from an IslandsConfig (islands.toml) or its
own discovery — and calls build.
The pipeline:
- WASM (
wasm::build_wasm): resolve + install the matchingwasm-bindgen-cli, compile the runtime (wasm::build_runtime) and page crates towasm32-unknown-unknown, runwasm-bindgen --target web, verify the artifacts, and apply the load-bearing V8 namespace patch. - CSS (
css::build_css): build the sharedbase.cssand a per-page Tailwind bundle for each page (optionally materializingbasecoat.css). - Manifest (
hashing::post_build_hashing_pass, gated byBuildPlan::manifest): content-hash every asset, rewrite cross-asset references, and writemanifest.json. Off ⇒ logical filenames, resolved bypage_shell’s logical-path fallback.
The V8 namespace patch is exported as a first-class, tested API: skipping it produces a bundle the browser refuses to instantiate, so no consumer should ever have to rediscover it.
Re-exports§
pub use config::BuildPlan;pub use config::CssConfig;pub use config::PageBuild;pub use config::RuntimeBuild;pub use css::build_base_css;pub use css::build_css;pub use css::build_page_css;pub use discovery::IslandsConfig;pub use hashing::post_build_hashing_pass;pub use manifest::BuildManifest;pub use manifest::ManifestBundleEntry;pub use patch::patch_page_js;pub use patch::patch_runtime_snippets;pub use patch::PATCH_TOKEN;pub use wasm::build_page_wasm;pub use wasm::build_runtime;pub use wasm::build_wasm;pub use wasm::wasm_bindgen_bundle;
Modules§
- config
- The inputs to the build pipeline.
- css
- CSS build: materialize the (optional) basecoat layer, build the shared
base.css, and generate + compile a per-page bundle for each page. - discovery
- Configurable page discovery (Rec 5): read an
islands.tomldescribing the pages, output layout, and runtime feature set, instead of hard-coding any one repository’s directory shape. - hashing
- The content-hash post-build pass: SHA-256 every emitted asset, rewrite
cross-asset references inside JS, rename files to
<stem>.<hash>.<ext>, and writemanifest.json. Skipped entirely whenplan.manifestis false (the logical-path / dev story). - manifest
- The serialized
manifest.jsonschema (writer side). - patch
- The V8 module-namespace patch — a first-class, tested, public part of the build contract.
- wasm
- WASM build orchestration: resolve + install the matching
wasm-bindgen-cli, compile the runtime and page crates towasm32-unknown-unknown, runwasm-bindgen --target web, verify the emitted artifacts, and apply the V8 namespace patch.
Functions§
- build
- Run the full build: WASM (runtime + pages) → CSS → (optional) content-hash + manifest.