Changelog & Release Notes
All notable changes across NimTS releases are documented below.
For release artifacts, pre-packaged tarballs, and git release tags, visit GitHub Releases.
[Unreleased]
[0.4.0] - 2026-11-10
Changed
- First-Class HeaderKit
NimBackendMigration (headerkit[treesitter]>=0.51.0): Updatedpyproject.toml,uv.lock,headerkit.toml,scripts/gen_cabi_dts.py, andtests/test_headerkit_ts_wasm.pyto requireheaderkit[treesitter]>=0.51.0from PyPI and use HeaderKit's first-classNimBackend(backend = "nim"),clean_nim_c_unit, and direct publicextract_nim_ast_datacompiler AST extractor import (withUserWarningdiagnostics on AST/file-read failures, zero private_run_nim_ast_helperfallbacks, and scoped Tripwire subprocess allow rules), eliminating legacynim_cleanupandnim_jsondoctransforms and regex-based source parsing.
[0.3.0] - 2026-11-03
Added
- HeaderKit v2
ts_wasmC-ABI.d.tsGeneration Pipeline: Integrated HeaderKit (headerkit[treesitter]>=0.50.0) viapyproject.toml,headerkit.toml(transforms = ["nim_cleanup"], loaded viaheaderkit._config.load_config),scripts/gen_cabi_dts.py,scripts/compile_wasm.sh(across bothstandaloneandemscriptenbackends),justfile, andpackage.jsonto generate ambientWebAssembly.ExportsTypeScript declarations (ts/cabi_exports.tsand<module>.cabi.d.ts) directly from Nim--header:cabi.houtputs usingheaderkit.generate(..., "ts_wasm", transforms=["nim_cleanup", NimJsonDocEnricher(...)]). - C-ABI Export Docstrings & Runtime Typing: Added
##docstrings across all 28{.exportc.}C-ABI functions insrc/nimts/memory.nim,src/nimts/async_bridge.nim, andsrc/nimts/channels.nim, and wiredNimTsCabiExportsintots/runtime.ts(NimTsExports extends NimTsCabiExports) andts/index.ts. - C-ABI
.d.tsVerification Suites: Addedtests/test_headerkit_ts_wasm.pyand extendedtests/test_runtime.test.tsandtests/test_negative_controls.test.ts(NEG-06) to verify exact structural.d.tsoutput,numbervsbigintscalar ABI mapping, JSDoc and@deprecatedemission, parameter name restoration, andtsc --noEmitvalidation.
[0.2.1] - 2026-10-19
Added
- LaTeX Math Rendering: Enabled client-side LaTeX and formula rendering across the VitePress documentation using
markdown-it-mathjax3(markdown: { math: true }).
Documentation & Architecture
- Async & Threading Architecture: Rewrote
docs/guide/async-bridge.mdto establish clear, forward-facing technical principles:- Synchronous execution of standard WebAssembly on the caller's thread with sub-nanosecond register speed.
- Dedicated background execution via Web Workers (
?worker/@axiomantic/nimts/worker) and AudioWorklet for CPU/DSP computation. - Clean separation of concerns with TypeScript managing browser I/O (
fetch, timers) and passing buffers directly to Nim. - Reframed
Future[T]as a low-level FFI callback bridge for host resumption, purging misleading in-thread cooperative coroutine claims.
- Terminology Cleanliness: Scrubbed internal conversational jargon from user-facing guides and updated navigation to "Async & Threading".
[0.2.0] - 2026-10-18
Added
- First-Class WebAudio AudioWorklet Support (
@axiomantic/nimts/worklet&.nim?worklet):- Implemented
{.exporttsWorklet.}and{.exportts, audioProcess.}pragma macros insrc/nimts/macros.nimandsrc/nimts/codegen.nim. - Added
@axiomantic/nimts/workletruntime withNimTsAudioWorkletProcessorsupporting WASI snapshot preview 1 mocks, zero-copyFloat32Arrayaudio render callbacks, and parameter automation. - Implemented
createWorkletProcessorScriptbundle code generator for inline Blob URL worklet script loading. - Implemented strongly typed
NimTsWorkletClient<T>with thenable-safe RPC proxy, event subscriptions (.on()), and WebAudio graph routing (.connect()). - Added
.nim?workletVite query support invite-plugin-nimtsgeneratingcreateWorkletfactory andNimWorkletNode.
- Implemented
- Zero-Copy Pinned TypedArray Views (
NimTsView[T]):- Implemented
NimTsView*[T]insrc/nimts/types.nimandinitNimTsView/newNimTsViewinsrc/nimts/memory.nim, exposing live zero-copy views into Nim data structures across the C-ABI boundary viapackNimTsViewResult. - Added
NimTsViewclass andcreateNimTsViewproxy factory ints/runtime.tsandsrc/nimts/codegen.nim. - Enabled direct array indexing (
view[i]), slice/subarray operations, iterator support (for..of), and live bidirectional mutations between Nim and JavaScript/TypeScript without intermediate allocations or JSON serialization. - Implemented dynamic detachment resilience: automatically detects WebAssembly
memory.grow()reallocations and transparently re-binds the underlying TypedArray view to the newArrayBuffer. - Added
createView<T>(pointer, length, ctor)helper method toNimTsRuntime.
- Implemented
- Binary TypedArray ABI Marshaling for
seq[T]/openArray[T]:- Implemented raw binary TypedArray marshaling across the WASM C-ABI boundary for numeric slices (
openArray/seqofbyte/uint8,int8,int16,uint16,int32,uint32,float32,float64,int64,uint64). - Completely bypassed JSON text serialization and string parsing for numeric collections, replacing them with direct binary pointer/length descriptor passing (
packBuffer) and.slice()views overwasmMemory.buffer. - Added
allocTypedArrayResult[T]andreadTypedArray[T]insrc/nimts/memory.nimwith zero intermediate allocations foropenArray[T]. - Added
readTypedArrayandpassTypedArrayints/runtime.tsand generated TypeScript / JavaScript glue wrappers.
- Implemented raw binary TypedArray marshaling across the WASM C-ABI boundary for numeric slices (
- Multi-Repo & Linker Discovery in
vite-plugin-nimts:- Added
nimPaths(--path:...),clangFlags(--passC:...),linkerFlags(--passL:...),cwd, andwatchGlobsplugin options. - Automated export of symbols referenced in
_nimts_exports.jsonmanifest via-Wl,--export=.../ wasm-ld. - Added transitive
.nimimport and include dependency tracking for instant Vite HMR invalidation across local packages.
- Added
- Multi-Threaded Web Worker Runtime (
@axiomantic/nimts/worker):- Implemented
spawnWorker(moduleUrl, options)providing transparent async RPC proxying to background Web Workers. - Added Vite
?workerquery syntax support (import SynthWorker from './synth.nim?worker') for effortless zero-config worker instantiation. - Implemented bidirectional zero-copy
ArrayBufferdetachment via Transferable objects (extractTransfers) for both call arguments (Main → Worker) and return values (Worker → Main). - Automated
Future[T]toPromise<T>settlement inside worker threads.
- Implemented
- Wait-Free SPSC Channels (
NimTsChannel[T]/Channel[T]):- Implemented high-performance lock-free Single-Producer Single-Consumer ring buffer in
src/nimts/channels.nimwith monotonic atomic head/tail indices. - Added idiomatic
Channel[T]alias andnewChannel[T](capacity)constructor. - Added
nimts_chan_get_raw_ptrsC-ABI export for zero-copy memory inspections. - Implemented
AsyncIterable<T>streaming wrapper in TypeScript runtime (for await (const chunk of channel)). - Implemented channel chunk streaming across
MessagePortwith per-item buffer detachment.
- Implemented high-performance lock-free Single-Producer Single-Consumer ring buffer in
- WebGPU 256-Byte Aligned Allocator & Storage Buffers:
- Implemented
nimts_alloc_alignedandnimts_free_alignedinsrc/nimts/memory.nim, supporting power-of-two alignments with a base-pointer prefix header. - Enforced 256-byte alignment matching WebGPU's
minUniformBufferOffsetAlignmentstandard. - Added
GpuBufferSlice[T]in Nim and TypeScript with direct, zero-copydevice.queue.writeBuffertransfers from WASM linear memory into GPU staging buffers.
- Implemented
- Dual-Tier Nim Architecture (
src/nimts/js_client.nim):- Created client module for Nim JS applications (
nim js) allowing DOM/UI layers (Karax, standard DOM) to consumenimtsWASM modules with native Nim signatures and zero handwritten JS/TS glue. - Added
NimTsJsModule,loadNimTsModule,loadNimTsExports,toFuture,toUint8Array, andtoSeqByte. - Added automated
test:nim-jsintegration suite compiled vianim js -d:nodejs.
- Created client module for Nim JS applications (
- Dedicated Backend Architecture Guides:
- Authored Standalone Micro-WASM Backend (
wasm32-wasip1) detailing Clang +wasm-ld+wasi-sysroottoolchain flags, included/excluded features, and AudioWorklet safety. - Authored Emscripten Runtime Backend (
wasm32-unknown-emscripten) detailingemccvirtual filesystem (FS) and POSIX libc shims.
- Authored Standalone Micro-WASM Backend (
- Comprehensive Memory & GC Guide:
- Authored Memory Management, Stateful Handles & Garbage Collection detailing ARC/ORC destructors, zero GC pause guarantees, ephemeral call lifecycles, and leak hazard mitigations.
Changed
- Honest Concurrency: Purged single-threaded fake async/await heuristic (
poll()loop) in favor of true off-thread Web Worker execution. - Terminology Cleanliness: Eliminated internal development jargon ("honest async", "lying async") across documentation in favor of standard engineering terms (Multi-Threaded Web Worker Runtime, Background Promise, CPU-Bound Main Thread Pitfall).
- Streamlined README: Simplified
README.mdto mirror the getting started guide with a 3-step Quickstart, side-by-side consumption patterns, and fact-checked WebAssembly gotchas table.
Removed
defined(js)Purge: Purged all vestigialwhen defined(js)andwhen not defined(js):branches acrosssrc/nimts/channels.nimandtests/test_channels.nimsince WebAssembly linear memory is the default and only expectation for core channels.
[0.1.0] - 2026-10-17
Added
- Initial public release of NimTS.
- Non-invasive
{.exportts.}macro preserving 100% native Nim procedure signatures. - Companion C-ABI code generation and automatic TypeScript
.d.tsdeclaration generation. - Support for primitive types (
int32,float32,float64,bool), UTF-8 strings (string,cstring), and binary byte arrays (openArray[byte],seq[byte]). - Stateful opaque handles for
ref objectinstances withGC_ref/GC_unref, deterministic.dispose(), andFinalizationRegistrysafety nets. - Bidirectional async bridge connecting Nim
std/asyncdispatch(Future[T]) to JavaScriptPromise<T>. - Official Vite plugin (
@axiomantic/nimts/vite) for direct.nimimports with on-the-fly background WASM compilation and hot module reloading. - Standalone CLI compiler tool (
nimts compile) supporting both Standalone micro-WASM and Emscripten compilation backends. - Complete documentation suite with VitePress deployed to GitHub Pages.