Skip to content

v0.13.0 - Extension Modules, Contract Linking, Zig 0.16 Validation

Choose a tag to compare

@srdjan srdjan released this 04 Apr 13:07

Highlights

Packaged Extension Modules (zigttp-sdk)

Third-party virtual modules are now first-class. Extension authors depend on zigttp-sdk (a standalone Zig package) and declare a ModuleBinding with the zigttp-ext: prefix. Extensions get the full compile-time pipeline for free: contract extraction, type checking, flow analysis, trace/replay, and runtime sandboxing.

  • packages/zigttp-sdk/ - SDK package with JSValue, ModuleFn, and all declarative types
  • packages/zigttp-ext-demo/ - working demo extension (zigttp-ext:math)
  • zts/module_binding_adapter.zig - zero-copy comptime adapter from SDK to internal types
  • build.zig.zon with minimum_zig_version pinned to 0.16.0-dev.3073+28ae5d415

The VirtualModule enum is eliminated. All modules (built-in and extension) go through the unified ModuleBinding registry.

Cross-Handler Contract Linking

zts link system.json proves that a system of handlers communicates correctly at compile time. The linker resolves fetchSync URLs to target handler routes, checks response coverage, analyzes cross-boundary data flow, and detects failure cascades.

Zig 0.16.0-dev.3073 Validation

Pinned and validated against nightly 0.16.0-dev.3073+28ae5d415. Evented I/O networking still unimplemented upstream. Added nightly revalidation workflow to README.

zigttp:decode Module

Typed request ingress via import { decode } from "zigttp:decode". Schema-validated request parsing at the virtual module boundary.

Breaking Changes

  • VirtualModule enum removed from zts/modules/resolver.zig. Code using VirtualModule.fromSpecifier() or iterating std.meta.fields(VirtualModule) must switch to builtin_modules.fromSpecifier() and builtin_modules.all.
  • ResolveResult.virtual now holds *const ModuleBinding instead of VirtualModule.
  • Registration functions (registerVirtualModule, etc.) take comptime binding: ModuleBinding instead of VirtualModule.

Other Changes

  • self_managed_io flag on ModuleBinding replaces stringly-typed durable exclusion
  • SDK JSValue API tightened: NaN-boxing constants made private, null_val/exception_val removed
  • Comptime assertions for enum ordinal alignment between SDK and internal types
  • Extension adapter uses zero-copy @ptrCast for args instead of per-element conversion
  • HandlerPool stress test stable on dev.3073 (5/5 runs)
  • Long-header streaming test gated behind ZTS_RUN_FLAKY_NIGHTLY_TESTS=1
  • CLAUDE.md trimmed from 355 to 99 lines

Full Changelog

v0.12.0...v0.13.0