0.5.1
Features
- WebAssembly SIMD instructions are translated, and every SIMD memory access is bounds-checked.
- Other languages can target scriptc through an experimental IR input in
@scriptc/experimental. - crypto: DSA keys can be generated, imported, and used to sign and verify.
- Intl: every locale's data ships on macOS.
- Intl: the macOS x64 runtime pack ships ICU.
- Node islands: a Windows x64 build uses the libnode pack.
Node.js and TypeScript parity
- crypto:
X509Certificate.toString()andtoJSON()return PEM text. - crypto:
X509Certificatevalues cross untyped and checked-dynamic values. - crypto:
crypto.subtlereads as a value, and a call on a non-alias receiver evaluates that receiver before the native call. - fetch:
NO_PROXYmatching follows the installed undici version. - http:
Responsebody reads settle in Node's order. - http:
ServerResponse.shouldKeepAlivematches Node. - http: a framing header that is an empty array frames the body like Node.
- http2: session limits are applied in
performServerHandshake. - http2: a compatibility request supports
destroy(). - http2: configured settings are applied in a socket handshake, and a header-block failure ends with
COMPRESSION_ERROR. - http2: stream diagnostics channels are published.
- http2: a session keeps its timeout through a graceful close, a server releases only its own sessions at peer EOF, and two timers that share a deadline emit the timeout once.
- https: an Agent's TLS options are passed to connections, and agent sockets are named like Node's.
- websocket: the socket error callback is owned after the upgrade.
- tls: object
pfxentries convert withtoStringlike Node. - net:
net.connect(path)works from JavaScript. - net:
net.createServerreads options from an array options bag. - streams:
_finalis called on constructor-function Transforms. - streams: a throwing hook's error completes the stream like Node.
- streams: a
TransformStreambody read settles before the writer's close. - streams: a destroyed stream's iterator reports premature close.
- streams: stream and dgram errors carry their own name.
- streams: async dispose on a stream reports
AbortError. - process: stdin chunks are delivered as Buffers, and stdin listeners are removed and signals are typed like Node.
- process: an unhandled rejection reports like Node.
- process: a strict write to an undeclared name throws
ReferenceError. - module: a project JavaScript module's exports are read the way Node reads them, including an undefined missing namespace member and a namespace re-export.
- module: the JSON import attribute is required like Node.
- objects: Error classes have Node's prototype chain.
- objects: an interface-typed value reports its
Symbol.toStringTag. - objects:
structuredCloneshares aSharedArrayBuffer's memory, including growable and resizable buffers. - Intl:
Intlmembers read from JavaScript,NumberFormat.resolvedOptionsanswers, and formatting and range gaps are filled. - Atomics:
Atomics.isLockFreeworks. - functions:
bind,call, andapplywork on dynamic function values, and theFunctioninterface works on them. - islands: tuples of copied values cross the island boundary.
- islands: a program class can be constructed from Node island code.
- fs:
fs.watchlisteners are typed and take an abort signal. undefinedoptional options are treated as absent.- TypeScript: a method call on a union receiver resolves.
- TypeScript: a
useRefobject stays stable when narrowed. - TypeScript: a method call through an optional chain on a possibly undefined value runs.
- TypeScript:
https.Serversecure context methods are typed. - TypeScript: a package's declaration file beside its runtime file is used for types.
- TypeScript: class members keyed by
Symbol.forcompile. - TypeScript:
SymbolandArraymembers read through computed keys. - TypeScript:
any[]rest parameters and spreads are accepted. - TypeScript: an unchecked JavaScript call to a JSDoc-typed parameter is admitted.
- TypeScript: a JavaScript raw value that receives untyped data widens.
- TypeScript: overlapping records route into a discriminated union by discriminant.
- TypeScript: array mutations lower on an array-or-nullish receiver.
- TypeScript: a
voidcall's result is allowed in return and discard positions. - TypeScript: a checked dictionary read keeps its null arm, and widened array elements keep their elements.
- TypeScript:
AbortSignal,fetch, and cipher values stay static under--strict. - TypeScript: a receiver-free closure adapter and a primitive record key stay static.
- TypeScript: a
NoThrowfunction can call a module const arrow declared before any statement that runs code. - diagnostics: SC6101's diagnostic names the function and construct, and a strict diagnostic names the class crossing.
Fixes
- islands: a throwing signal listener's error reaches
process.emit. - objects: an expando that shadows an Array subclass method is stored on the instance.
- compiler: emitting a large program no longer overflows the stack.
- compiler: a call through an exported member is analyzed like the same call written directly.
- compiler: a checked-dynamic object's own-key check sees a property added through its native source.
- compiler: the parameter guard throws
TypeErrorfor a JavaScript caller. - compiler: an
undefinedvalue in an untypedletkeepsundefinedin its type, so a--strictbuild no longer throws where Node printsundefined. - compiler: an optional chain on a literal nullish receiver answers
undefined. - compiler: a union value that crosses into a narrower union keeps the arm the destination accepts.
- runtime: error constructors are restored on shared error prototypes.
- runtime: a library archive links the runtime units its code uses.
- wasm: a deep WebAssembly recursion trap is caught on Windows.
- tls: a failed entry read in a
pfxarray throws instead of crashing. - agent: the host stays alive while
Agent.getNameconverts its options.
Performance
- Class ancestry lookups are cached.
- A UTF-8 read stream frees its decoder state, and a finished
Utf8Streamunlinks in constant time. - A function that only reads module constants declared before it stays in the static tier, and a
TextDecoderconstruction stays in the static tier. Mapcollection ingestion folds into one pass, and a staticRegExppattern is folded with its named groups traced through helpers.- A small closure called from a sibling closure is inlined.
- An Array subclass method is read without copying the array.
- Finished HTTP messages and their headers are freed.
- Island bridge scratch is released after each emitted event.
- The promise rejection queue is linked only where rejections are tracked, and the value renderer used by
assert.ifErroris linked only by programs that can call it. - Startup time and binary size are back to 0.5.0's levels.
Security
repeat(),padStart()andpadEnd()throw Node'sRangeErrorwhen the result passes the maximum string length, instead of producing a wrong or oversized string.- TLS checks a directly trusted intermediate certificate against its issuer's CRL.
- An HTTP/2 client honors the peer's
maxConcurrentStreams, and a server never opens a stream past its newest SETTINGS.
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.