github Effect-TS/effect @effect/platform-node@4.1.0

Minor Changes

  • #8829 8f23668 Thanks @fubhy! - Replace effect/Crypto with family-specific effect/crypto/* services, opaque keys, CryptoError, a configurable WebCrypto reference and key schemas in effect/Schema. Encoding secret or private keys through byte/format schemas requires { allowEncode: true }.

    Breaking changes

    • Use SecureRandom for randomness and UUIDs, and Digest with algorithm values such as Digest.sha256 for hashing. Replace effect/testing/TestCrypto with Layer.mock for the required services.
    • Provide crypto explicitly; it is no longer included in the runtime *Services bundles. NodeCrypto, BunCrypto, DenoCrypto and BrowserCrypto offer individual family layers and a combined layer, supplying SecureRandom where needed. Core modules offer layerWebCrypto.
    • Provide Digest.Digest instead of Crypto.Crypto to SqlMessageStorage and SingleRunner, and instead of EventLogEncryption to SqlEventLogServerEncrypted.makeStorage and layerStorage. Replace EventLogEncryption.sha256String with digest.digestHex(Digest.sha256, bytes).

    Existing workflow ID, activity idempotency key and event log table-name encodings are unchanged.

    Event log encryption, identity key derivation and session authentication now run on Aead, Digest, Signature and SecureRandom. EventLogEncryption.make and EventLogEncryption.layer take those services from context, so Node apps can use the NodeCrypto layers. EventLogEncryption.layerSubtle and the session auth functions use the Web Crypto layers on the WebCrypto reference instead of globalThis.crypto. Existing identities, derived signing keys and encrypted batches are unchanged.

    UUIDv7 and ULID generation is now monotonic below the maximum 48-bit timestamp, including within a millisecond and across clock rollback. Ordering is per SecureRandom instance; the unsafe helpers and model UUIDv7 defaults share per-realm ordering.

  • #10087 472c469 Thanks @effect-bot! - Node.js 22.19.0 (required by undici 8) is now the minimum for @effect/platform-node, @effect/platform-node-shared, @effect/opentelemetry and @effect/docgen, up from 18.

    NodeSocket WebSocket clients now use Node's global WebSocket instead of ws, so client-only usage no longer bundles ws.

    Breaking: ws moved to a new NodeWS module.

    • NodeSocket.NodeWS and BunSocket.NodeWS are removed. Import NodeWS from @effect/platform-node or @effect/platform-node-shared (on Bun, import ws directly). Use NodeWS.WebSocket in place of NodeSocket.NodeWS.default.
    • NodeSocket.layerWebSocketConstructorWS is removed. Use NodeWS.layerWebSocketConstructor.

    Behaviour changes for clients that pass handshake headers, which previously used ws. Use NodeWS.layerWebSocketConstructor to keep the old behaviour:

    • Reads cannot be paused. Incoming frames are buffered without limit, and a configured highWaterMark fails the socket with a SocketReadError.
    • Connection errors are a generic ErrorEvent, so SocketOpenError causes lack the underlying error code.
    • The Socket.WebSocket service is a global WebSocket, so ws instanceof checks and ws-only methods such as terminate() and ping() no longer apply.
    • A custom Host header is ignored.
    • Outgoing messages are not compressed. Incoming permessage-deflate messages are still decompressed.
    • Connections use undici's global dispatcher instead of http.globalAgent / https.globalAgent.

Patch Changes

Don't miss a new effect release

NewReleases is sending notifications on new releases.