Repository navigation
NEXUS v0.12.0
NEXUS v0.12.0 release notes
Prepared 2026-10-10 (not yet released: v0.11.0 is the latest release).
v0.12.0 is a minor release. It adds Runtime.refusalOf, Mesh.update and a shutdown policy for the work a runtime started (shutdown.grace), fixes one behavior of Selector.combine(...).changes, and moves the peer range of @valancex/mesh-runtime to MESH 0.10.
Changes
Runtime.refusalOf(value)returns theRuntime.Refusalinvalue, orundefined.valuemay be aRefusal, aCause, or theFiberFailurethat the PromiseRuntime.runreturns rejects with, so a caller who raced a shutdown can writeRuntime.refusalOf(error)?.code === "terminating"instead of unwrapping the failure by hand. It recognizes a refusal by its shape, asisRefusaldoes, so it works across two installed copies of the package. Anything else, a bug included, givesundefined.Selector.combine(...).changesemits on the first commit of either input. It waited for both inputs to have committed before emitting, so a combined selector whose inputs commit at different times missed the first values of the earlier one. This is a bug fix and a behavior change: a consumer that counted emissions will see one more.Mesh.update(previous, snapshot)is MESH 0.10'supdatethrough the adapter: it returns{ render, patches }, the new render and therender-patch-v1operations a renderer applies in place, or fails withMeshDiagnostics(andpreviousis untouched and still dispatches). Likerender, it is the runtime's operation and nothing more: the adapter keeps no render (M2), a rejection from the runtime is a defect, andpreviousmust be a render of the same program, which only the caller knows. New types:Mesh.UpdatedandMesh.RenderPatches. VALANCE uses it to draw only what changed.@valancex/mesh-runtimepeer range is^0.10.0(was^0.8.0 || ^0.9.0).Mesh.updateneeds 0.10'supdate, and a package that names an export the installed runtime lacks does not load, so an application on MESH 0.8 or 0.9 stays on NEXUS 0.11.
Shutdown: the work a runtime started
Until now, ending a runtime released its resources while the effects started with Runtime.run and Runtime.runFork kept running, so an effect could be using a Resource that was released under it, and nothing waited for it. Termination now settles that work:
- Tracked. An effect started with
runorrunForkis the runtime's work from the moment it starts until it exits, however it exits. - Settled. After new work is refused and the bus is closed, termination waits up to the grace for the work to finish on its own, then interrupts what is left and waits for each effect to exit, so it has run its own finalizers before any resource of the runtime is released. The grace is
shutdown: { grace }onRuntime.makeandApplication.start, orApplication.shutdown(running, { grace })for one call. It defaults to0: interrupt at once, after one turn of the event loop in which a subscription that ended with the bus ends its consumer.Duration.infinitywaits for everything. - Streams end first. The
changesandvaluesof application-ownedState(and aSelectorover it) now end when termination begins to wind the runtime down, so a consumer started withrunends normally instead of being interrupted to make room for a release that waits for it. - A command may end its application. The effect that asks for the shutdown is not waited for or interrupted.
- What a caller sees. An interrupted
runrejects with Effect's interruption (Cause.isInterruptedOnly;Runtime.refusalOffinds nothing), an interruptedrunForkfiber exits interrupted, and work started during the grace is refused withRefusalcodeterminating. - Behavior change. An effect that used to outlive termination is now interrupted. Nothing else about the order of termination changed. Code that needs such an effect to finish passes a grace, or awaits it before ending the runtime.
Compatibility
- API: additive. No export is removed or changed.
- Install: breaking for an application on MESH 0.8 or 0.9, which must move to MESH 0.10 with NEXUS 0.12 (the peer range). Nothing else about installing changes.
- Behavior: the
Selector.combine(...).changeschange and the shutdown change above; nothing else. - MESH, PORT, VALANCE: VALANCE can use
refusalOfonce it depends on this version. - API stability:
Runtime.refusalOfand thecombinebehavior are Stable from 0.12.0.