The best way to control Claude Code, Codex and more from any computer or phone

main
md 245 KB

@effect/platform-browser

4.1.2

Patch Changes

4.1.1

Patch Changes

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.

  • #8829 93895b9 Thanks @tim-smart! - Add keys to KeyValueStore and SchemaStore. It returns a snapshot of the keys in the store, in no particular order, and is implemented by the memory, file system, SQL, Web Storage and IndexedDB stores. Custom stores built with KeyValueStore.make or KeyValueStore.makeStringOnly must now provide keys.

KeyValueStore.prefix(...) now scopes keys, size and isEmpty to keys under the prefix, with the prefix removed from the returned keys. Previously size and isEmpty reported on the whole backing store.

Stores built with KeyValueStore.make that don't provide clearPrefix now derive it from keys and remove instead of failing for non-empty prefixes.

  • #8829 f97711f Thanks @effect-bot! - Isolate Persistence stores on the KeyValueStore and Redis backings. Clearing a store now only removes that store's entries, and different store / key pairs no longer map to the same backing key.

Add KeyValueStore.clearPrefix, implemented by the memory, file system, SQL, Web Storage and IndexedDB stores. KeyValueStore.prefix(...).clear now only removes keys under the prefix. Stores built with KeyValueStore.make that don't provide clearPrefix remove the matching keys one by one instead of clearing everything.

Both backings now store entries under <storeId>:<key>, with % and : in the store id percent-encoded.

Key layout change. Entries written by earlier versions are not read back:

  • Persistence.layerKvs / layerBackingKvs: every existing entry becomes unreachable, because keys used to be <storeId><key> with no separator. Cached results are recomputed. Chat.layerPersisted on a KeyValueStore backing loses its stored chat histories.
  • Persistence.layerRedis / layerBackingRedis: keys are unchanged unless the store id contains % or :. Entries for those store ids become unreachable.

Old entries are not migrated or removed automatically.

Patch Changes

4.0.7

Patch Changes

4.0.6

Patch Changes

  • #9441 916e709 Thanks @fubhy! - Add the unstable Bytes module with concat, Equivalence, and Order for Uint8Array values. Stream.mkUint8Array now returns Uint8Array<ArrayBuffer>. Browser HTTP clients collect streamed request bodies without repeatedly copying accumulated bytes.

  • #9411 4d86d1b Thanks @effect-bot! - Start Stream.callback and Channel.callback registration before the first pull, so synchronous listener setup no longer misses early events. Browser HTTP response stream listeners now stay installed until the stream is finalized.

  • #9339 9a680d6 Thanks @fubhy! - Add raw HTTP/1.1 upgrades through HttpClientRequest.upgrade, HttpClientResponse.upgrade, the Node HTTP server, and HttpApiSchema.Upgrade. Node clients expose the upgraded connection as a Socket; HttpApi clients return { headers, socket } and OpenAPI documents the 101 response.

Custom HttpClientResponse implementations must add upgrade. Fetch and XMLHttpRequest reject upgrade requests with a TransportError before anything is sent; Bun and Deno servers still support only WebSocket upgrades.

4.0.5

Patch Changes

4.0.4

Patch Changes

4.0.3

Patch Changes

4.0.2

Patch Changes

4.0.1

Patch Changes

4.0.0

Patch Changes

  • #8633 2c552f2 Thanks @IMax153! - Effect 4.0 is the first stable release of Effect v4. It replaces the 4.0.0 beta and release-candidate series, whose per-release notes remain below under the 4.0.0-beta.* and 4.0.0-rc.* headings. To upgrade from Effect 3, follow the migration guide.

Packaging and versioning

  • All Effect packages share one version number and are released together. Use the same version of effect and every @effect/* package.
  • @effect/platform, @effect/rpc, @effect/cluster, @effect/cli, @effect/ai, @effect/sql, @effect/workflow, @effect/experimental and similar packages are merged into effect. Separate packages remain only for platforms (@effect/platform-*), SQL drivers (@effect/sql-*), AI providers (@effect/ai-*), framework bindings (@effect/atom-*), OpenTelemetry, Vitest and tooling.
  • Modules such as effect/http, effect/http-api, effect/rpc, effect/cluster, effect/workflow, effect/ai, effect/cli, effect/sql and effect/schema import from effect/<area>. APIs tagged @stability unstable may have breaking changes in minor releases. APIs without a stability tag follow semver.
  • APIs that expose a third-party dependency are tagged @stability unstable, because that dependency's releases can change them. This covers NodeRedis, DenoRedis, BunRedis, @effect/platform-node/Undici and the undici dispatcher APIs, the ws options and re-exports in the platform packages, driver-specific options and clients in @effect/sql-clickhouse, @effect/sql-d1, @effect/sql-libsql, @effect/sql-mssql, @effect/sql-mysql2, @effect/sql-pglite and @effect/sql-sqlite-do, the provider clients, models and generated schemas in the @effect/ai-* packages, @effect/opentelemetry, and the vitest re-export in @effect/vitest.
  • effect has no runtime dependencies.
  • New packages in v4: @effect/platform-deno, @effect/sql-pglite, @effect/ai-openai-compat, @effect/ai-typesafe, @effect/atom-react, @effect/atom-solid, @effect/atom-vue, @effect/openapi-generator and @effect/doctest. @effect/docgen now lives in this repository.

Core

  • The fiber runtime was rewritten for lower memory use and faster execution, with smaller bundles and better tree-shaking.
  • Services are defined with Context.Service, FiberRef is replaced by Context.Reference, Cause has a flat structure, and many combinators were renamed. See the migration guide for the full list.
  • Software transactional memory is built into Effect.tx, with TxRef, TxQueue, TxHashMap, TxPubSub, TxSemaphore and related Tx* data types.
  • Clock separates wall-clock time from monotonic time.
  • New modules include Semaphore, Latch, LayerRef, ErrorReporter, ByteSize, Newtype and Crypto. Arbitrary is now a native property-based testing module and no longer depends on fast-check.

Schema

  • Schema v4 is a new implementation with faster parsing, class-based schemas, make constructors on every schema, and effectful decoding with services.
  • SchemaRepresentation powers JSON Schema (Draft-04, Draft-07, 2020-12 and OpenAPI 3.0/3.1) import and export, TypeScript code generation, and AI structured output.
  • SchemaBinary provides a compact binary codec and is the default wire format for cluster transports.
  • Optional JIT and AOT schema compilers are available as experimental modules.

Platform, HTTP and RPC

  • HttpApi supports typed response headers, streaming and SSE responses, the HTTP QUERY method, HttpApiTest for in-memory testing, and much faster type checking for large APIs.
  • The HTTP modules add static file serving, response compression, rate-limited clients and graceful server shutdown.
  • Socket has a pull-based reader with backpressure and STARTTLS support. Network addresses are modeled by effect/net.
  • RPC serialization is schema-aware and supports server-originated requests and notifications.
  • @effect/platform-deno adds full Deno support. The Node, Bun, Deno and browser packages all provide the platform Crypto service, and the browser package adds IndexedDB support.

Cluster and Workflow

  • Workflows can be declared with class syntax, and DurableQueue and an in-memory WorkflowEngine are available.
  • Runner memory can be bounded with ShardingConfig limits. Shutdown, entity movement and persisted replies are more reliable.

SQL

  • @effect/sql-pg uses a built-in PostgreSQL client with pipelining, prepared statements and binary codecs, and no longer depends on pg.
  • @effect/sql-sqlite-node uses Node's built-in node:sqlite and requires Node 22.16 or newer.
  • SqlError exposes structured reasons such as UniqueViolation.

AI

  • effect/ai adds EmbeddingModel, the DecisionModel classification and rating API, dynamic tools and tool approvals.
  • The MCP server supports protocol versions 2024-11-05 through 2026-07-28, including elicitation, sampling with tools, resource subscriptions and typed tool output.
  • Provider packages cover Anthropic, OpenAI, OpenAI-compatible APIs and OpenRouter.

CLI, Atom, observability and testing

  • effect/cli adds global flags, command aliases and examples, an interactive wizard mode, and shell completions for Bash, Zsh and Fish.
  • effect/reactivity and the @effect/atom-* bindings add SSR hydration, stale-while-revalidate atoms and serializable RPC and HttpApi queries.
  • The OTLP exporters can be configured with standard OpenTelemetry environment variables, and @effect/opentelemetry aligns logs and spans with the OpenTelemetry specification.
  • @effect/vitest runs property tests with the native Arbitrary module and supports Vitest fixtures.

Requirements

4.0.0-rc.118

Patch Changes

4.0.0-rc.117

Patch Changes

4.0.0-rc.116

Patch Changes

4.0.0-rc.115

Patch Changes

4.0.0-rc.114

Patch Changes

4.0.0-rc.113

Patch Changes

  • #7808 d84f865 Thanks @kitlangton! - Return a typed PlatformError from BrowserCrypto digest operations when crypto.subtle is unavailable, instead of failing with a defect.

  • #7868 6b8128e Thanks @kitlangton! - Fix BrowserKeyValueStore.layerIndexedDb to report keys containing Uint8Array values from has.

  • #7866 53eb888 Thanks @kitlangton! - Invoke custom BrowserRuntime.runMain teardown callbacks when the main effect completes, and remove the pagehide listener once the main fiber finishes.

  • #7818 072005e Thanks @kitlangton! - Preserve out-of-line primary keys in IndexedDB query results, including secondary-index reads.

  • #7820 99f57af Thanks @kitlangton! - Keep streamed IndexedDB selects within their query limits.

  • #7487 ba53b64 Thanks @tim-smart! - Redesign Socket around a scoped, pull-based reader with transport backpressure.

Socket now exposes reader and writer. Client reader acquisition dials and yields a pull of non-empty batches: one buffer for TCP and one entry per WebSocket frame. TCP applies backpressure while paused; pausable WebSockets pause at highWaterMark (64 KiB by default) and resume after draining. Browser WebSockets cannot pause, so they can fail with SocketReadError at a configured highWaterMark. Writes await native drain signals and batch with cork / uncork where available.

### Breaking changes

4.0.0-rc.112

Patch Changes

4.0.0-rc.111

Patch Changes

4.0.0-rc.110

Patch Changes

4.0.0-rc.109

Patch Changes

4.0.0-rc.108

Patch Changes

4.0.0-beta.107

Patch Changes

4.0.0-beta.106

Patch Changes

4.0.0-beta.105

Patch Changes

4.0.0-beta.104

Patch Changes

4.0.0-beta.103

Patch Changes

4.0.0-beta.102

Patch Changes

4.0.0-beta.101

Patch Changes

4.0.0-beta.100

Patch Changes

4.0.0-beta.99

Patch Changes

4.0.0-beta.98

Patch Changes

4.0.0-beta.97

Patch Changes

4.0.0-beta.96

Patch Changes

4.0.0-beta.95

Patch Changes

4.0.0-beta.94

Patch Changes

4.0.0-beta.93

Patch Changes

4.0.0-beta.92

Patch Changes

4.0.0-beta.91

Patch Changes

4.0.0-beta.90

Patch Changes

4.0.0-beta.89

Patch Changes

4.0.0-beta.88

Patch Changes

4.0.0-beta.87

Patch Changes

4.0.0-beta.86

Patch Changes

4.0.0-beta.85

Patch Changes

4.0.0-beta.84

Patch Changes

4.0.0-beta.83

Patch Changes

4.0.0-beta.82

Patch Changes

4.0.0-beta.81

Patch Changes

4.0.0-beta.80

Patch Changes

4.0.0-beta.79

Patch Changes

4.0.0-beta.78

Patch Changes

4.0.0-beta.77

Patch Changes

4.0.0-beta.76

Patch Changes

4.0.0-beta.75

Patch Changes

4.0.0-beta.74

Patch Changes

4.0.0-beta.73

Patch Changes

4.0.0-beta.72

Patch Changes

4.0.0-beta.71

Patch Changes

4.0.0-beta.70

Patch Changes

4.0.0-beta.69

Patch Changes

4.0.0-beta.68

Patch Changes

  • #2180 0176eaf Thanks @IMax153! - Add a platform-agnostic Crypto service for cryptographic random bytes, secure random generators, UUIDv4 / UUIDv7 generation, and digest operations. UUID generation should now use the Crypto service's randomUUIDv4 or randomUUIDv7, which format bytes from the platform Crypto service; UUIDv7 also uses the Clock service timestamp. Random.nextUUIDv4 has been removed because the base Random service is not cryptographically secure.

  • Updated dependencies [af8267f, 0176eaf, 0176eaf, f136bb7, 6f38f07, aec9c40]:

4.0.0-beta.67

Patch Changes

4.0.0-beta.66

Patch Changes

4.0.0-beta.65

Patch Changes

4.0.0-beta.64

Patch Changes

4.0.0-beta.63

Patch Changes

4.0.0-beta.62

Patch Changes

4.0.0-beta.61

Patch Changes

4.0.0-beta.60

Patch Changes

4.0.0-beta.59

Patch Changes

4.0.0-beta.58

Patch Changes

4.0.0-beta.57

Patch Changes

4.0.0-beta.56

Patch Changes

4.0.0-beta.55

Patch Changes

4.0.0-beta.54

Patch Changes

4.0.0-beta.53

Patch Changes

4.0.0-beta.52

Patch Changes

4.0.0-beta.51

Patch Changes

4.0.0-beta.50

Patch Changes

4.0.0-beta.49

Patch Changes

  • #2030 253efe6 Thanks @tim-smart! - Add BrowserPersistence.layerIndexedDb for composing Persistence.layer with the IndexedDB backing layer, and export BrowserPersistence from the package barrel.

  • Updated dependencies [7d87873, c2f6f90, 216f13c]:

4.0.0-beta.48

Patch Changes

4.0.0-beta.47

Patch Changes

4.0.0-beta.46

Patch Changes

4.0.0-beta.45

Patch Changes

4.0.0-beta.44

Patch Changes

4.0.0-beta.43

Patch Changes

4.0.0-beta.42

Patch Changes

4.0.0-beta.41

Patch Changes

4.0.0-beta.40

Patch Changes

4.0.0-beta.39

Patch Changes

4.0.0-beta.38

Patch Changes

4.0.0-beta.37

Patch Changes

4.0.0-beta.36

Patch Changes

4.0.0-beta.35

Patch Changes

4.0.0-beta.34

Patch Changes

4.0.0-beta.33

Patch Changes

4.0.0-beta.32

Patch Changes

4.0.0-beta.31

Patch Changes

  • #1710 990df2c Thanks @gcanti! - Schema: toCodecJson now returns Codec<T, Json, RD, RE> instead of Codec<T, unknown, RD, RE>.

Http: the json property on HttpIncomingMessage, HttpClientResponse, HttpServerRequest, and HttpServerResponse now returns Effect<Schema.Json, E> instead of Effect<unknown, E>.

4.0.0-beta.30

Patch Changes

4.0.0-beta.29

Patch Changes

4.0.0-beta.28

Patch Changes

4.0.0-beta.27

Patch Changes

4.0.0-beta.26

Patch Changes

4.0.0-beta.25

Patch Changes

4.0.0-beta.24

Patch Changes

4.0.0-beta.23

Patch Changes

4.0.0-beta.22

Patch Changes

4.0.0-beta.21

Patch Changes

4.0.0-beta.20

Patch Changes

4.0.0-beta.19

Patch Changes

4.0.0-beta.18

Patch Changes

4.0.0-beta.17

Patch Changes

4.0.0-beta.16

Patch Changes

4.0.0-beta.15

Patch Changes

4.0.0-beta.14

Patch Changes

4.0.0-beta.13

Patch Changes

4.0.0-beta.12

Patch Changes

4.0.0-beta.11

Patch Changes

4.0.0-beta.10

Patch Changes

4.0.0-beta.9

Patch Changes

4.0.0-beta.8

Patch Changes

4.0.0-beta.7

Patch Changes

4.0.0-beta.6

Patch Changes

4.0.0-beta.5

Patch Changes

4.0.0-beta.4

Patch Changes

4.0.0-beta.3

Patch Changes

4.0.0-beta.2

Patch Changes

4.0.0-beta.1

Patch Changes

4.0.0-beta.0

Major Changes

Patch Changes