Skip to main content

Crate islands_build

Crate islands_build 

Source
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:

  1. WASM (wasm::build_wasm): resolve + install the matching wasm-bindgen-cli, compile the runtime (wasm::build_runtime) and page crates to wasm32-unknown-unknown, run wasm-bindgen --target web, verify the artifacts, and apply the load-bearing V8 namespace patch.
  2. CSS (css::build_css): build the shared base.css and a per-page Tailwind bundle for each page (optionally materializing basecoat.css).
  3. Manifest (hashing::post_build_hashing_pass, gated by BuildPlan::manifest): content-hash every asset, rewrite cross-asset references, and write manifest.json. Off ⇒ logical filenames, resolved by page_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.toml describing 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 write manifest.json. Skipped entirely when plan.manifest is false (the logical-path / dev story).
manifest
The serialized manifest.json schema (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 to wasm32-unknown-unknown, run wasm-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.