Skip to content

v0.4.6

Choose a tag to compare

@github-actions github-actions released this 10 Jul 05:50

Node 26.x feature support, plus removal-safe flag injection.

Runtime

Text imports (import data from "./file.txt" with { type: "text" }) now defer to Node's native implementation on Node 26.5+, where nub previously used its own polyfill. Output is byte-identical across the boundary. (#395)

New Node experimental modules are enabled automatically wherever the running Node accepts the flag — no --experimental-* flag to pass:

Module Available from What it is
node:ffi Node 26.1 Call native shared libraries directly from JS
node:vfs Node 26.4 Virtual filesystem module
node:stream/iter Node 25.9 Stream iterator helpers

Ambiguous ES modules now run on older Node. A .js file with ESM syntax and no "type": "module" — which bare Node on the compat tier refuses — is now detected and run as ESM under nub. (#402)

Flag-injection robustness

nub unflags Node features early by injecting --experimental-* flags on the versions that need them. Node removes some of those flags in later releases, and passing a removed flag is a startup abort (node: bad option, exit 9) before any code runs.

nub now intersects the flags it would inject with the target Node binary's actual accepted-flag set, so a flag the running Node no longer recognizes is dropped instead of crashing. A future Node that removes a flag needs no nub release. (#398)

Testing & internals

  • Flag-drift snapshot CI — a scheduled job diffs Node nightly's experimental-flag set against a committed snapshot and fails when a flag is added or removed, so new Node flags are reviewed before nub claims them. (#402)
  • A floating latest-Node leg was added to the version-matrix sweep. (ef6ff07)
  • Cross-tier tests pin the text-import behavior on Node 22.13 / 24.4 / 26.5. (#397)
  • A tsconfig resolution path was adjusted to satisfy the Rust 1.97 question_mark lint; behavior unchanged. (02ce797)

What's Changed

  • Defer to native import-text on Node 26.5+ by @colinhacks in #395
  • test: pin cross-tier import-text behavior (22.13 compat / 24.4 fast / 26.5 native) by @colinhacks in #397
  • Intersect injected flags with the Node binary's accepted set by @colinhacks in #398
  • feat(node): matrix bands for detect-module/ffi/vfs/stream-iter + flag-drift snapshot CI by @colinhacks in #402

Full Changelog: v0.4.5...v0.4.6