0.5.0
Highlights
- Strict mode:
--strictfails the build on every untyped oranyvalue and dynamic-tier fallback anywhere, every conversion that copies, every SC61xx performance hint and every Node island, with an explicit per-line// scriptc-allow <code>escape. - Node.js parity: the global
WebSocketclient,CompressionStream/DecompressionStream,Intl.ListFormat,fs.Utf8Streamandfs.openAsBlob(), the crypto DH and X448 key surfaces with ML-KEM encapsulation, TLS session tickets and certificate revocation lists, async-iterable HTTP and HTTP/2 streams with ALTSVC and ORIGIN frames,module.stripTypeScriptTypes, and Node islands on Windows x64. - TypeScript: legacy class, method, property and parameter decorators lower, generic function values instantiated with the enclosing type parameters compile, and mapped sources compile under
--strict. - Faster builds: cold release builds compile faster in the LLVM backend, unchanged compile partitions survive an edit, and a linked executable is reused when every input is a known linkable artifact.
Breaking
- Reading the result of a
void-typed call is now a build error (SC1090). This covers a read used as an argument, as a member or element, from aMap.get(), from a destructured value, through a callback parameter or alias, through an optional chain, a non-null assertion or an angle-bracket assertion, and a conditional arm. Version 0.4.17 compiled these reads and answeredundefined; return the value from the callee instead, or drop the read. - A truthiness test of a
void-typed expression that can hold a value, including an awaitedvoidcall, is now a build error (SC1090). 0.4.17 compiled it. - A partial record assertion whose key order the compiler cannot prove is now refused (SC3001,
partialRecordAssertion:layout): a literal with required properties unwritten when the asserted type is a tuple, has an index signature or accessors, or keeps more than one property order, and a literal whose shared source shape leaves the asserted order unproven. 0.4.17 compiled a literal such as{ from: 1, to: 2 } as Spanin these shapes; write every required property in the asserted type's order, or collect the properties in aPartial<T>orRecord<string, T>value and assert it once complete. - Conditional object spreads beyond
...(c ? { field: v } : {}),...(c ? record : {})and one...(c ? { a } : { b })after properties without effects are refused (SC1090). Spell other shapes as optional fields. - A variadic function value stored under a narrower function type is refused (SC1090) when a caller may pass more arguments than the type names, because the stored function would not receive them.
- Destructuring a method from a process stream (
write,writable) is refused (SC1031); the stream's data members answer and methods are called through the stream. instanceofa built-in class that has no run-time class test yet, such asIteratororMessagePort, is refused (SC1090); test the members the value has instead.Object.getPrototypeOf()on a value whose prototype has no representation (a generator object among them) is now a named refusal (SC1090) instead of a plain object whose chain would disagree with Node.- Boxing a synchronous generator into a checked-dynamic value is refused (SC1090).
- Class decorators on a factory-base class that declares statics, and parameter decorators on function-local classes, are refused.
- A NUL in an HTTP header name built from a dynamic record is refused.
X509Certificatevalues inunknownoranyslots,for...inover them, object spread over them andObject.getOwnPropertyDescriptor()on them have no lowering (SC1090). Their own-key walks answer Node's empty result:Object.keys(),Object.getOwnPropertyNames()andObject.entries()are empty, andhasOwnProperty()andObject.hasOwn()answer false.- An own-property check on the global object through a checked-dynamic value raises the named refusal
Own-property checks on this checked-dynamic kind are not supported yet(SC1090) instead of silently answeringfalse. - Behaviour that changes output:
padStart()andpadEnd()past Node's maximum string length, and arepeat()result past it, now throw Node'sRangeErrorinstead of producing a wrong result;process.sendserializes records likeJSON.stringify;structuredClonekeeps object aliases and sharedArrayBuffers.
Added
- Node.js: the global
WebSocketclient,CompressionStreamandDecompressionStream,AbortSignal.any, a natively compiledFinalizationRegistry,process.config,Object.getPrototypeOf()over every runtime value,Intl.ListFormat, and anIntllocale decided at run time. - crypto:
crypto.diffieHellmanwith DH keys and KeyObjects, key generation on the Koblitz and brainpool curves, explicit EC curve parameters, raw X448 keys (Ed448 is refused clearly), WebCrypto ML-KEM encapsulation,crypto.parsePKCS12, andX509Certificatereflection and construction. - tls: session resumption with tickets and
setSession(),getEphemeralKeyInfo(),setMaxSendFragment(), certificate revocation list checks intls.connect, andgetTicketKeys()/setTicketKeys(). - http and http2:
IncomingMessageand HTTP/2 streams are async-iterable,writeInformation()takes its callback form,ClientRequest.setHeaders()takes aHeadersobject or aMap, request header and trailer objects take array values, ALTSVC and ORIGIN frames are sent and received,performServerHandshake(),goaway/setTimeout/ref/unrefon sessions, stream timeouts, priority andready,session.setLocalWindowSize(), and a server closes its sessions with GOAWAY onserver.close(). - streams: async iteration and disposal across the stream classes, plain function stages in
pipeline()andstream.compose(),Readable.from()over iterables, generators and a signal,Duplex.from()over a lone webWritableStream, andstream/consumershandling that matches Node. - fs:
fs.Utf8Stream,fs.openAsBlob(),stat/lstatoptions on the promise API,FileHandle.statwithbigint, and a file-backedBlobread through its creation descriptor. - worker_threads: a worker's heap statistics through
worker.performance, Node'spostMessageresults and transfer-list validation, clone-error messages, themessageerrorsurface, Worker and MessagePort event keys, and listener counting and removal on MessagePorts. - node:module:
module.stripTypeScriptTypesin strip mode,SourceMapand source-map support in a compiled program,require.extensions,require.cacheandmodule.exportskept in step,createRequirefilename validation, named imports and re-exports from JSON modules, and a literalimport("pkg")joined to the compiled module graph. - TypeScript: legacy class, method, property and parameter decorators lower, including on generic and factory-base classes; generic function values instantiated with the enclosing type parameters; mapped sources under
--strict; classes extending namespace members; symbol-keyed class fields;??chains whose last operand the checker calls unreachable; optional chains narrowed above their result; a tuple'slengththrough an optional chain; indexed-access member calls;typeoffolded for a known type; unions with checked-dynamic members in spreads and destructuring;Mapvalue types seeded from constructor entries; andArray.from({ length })without a mapper. - Diagnostics: SC8002 when islands are off and a package cannot compile, a cast named in a failed unknown-cast check, a warning on impossible layout casts, and no suggested rewrite that would change output.
- Windows: Node islands on Windows x64, with island cache ownership and DACLs verified before reuse.
Changed
- Faster release builds: large dynamic-dispatch helpers compile with a lighter pipeline.
- Faster builds: cold release builds compile faster in the LLVM backend, unchanged compile partitions survive an edit, a linked executable is reused when every input is a known linkable artifact, a large module's function text stays off the V8 heap, and codegen memory accounting counts reclaimable page cache as available on Linux.
- Release and CI: the release reuses the canary build in merge-queue runs that do not change build inputs, requires a green CI run on the release commit, and guards the native compiler profile against drift; canary merges run the plain corpus shards, and the sanitized tier is sharded across lanes.
Fixed
- A WebCrypto namespace alias initializer no longer drops its call, arguments or exceptions.
- fetch: a buffered body's read now settles its job after its chunks, matching Node's order.
- http: a destroyed request reports its own
'close'before the response's,getHeader()returns the value as set, pipelined responses finish when their bytes are written, writes toIncomingMessagemembers land like Node, header values survive reentrant coercion, a header array with holes writes like Node,off/removeListener/unpipework on messages, and acreateConnectiondial for an Agent the program did not create is refused. - http2: session state around connect, settings and timeouts matches Node, CONNECT
req.urland untypeddropRequestlisteners match Node, a secondsendTrailersanswers like Node, and pseudo- and connection-specific headers are validated. - streams: a destroy error reaches a stored iterator's
catch, the readable watermark grows from at least 1,readable.read()validates its size, readers, encodings and pipe destinations stay alive through reentrant calls,once()wrappers come back fromrawListeners(), and a checked-dynamic stream runs itsSymbol.asyncDispose. - net and dgram: the event loop no longer spins when a corked write meets a drained peer,
socket.write()andsocket.end()take an encoding,net.connecttakes Node's options, an idle socket connects to a Unix path,createServerreads array-backed options, and dgram socket and bind options match Node. - crypto and tls: OpenSSL ASN.1 error codes are reported for malformed DER private keys, an ECDSA hash error matches Node, a JWK import's usages are checked before its contents, SubtleCrypto methods read as values answer, the hash context is released, invalid
secureProtocolvalues raise Node's errors, and a certificate's materialized identifiers are released on a bad SAN. - worker_threads, cluster and process: cluster settings are read through getters before the credential check, a failed worker launch stays alive until it finishes initializing, IPC close and child exit follow Node's order,
process.sendserializes records likeJSON.stringify, and IPC message and disconnect listeners can be removed. - events, timers and promises:
errorMonitorruns before the unhandled-error decision, therejectionHandledqueue survives a recovered throw, the timer sequence no longer wraps at 2^32,Promise.alltakes a Set,racetakes plain entries, a dynamicallSettledinput routes to the checked combinator, and JavaScript thenable awaits match Node. - objects, records and arrays: per-instance key order is kept across shared literal shapes, conditional keys, re-added optional keys and dynamic-data records,
structuredClonepreserves object aliases and shared ArrayBuffers,Object.assignskips an optional source record, writes to a frozen array are ignored in sloppy code, cycles held through anErrorpayload are collected, andError.prepareStackTracereads and writes behave like Node. - strings, numbers and JSON:
Symbol.toPrimitiveis invoked with the string hint duringToString,JSON.stringifyreturnsundefinedfor a maybe-undefined value and writes through a getter'sthis,toFixedtakes untyped digits, and TextEncoder and TextDecoder match Node's encoding rules. - fs and Blob: Blob reads are iterative, validate before allocating and open with
O_CLOEXEC, a file-backed Blob reads through its creation descriptor, macOS directory-watch writes are reported,fs.watchFilekeeps Node's registration baseline, and FileHandle web streams close and keeptoWebwrites and sized reads safe. - memory safety: a segmented record's prototype is released before its block is freed, a region held only by an array's metadata is collected, stackless coroutine frames allocate on the inline small-block fast path, and an allocation grow that cannot map its new run copies instead of trapping.
- security: registry tokens, the regex scan cache and histogram buckets are hardened, the WebSocket subprotocol duplicate check is bounded, header names from dynamic records refuse NUL, TLS checks certificate revocation lists, an island tree another process may be loading from is never deleted, island directories are created owned by the user, and Windows island cache ownership and DACLs are verified before reuse.