Skip to content

Crates

Generated from Cargo.toml when the site was built at 7aa23e2.

Generated from cargo metadata on every build. Each crate names its layer in [package.metadata.niso] layer, and cargo xtask layers checks the dependency rules between layers (Crates and contracts). At this build it said: layers: ok (10 allowlisted edges and 0 layer claims left). A crate’s description is its Cargo.toml’s, or else the README’s line about it, or else the first sentence of its crate docs. Crates with a CONTRACT.md link to it; the others have none yet.

Crate Layer What it is Contract Depends on (niso)
niso-base base niso’s shared vocabulary: handles, errors and the C value types contract
niso-host host The host contract niso’s web API crates run against contract niso-base
niso-sched sched The run loop niso’s hosts share: a task queue, pull sources, timers, animation frames and a real or virtual clock contract niso-base, niso-host
niso-canvas web-api A Canvas 2D context rasterized on the CPU: HTML’s CanvasRenderingContext2D (state, transforms, paths, fills and strokes, clipping, styles, compositing, shadows, images, pixel access and text) over a bitmap, with vello_cpu drawing. contract niso-base, niso-host
niso-crypto web-api the cryptography under crypto.subtle, on AWS-LC through aws-lc-rs.
niso-storage web-api Ordered, transactional storage with IndexedDB’s key encoding: the SQLite, memory and C drivers contract niso-base, niso-structured-clone
niso-structured-clone web-api HTML structured serialization as bytes: the format, its decoder and graph inspection contract niso-base
niso-xml web-api XML 1.0 parsing and DOM Parsing’s XML serialization over its Builder and Tree traits; DOMParser, XMLSerializer and responseXML use it. contract
niso-xpath web-api XPath 1.0 and DOM’s XPath interfaces over the trees a host lends through niso-host’s Tree; document.evaluate runs it over the DOM. contract niso-host
niso-core document the DOM core, on blitz-dom. niso-base, niso-canvas, niso-crypto, niso-host, niso-sched, niso-storage, niso-structured-clone, niso-xml, niso-idl
niso-actions document-extension WebDriver’s input for niso: the actions algorithm (WebDriver, “Actions”: Perform Actions and Release Actions) and the input of Element Click and Element Send Keys, carried out with the calls a host reports a user’s input with (niso_dom_pointer, niso_dom_key, niso_dom_wheel, niso_dom_text_input, niso_dom_scroll; see [dispatch]). niso-core
niso-capi c-api the C API (niso.h), as a static and dynamic library. Timers and animation frames are part of it: the DOM runs the event loop for every language. niso-core, niso-host, niso-xpath, niso-compose, niso-idl
niso-intl engine ECMA-402’s locale data and formatting on ICU4X, for a binding whose engine has no Intl.
niso-jvm binding the JVM binding, for Java and Kotlin: a class per DOM interface in dev.niso.dom, generated from the WebIDL with the JNI functions behind them, and the hand-written runtime (Dom, handles, callbacks, exceptions). libniso_jvm is the C API with those JNI functions; the Android host links them into its own library. niso-capi, niso-porffor, niso-quickjs, niso-idl
niso-napi binding the binding as a Node-API addon, V8 under Node (JavaScriptCore under Bun), with each page in a realm of its own and Node’s event loop driving it, and niso-node, niso-run on it. See docs/engines/napi.md. niso-capi, niso-core, niso-compose, niso-idl
niso-porffor binding the binding on Porffor, compiled ahead of time with the scripts it runs, and niso-run-porffor. See docs/engines/porffor.md. niso-capi, niso-core, niso-intl, niso-compose, niso-idl
niso-quickjs binding the binding on QuickJS-ng, and niso-run, which runs scripts against a headless DOM. niso-capi, niso-core, niso-intl, niso-compose, niso-idl
niso-android composition The Android host’s native side: the JNI methods of dev.niso.host.Native. niso-core, niso-jvm, niso-porffor, niso-quickjs
niso-app composition what a native host links: the C API plus QuickJS as one static library, and niso_app.h, the niso_app_main(dom) entry point an app library in any language exports. niso-porffor, niso-quickjs
niso-compose build Composes the files the builds use, niso’s C runtime header (niso_runtime.h) and JS glue, from sections that each belong to one crate (migration step 6). contract
niso-idl build the WebIDL model and code generators.
niso-capi-tests program Runs the C API test program, which is written in C against niso.h. niso-capi
niso-iced program the Linux host. niso-core, niso-quickjs
niso-timer program The timer app in Rust, through the niso C API alone (declared in niso): start, stop, lap and reset buttons, the elapsed time, a lap list, a “keep screen on” switch and a progress bar through the current minute.
niso-wpt program the web-platform-tests runner. See docs/wpt.md, which also explains the Baseline score in tests/wpt/baseline.json. niso-actions, niso-core, niso-quickjs
xtask Repository checks that are not tests of one crate. niso-compose, niso-idl

The native programs that run a page and draw it, one per UI toolkit (Hosts). Described by the README; the iced host is also a crate above.

Host What it is
hosts/android the Compose host, calling crates/niso-android over JNI, with a Glance widget and an ongoing notification drawn from the page’s surfaces. hosts/android/niso is the page host as an Android library, which the host app (app) and other apps build on.
hosts/apple the SwiftUI host for iOS, iPadOS, macOS, visionOS, tvOS and watchOS, linking crates/niso-app, its platform differences in hosts/apple/Sources/Platform, with a widget extension (hosts/apple/Widgets) that draws the page’s surfaces as home screen widgets and its Live Activity, from templates the app shares through an App Group, and CarPlay’s templates from the page’s carplay.* surfaces. See docs/hosts/apple.md.
hosts/iced

From xtask/layers-allowlist.txt: edges the rules forbid that are allowed for now, each with its reason. The list only shrinks.

  • niso-core -> niso-crypto: The core’s api/crypto.rs (getRandomValues, randomUUID, SubtleCrypto jobs) calls niso-crypto’s primitives. Goes in step 12, when api/crypto.rs and its job source move into niso-crypto and the core no longer names it.
  • niso-core -> niso-canvas: The canvas element’s half of Canvas 2D (HTMLCanvasElement and its CanvasRenderingContext2D: bitmaps keyed by node, sized by attributes, shown through the render stream, tainted through the image loader; api/canvas.rs and canvas.rs) stays in the core behind its canvas feature (default on, so a composition can drop it) and drives niso-canvas, the standalone rasterizer and objects crate. Goes in step 18, when that half moves out of the core into an L2 crate of its own through ElementInterface and RenderContributor, and niso-canvas stays a web API crate under it.
  • niso-core -> niso-structured-clone: The core re-exports the crate as niso_core::structured_clone (migration rule 2) and still holds its users: IndexedDB (indexeddb/*, api/indexeddb.rs, api/storage.rs), messaging (messaging.rs) and history state (api/history.rs). Goes in step 20, when the re-exports are deleted; steps 5, 9 and 13 move the users out first.
  • niso-core -> niso-storage: The core re-exports the crate as niso_core::storage (migration rule 2) and still holds its users: IndexedDB (indexeddb/, api/indexeddb.rs), the Web Storage areas (api/storage.rs), and the Dom’s storage setters behind niso_dom_set_storage_ and niso_dom_set_app_origin (storage/mod.rs). Goes in step 20, when the re-export is deleted; steps 9 and 10 move the users out first.
  • niso-quickjs -> niso-core: The binding drives the document through niso-core’s internals: Js holds and hands out the document as a *mut Dom (src/lib.rs), and page.rs and the niso-run binary call niso_core::api to load pages. Goes in step 19, when the binding moves onto the crates’ public APIs (niso_js.c and the QuickJS adapter rewritten in Rust on rquickjs, rule 6) and the page runner into a composition.
  • niso-porffor -> niso-core: niso-porffor compiles niso-quickjs’s src/lib.rs (#[path]), so it has the same *mut Dom wrapper. Goes in step 19, when Porffor’s binding becomes a thin C adapter over the C ABI (Porffor’s generated code exposes only C).
  • niso-napi -> niso-core: The Node-API addon drives the document in Rust, as niso-quickjs does: it holds a *mut Dom and niso_core::ffi’s string types (src/lib.rs:58-59) and loads markup through niso_core::api (src/lib.rs:911). Goes in step 19, when the addon calls the crates’ public APIs through Node-API from Rust; it becomes a composition in step 20.
  • niso-jvm -> niso-quickjs, niso-jvm -> niso-porffor: The JVM binding links QuickJS into libniso_jvm so Java pages run script (niso-jvm/src/lib.rs: use niso_quickjs as _), or Porffor with the porffor feature (use niso_porffor as _). Goes in step 20, when a composition crate links the engine next to the JVM binding.
  • niso-core -> niso-xml: niso-core -> niso-xml: the core implements niso-xml’s builder and tree traits (api/dom_parsing.rs) for DOMParser, XMLSerializer and XMLHttpRequest’s XML documents until niso-host exposes DOM construction; the serializer could move onto niso-host’s Tree now, but parsing needs construction. Removed when DOM Parsing moves onto the host contract