Skip to main content

Crate islands_runtime

Crate islands_runtime 

Source

Structs§

Signal

Functions§

__islands_remount
Called by the JS side after $ISLANDS_REPLACE injects new island markers. Idempotent because mount_all only processes :not([data-island-mounted]).
effect
Run callback immediately as a reactive effect. Any Signal::get calls inside the callback register a subscription; the callback re-runs whenever those signals change.
init_nav
Initialize client navigation when the nav feature is enabled.
init_panic_hook
Install the console_error_panic_hook so Rust panics appear in the browser console instead of a cryptic “unreachable executed” message.
keep_alive_in_current_scope
Transfer ownership of value into the current scope’s keeper list so it stays alive for the scope’s lifetime. Used by islands-runtime-bindings to hand Closure objects across the module boundary without Closure::forget.
mount_all
Walk [data-island]:not([data-island-mounted]), create a Scope per island, call the registered mount function inside the scope, then mark the element as mounted. Islands that error are logged and skipped; others continue.
navigate
Programmatically navigate to url (a same-origin path), as if a link to it were clicked. Runs the same contract as an intercepted click. On any failure it falls back to a full document load so the user always reaches the page.
on_event
Attach an event listener on target for event_name, calling handler. A cleanup that removes the listener is registered on the current scope so the listener is removed when the island is unmounted.
register_island
Register a mount function for a named island.
scope_registry_len
Number of scopes the registry currently holds. Exposed for the navigation layer’s leak canary: a mount/unmount round-trip must return this count to its baseline (no orphaned SCOPE_REGISTRY entries — AC-V14).
unmount_island
Tear down a mounted island: run its Scope’s LIFO cleanups exactly once and drop its registry entry so the slot is reclaimed.