• v2.16.0 797b9fbfa9

    v2.16.0
    All checks were successful
    release / build-and-release (push) Successful in 1m23s
    Stable

    littleisland released this 2026-11-06 23:55:17 +00:00 | 89 commits to main since this release

    NOE v2.16.0

    This release adds standard EventSource and asynchronous SQLite, consolidates
    host APIs under noe:fs, noe:process, and noe:http, and corrects HTTP body
    limits and WebSocket lifecycle behavior.

    JavaScript compatibility changes: the old filesystem, process, and HTTP
    imports are removed without adapters. Standard-I/O and filesystem entry points,
    custom WebSocket headers, server close, and several WebSocket defaults change.
    Use the v2.16.0 migration guide when upgrading from
    v2.15.0. The public Go packages retain the /v2 module path and independent
    capability selection.

    Host APIs

    • noe:fs is the filesystem module. Direct operations are asynchronous,
      explicit Sync helpers remain, open uses options, FileHandle has concise
      read/readAt/write/writeAt methods, and watch is an async iterator. The
      node:fs, node:fs/promises, fs, and fs/promises imports are removed.
    • noe:process combines the selected command functions, stdin/stdout/stderr
      byte Web Streams, and named process metadata/control object. The default
      object is the selected module namespace, with metadata under .process.
      Global process remains. The node:child_process, child_process,
      node:process, and process imports are removed.
    • noe:http contains capability-selected serve, createWebSocket, and
      upgradeWebSocket, without a default or fetch export. The node:http and
      http imports and global serve/upgradeWebSocket helpers are removed.
      Standard Fetch, Request/Response, WebSocket, EventSource, and Streams remain
      global. Custom handshake headers move from the constructor's third argument
      to createWebSocket(url, {protocols, headers}).

    These entrances share the existing native implementations. Root, Cwd,
    ReadOnly, URL/command grants, borrowed resources, execution cancellation,
    and main/Worker capability boundaries remain in force.

    EventSource

    new EventSource(url) consumes server-sent events through Fetch authority.
    It supports named events, multiline messages, IDs and Last-Event-ID on
    reconnection, retry fields, and cancellation by close(). It is inherited
    by Workers when Fetch is selected. No additional network capability is
    introduced, and no custom-header constructor extension is added.

    The selected HTTP client and redirects use the existing Fetch backend.
    The subscription can remain active while receiving many small events; the
    host buffer limit applies to a partial event rather than lifetime traffic.
    See the EventSource contract.

    Asynchronous SQLite

    noe:sqlite provides Promise-based open/exec/run/get/all/prepare/transaction/
    close and asynchronous disposal. SQL runs off the JS owner, and each
    connection serializes submissions. Transaction callbacks reserve their queue
    through commit or rollback, including awaits and cancellation.

    import {open} from "noe:sqlite";
    
    await using db = await open(":memory:");
    await db.exec("CREATE TABLE notes(text TEXT)");
    await db.run("INSERT INTO notes VALUES(?)", ["hello"]);
    console.log(await db.get("SELECT text FROM notes"));
    

    Memory databases need no filesystem grant. File databases share the selected
    filesystem, including sidecar authority, Root/Cwd/ReadOnly, and forced
    execution cleanup. BLOBs use copied typed arrays; integers outside the safe
    number range use bigint. Statements support reuse and async disposal.
    WAL is supported on writable profiles; FS.ReadOnly profiles refuse WAL-format
    databases because their shared-memory sidecar can require writes. Use
    rollback-journal databases there. See the
    SQLite contract.

    SQLite adds github.com/ncruces/go-sqlite3 v0.36.0 and its translated SQLite
    support dependencies. The runtime remains CGO-free across the six release
    targets; this does not expose a general JavaScript WebAssembly/FFI API.

    HTTP limits and cleanup

    Fetch response limits and Serve request limits now reject actual overflow
    instead of successfully returning a truncated prefix. Bodies exactly at the
    cap succeed after a bounded EOF probe. Zero selects the 32 MiB default and
    negative values disable the host body bound.

    Serve body overflow rejects with RangeError and ERR_HTTP_BODY_TOO_LARGE.
    Uncaught overflow yields 413 before response headers; onError can override
    that response. A response already streaming is aborted on overflow.

    server.close() returns the same Promise on repeated calls. It stops
    handler admission immediately and waits asynchronously for handlers/body I/O,
    with the existing five-second graceful allowance and forced fallback.
    Symbol.asyncDispose delegates to close. A shutdown handler can initiate
    close and return a response; await completion outside that handler. Forced
    runtime/Worker cleanup remains independent, and upgraded sockets have their
    own lifetime. See Serve details
    and the Fetch correction.

    WebSocket behavior

    • Binary messages default to Blob; set binaryType to "arraybuffer" for raw
      ArrayBuffer delivery. Blob/File sends use the native binary queue while
      preserving message order and payload snapshots.
    • Closing during CONNECTING interrupts dialing/HTTP handshake. Late results
      cannot reopen a closed socket. Execution cancellation and Worker termination
      interrupt stalled handshakes and blocked writes.
    • Close arguments are validated before state changes, including repeated
      close calls. Invalid codes throw InvalidAccessError; reasons over 123 UTF-8
      bytes throw SyntaxError.
    • Established close flushes accepted sends and waits up to five seconds for
      the close-frame exchange. A no-argument close sends an empty frame; use
      close(1000) for an explicit status. The event reports the first peer
      code/reason, with 1005 for an empty frame or 1006/empty reason when no close
      arrived. wasClean requires successful frames in both directions.
    • Native closing continues while JavaScript is busy, and force cleanup can
      interrupt pending I/O without waiting for graceful completion. Error details
      remain on the error event, rather than replacing the peer close reason.

    See opening lifecycle and
    connected close.

    Verification and distribution

    Per-slice verification covers affected unit/race tests, CLI/Worker/fixture-
    agent routes, native ownership, grants, independent capability selections,
    public consumers from standalone Go module artifacts, type declarations,
    and bounded reviews. SQLite and consumer builds cover the six release
    targets. Release preparation reuses these results for unchanged source and
    checks the release candidate and documentation with focused smoke.

    The tag-triggered CI builds all six CGO-disabled distribution binaries,
    creates SHA256SUMS, and uploads this release without repeating local source
    suites. Downloaded assets, build metadata, native smoke, and published-module
    consumers are verified after publication. Native execution is Linux amd64;
    other targets receive build/checksum verification.

    Go 1.27.2, official go-quickjs v0.32.0, go-intl v0.8.0, and disabled JIT remain
    selected. Installed executables and running applications are separate from
    publishing these assets. See the release checkpoints.

    Downloads