Skip to content

Releases: Effect-TS/effect

effect@4.0.0-rc.113

effect@4.0.0-rc.113 Pre-release
Pre-release

Choose a tag to compare

@effect-bot effect-bot released this 10 Sep 00:38
d3b837a

Patch Changes

  • #7738 49e3901 Thanks @kitlangton! - Retain completed tool approval results in non-streaming responses so Chat records them and does not replay approved tools on later turns.

  • #7483 b945ded Thanks @tim-smart! - Align runtime type IDs with their module paths. Effect markers now omit legacy grouping prefixes and the unstable path segment, while OpenTelemetry spans use the OtelTracer module path. Custom implementations that copy these marker strings must adopt the corrected IDs.

  • #8014 d6422f4 Thanks @kitlangton! - Fix Effect.all to retain errors and required services from every branch of a union of record inputs.

  • #8095 5a80204 Thanks @gcanti! - Fix Arbitrary.schema to respect applicable index signatures when generating and shrinking object properties, including fixed fields in Schema.StructWithRest and overlapping records.

    Combine compatible string, number, and bigint constraints during generation so cases such as a String field constrained by a NonEmptyString record remain productive at size zero. Other intersections are validated and may exhaust the discard budget.

  • #7796 53511ef Thanks @kitlangton! - Fix Schema.ArrayEnsure to preserve array-valued element branches and outer-array encoding cardinality.

  • #8067 79ae49f Thanks @purwasadr! - Fix AtomRpc.query returning never for RPCs whose middleware declares service requires. The return-type conditional now infers all six Rpc type parameters, matching mutation and every utility in Rpc.

  • #7463 0d083ba Thanks @tim-smart! - Remove the mime runtime dependency. The new effect/unstable/http/Mime module provides top-level lookup functions
    backed by a vendored standard MIME registry.

  • #7477 be0f822 Thanks @candrewlee14! - Allow sockets to use browser, Bun, and Node WebSocket implementations without consumer casts. Platform constructors
    now support typed opening-handshake headers where available.

  • #7587 debe8fd Thanks @kitlangton! - Fix Cache.invalidateWhen and ScopedCache.invalidateWhen deleting a replacement entry while waiting for an earlier lookup.

  • #7585 a8588f9 Thanks @kitlangton! - Fix interruption of Cache.refresh for a missing key removing a newer value written by Cache.set.

  • #7596 f17eb0a Thanks @kitlangton! - Fix Cache.refresh and ScopedCache.refresh exceeding capacity when an existing key is evicted while its refresh is in progress. Publishing the refreshed entry now evicts older entries as needed, releasing their resources in ScopedCache.

  • #7595 f30cbfe Thanks @kitlangton! - Fix Cache.refresh for an initially missing key deleting a newer cached value when the refresh completes with zero time to live.

  • #7614 78cc9c0 Thanks @kitlangton! - Prevent Cache from retaining synchronously interrupted lookups.

  • #7563 ccbdbd5 Thanks @alvarosevilla95! - Respect custom HTTP header redaction when recording server span attributes.

  • #7254 a63dcbf Thanks @gcanti! - Add the experimental Schema-first effect/unstable/arbitrary/Arbitrary module for native generation without
    fast-check. Arbitrary.schema derives an opaque arbitrary from the decoded Schema Type, Arbitrary.sampleEffect
    provides interruptible sampling with typed exhaustion, and Arbitrary.checkEffect returns structured property results.
    The initial implementation supports bounded discards, shrinking, replay, and recursive and mutually recursive Schemas.
    SampleError and Exhausted include the effective seed so discarded runs remain reproducible even when the caller did
    not provide one. Arbitrary.isArbitrary identifies values through the module's nominal protocol. Numeric constraints
    retain NaN when it is accepted by their supported Order.Number bounds. Union derivation validates oneOf
    exclusivity and isolates lazy cross-member shrinking from unrelated random generation. Object derivation keeps
    optional-property selection constructive when candidate fields have different recursive costs.
    Struct, Record, JSON-object, and record-shaped Arbitrary.all outputs periodically use a null prototype as an edge
    case, preserving that prototype throughout shrinking and replay without perturbing structural PRNG choices. The change
    adds 0.01–0.03 KB gzip to representative Arbitrary fixtures and leaves production-only bundle sentinels unchanged.

    Add Arbitrary.map, Arbitrary.flatMap, Arbitrary.filter, Arbitrary.filterMap, and Arbitrary.all for composing
    derived Arbitraries without exposing a second catalog of primitive constructors. Filtering remains bounded and
    promotes valid shrink descendants through rejected nodes. maxShrinks bounds every inspected shrink candidate,
    including candidates rejected before property evaluation, while retaining the best shrunk input found when the
    budget is exhausted. flatMap provides deterministic dependent generation, source-first shrinking, post-source PRNG
    checkpoints, and one shared residual recursion budget. all combines tuples, iterables, and records with a shared
    budget, randomized internal generation order, stable output shape, and independent member shrinking. Arbitrary values
    implement Pipeable for composition with data-last combinators.

    Add the experimental Schema arbitraryConstraint and toCodecArbitrary annotations and their
    Schema.Annotations.ToArbitrary types. Declarations can provide a Schema Link optimized for generation, while filters
    can contribute native semantic constraints. The callback receives decoded type parameters and normalized constraints.
    The compiler owns efficient representations for common built-ins, including JSON, RegExp, URL, Date, byte arrays,
    ReadonlyMap, and ReadonlySet. Effect-specific HashMap, HashSet, Chunk, Graph, BigDecimal, and date-time declarations keep
    local generation Links, while declarations with productive canonical codecs require no arbitrary-specific annotation.
    Schema.isUniqueKey provides key-based Map uniqueness for explicit array representations.

    The same ownership policy applies to formatter and equivalence derivation: implementations for common declarations
    live in their compiler, while domain-specific and dynamically constructed declarations retain local annotations.
    Declarations whose intrinsic Equal implementation already matches their Schema equivalence need no annotation or
    compiler special case. This keeps unused common callbacks out of production Schema bundles.

    Against the previous layout, schema-toArbitrary decreases from 36.68 KB to 33.24 KB gzip and
    arbitrary-combinators decreases from 37.16 KB to 33.70 KB. schema-toFormatter increases from 18.92 KB to 19.49 KB
    and schema-toEquivalence increases from 19.05 KB to 19.39 KB because callers that explicitly derive these capabilities
    now retain the common declaration handlers. Generic production fixtures remain unchanged; an equivalence-specific
    production fixture using common declarations decreases from 20.75 KB to 20.48 KB, while declarations whose intrinsic
    equality is sufficient decrease from 23.42 KB to 23.34 KB. An Arbitrary-specific production fixture using common
    declarations decreases from 20.35 KB to 19.61 KB, while one using the locally annotated BigDecimal and date-time
    declarations increases from 18.34 KB to 23.01 KB.
    The complete 31-scenario native Arbitrary comparison reports no statistically classified runtime regression; the five
    moved BigDecimal and date-time scenarios remain within measurement noise.

    Add SchemaGetter.forbiddenEncoding, a reusable getter for the encode side of decode-only Schema transformations.

    Remove the fast-check bridge from the effect package, including Schema.toArbitrary and
    effect/testing/FastCheck. Replace the legacy Schema.Annotations.ToArbitrary callback contract with the native
    Schema-first types. The effect package no longer depends on ...

Read more

@effect/vitest@4.0.0-rc.113

Pre-release

Choose a tag to compare

@effect-bot effect-bot released this 10 Sep 00:39
d3b837a

Patch Changes

  • #7254 a63dcbf Thanks @gcanti! - Add the experimental Schema-first effect/unstable/arbitrary/Arbitrary module for native generation without
    fast-check. Arbitrary.schema derives an opaque arbitrary from the decoded Schema Type, Arbitrary.sampleEffect
    provides interruptible sampling with typed exhaustion, and Arbitrary.checkEffect returns structured property results.
    The initial implementation supports bounded discards, shrinking, replay, and recursive and mutually recursive Schemas.
    SampleError and Exhausted include the effective seed so discarded runs remain reproducible even when the caller did
    not provide one. Arbitrary.isArbitrary identifies values through the module's nominal protocol. Numeric constraints
    retain NaN when it is accepted by their supported Order.Number bounds. Union derivation validates oneOf
    exclusivity and isolates lazy cross-member shrinking from unrelated random generation. Object derivation keeps
    optional-property selection constructive when candidate fields have different recursive costs.
    Struct, Record, JSON-object, and record-shaped Arbitrary.all outputs periodically use a null prototype as an edge
    case, preserving that prototype throughout shrinking and replay without perturbing structural PRNG choices. The change
    adds 0.01–0.03 KB gzip to representative Arbitrary fixtures and leaves production-only bundle sentinels unchanged.

    Add Arbitrary.map, Arbitrary.flatMap, Arbitrary.filter, Arbitrary.filterMap, and Arbitrary.all for composing
    derived Arbitraries without exposing a second catalog of primitive constructors. Filtering remains bounded and
    promotes valid shrink descendants through rejected nodes. maxShrinks bounds every inspected shrink candidate,
    including candidates rejected before property evaluation, while retaining the best shrunk input found when the
    budget is exhausted. flatMap provides deterministic dependent generation, source-first shrinking, post-source PRNG
    checkpoints, and one shared residual recursion budget. all combines tuples, iterables, and records with a shared
    budget, randomized internal generation order, stable output shape, and independent member shrinking. Arbitrary values
    implement Pipeable for composition with data-last combinators.

    Add the experimental Schema arbitraryConstraint and toCodecArbitrary annotations and their
    Schema.Annotations.ToArbitrary types. Declarations can provide a Schema Link optimized for generation, while filters
    can contribute native semantic constraints. The callback receives decoded type parameters and normalized constraints.
    The compiler owns efficient representations for common built-ins, including JSON, RegExp, URL, Date, byte arrays,
    ReadonlyMap, and ReadonlySet. Effect-specific HashMap, HashSet, Chunk, Graph, BigDecimal, and date-time declarations keep
    local generation Links, while declarations with productive canonical codecs require no arbitrary-specific annotation.
    Schema.isUniqueKey provides key-based Map uniqueness for explicit array representations.

    The same ownership policy applies to formatter and equivalence derivation: implementations for common declarations
    live in their compiler, while domain-specific and dynamically constructed declarations retain local annotations.
    Declarations whose intrinsic Equal implementation already matches their Schema equivalence need no annotation or
    compiler special case. This keeps unused common callbacks out of production Schema bundles.

    Against the previous layout, schema-toArbitrary decreases from 36.68 KB to 33.24 KB gzip and
    arbitrary-combinators decreases from 37.16 KB to 33.70 KB. schema-toFormatter increases from 18.92 KB to 19.49 KB
    and schema-toEquivalence increases from 19.05 KB to 19.39 KB because callers that explicitly derive these capabilities
    now retain the common declaration handlers. Generic production fixtures remain unchanged; an equivalence-specific
    production fixture using common declarations decreases from 20.75 KB to 20.48 KB, while declarations whose intrinsic
    equality is sufficient decrease from 23.42 KB to 23.34 KB. An Arbitrary-specific production fixture using common
    declarations decreases from 20.35 KB to 19.61 KB, while one using the locally annotated BigDecimal and date-time
    declarations increases from 18.34 KB to 23.01 KB.
    The complete 31-scenario native Arbitrary comparison reports no statistically classified runtime regression; the five
    moved BigDecimal and date-time scenarios remain within measurement noise.

    Add SchemaGetter.forbiddenEncoding, a reusable getter for the encode side of decode-only Schema transformations.

    Remove the fast-check bridge from the effect package, including Schema.toArbitrary and
    effect/testing/FastCheck. Replace the legacy Schema.Annotations.ToArbitrary callback contract with the native
    Schema-first types. The effect package no longer depends on fast-check.

    Migrate TestSchema.Asserts.verifyLosslessTransformation and TestSchema.Asserts.arbitrary().verifyGeneration to the
    native runner. Both methods now accept native check options directly, bound unsuccessful generation, and include the
    shrunk input and replay token in property failures.

    Use the Arbitrary runner for all @effect/vitest property tests. Property inputs may combine Schemas and Arbitraries,
    and are composed directly with Arbitrary.all; check options are available through arbitrary. Raw fast-check
    arbitraries and the fastCheck options object are no longer supported. As with the previous fast-check adapter, thrown
    exceptions, defects, and typed failures from a property are shrinkable falsifications; Effect interruption remains an
    interruption.

    Optimize constructive regular-expression generation by caching feasible lengths on the compiled pattern, computing
    sequence-suffix feasibility once, and precomputing character-class metadata. Seeded generation, shrinking, and replay
    remain unchanged.

    Optimize BigDecimal.Order and BigDecimal.Equivalence with a shared hybrid comparator. Ordinary scale differences
    use cached, bounded coefficient alignment, while large differences are compared without materializing their decimal
    zeroes. BigDecimal.make now rejects scales that are not safe integers.

    Before its removal, the materialized fast-check bridge fixture
    schema-toArbitrary-materialized-fast-check.ts measured 79.00 KB minified and gzipped.

    Representative runtime measurements against corresponding hand-written fast-check 4.9.0 arbitraries are shown below.
    Values are median latency on Node 24.12.0 and Apple M3; lower is better. Both implementations validate the
    same output domains, although their generation distributions are not identical. Native speedup is fast-check latency
    divided by Native latency, so higher is better.

    Scenario fast-check Native Native speedup
    32 recursive samples 150 µs 103 µs 1.45x
    128 optional Struct samples 244 µs 86.0 µs 2.84x
    128 constrained strings 742 µs 49.7 µs 14.86x
    RegExp derivation and first sample 13.4 ms 30.8 µs 429.02x
    64 RegExp strings 595 µs 919 µs 0.64x
    RegExp failure and shrinking 168 µs 88.2 µs 1.91x
    128 bounded numbers 68.9 µs 21.8 µs 3.18x
    128 Uint8Array samples 98.3 µs 74.4 µs 1.32x
    128 BigDecimal samples 66.6 µs 56.3 µs 1.18x
    128 DateTime.Utc samples 71.2 µs 50.5 µs 1.42x
    128 named time zones 52.2 µs 27.9 µs 1.85x
    128 time zones 63.7 µs 33.8 µs 1.89x
    128 zoned date-times 130 µs 112 µs 1.16x
    32 samples through Schema filter 65.9 µs 49.4 µs 1.33x
    32 unique arrays 156 µs 132 µs 1.18x
    128 literal samples 40.0 µs 3.70 µs 10.78x
    128 mapped samples 59.0 µs 14.1 µs 4.21x
    128 samples through passing filter 58.9 µs 13.9 µs 4.23x
    32 samples through selective filter 66.1 µs 42.9 µs 1.54x
    128 filterMap samples 75.7 µs 31.5 µs 2.40x
    Filtered failure and shrinking 12.7 µs 7.71 µs 1.66x
    128 all tuple samples 43.5 µs 18.5 µs 2.35x
    128 all record samples 81.0 µs 30.4 µs 2.66x
    128 dependent flatMap samples 125 µs 67.2 µs 1.86x
    flatMap failure and shrinking 20.1 µs 6.71 µs 2.99x
    Replay flatMap shrink path 14.3 µs 6.57 µs 2.17x
    Passing property, 100 runs 42.3 µs 27.1 µs 1.56x
    TestSchema, 100 generations 44.5 µs 35.9 µs 1.24x
    First failure plus one shrink 8.77 µs 1.30 µs 6.75x
    Replay recorded failure 6.35 µs 1.19 µs 5.36x

    Cold recursive derivation is not included because the native fixture constructs and compiles a Schema, while the
    fast-check fixture constructs a hand-written arbitrary; it is not a like-for-like warm-generator comparison.

    Add a guide for the native module and ...

Read more

@effect/sql-sqlite-wasm@4.0.0-rc.113

Pre-release

Choose a tag to compare

@effect-bot effect-bot released this 10 Sep 00:39
d3b837a

Patch Changes

Read more

@effect/sql-sqlite-react-native@4.0.0-rc.113

Choose a tag to compare

@effect-bot effect-bot released this 10 Sep 00:39
d3b837a
Read more

@effect/sql-sqlite-node@4.0.0-rc.113

Pre-release

Choose a tag to compare

@effect-bot effect-bot released this 10 Sep 00:39
d3b837a

Patch Changes

Read more

@effect/sql-sqlite-do@4.0.0-rc.113

Pre-release

Choose a tag to compare

@effect-bot effect-bot released this 10 Sep 00:39
d3b837a
Read more

@effect/sql-sqlite-bun@4.0.0-rc.113

Pre-release

Choose a tag to compare

@effect-bot effect-bot released this 10 Sep 00:39
d3b837a

Patch Changes

Read more

@effect/sql-pglite@4.0.0-rc.113

Pre-release

Choose a tag to compare

@effect-bot effect-bot released this 10 Sep 00:39
d3b837a

Patch Changes

Read more

@effect/sql-pg@4.0.0-rc.113

Pre-release

Choose a tag to compare

@effect-bot effect-bot released this 10 Sep 00:39
d3b837a

Patch Changes

  • #7426 534b8b9 Thanks @tim-smart! - Replace @effect/sql-pg's pg runtime with a native PostgreSQL client. PgConnection and PgPool now handle connection setup, binary queries, prepared statements, pipelining, streaming, notifications, cancellation, and custom codecs. PgConnection.listen and PgClient.listen return scoped notification dequeues after PostgreSQL confirms the subscription. PgClient uses the native stack, and the legacy fromPool, fromClient, and makeWith constructors are removed.

    Breaking changes

    • fromPool, fromClient, and makeWith are removed. Use make for a pool or makeClient for one connection.
    • PgClient.listen returns a scoped Effect<Dequeue<string>, SqlError, Scope> instead of a Stream. Acquisition completes after PostgreSQL confirms LISTEN, so notifications sent after it returns cannot be missed.
    • PgClientConfig.types now accepts a PgTypes.Registry instead of pg.CustomTypesConfig. Plain object parameters are no longer inferred as JSON; wrap them with sql.json.
    • Query strings must contain one statement. PostgreSQL's extended protocol rejects multi-statement strings.
    • Results use the native binary codecs. In particular, int8 decodes to bigint, date to a string, timestamps to Unix epoch milliseconds, and bytea or unknown OIDs to Uint8Array. executeRaw returns the native PgConnection.Result shape rather than pg.Result.
    • Named prepared statements are enabled by default. Set prepare: false when using a pooler that cannot preserve prepared statements between queries. Statement.unprepared and Statement.valuesUnprepared use unnamed extended queries without adding entries to the prepared-statement cache.

    Inferred parameters stay permissive: strings bind untyped so the backend derives the type from the statement, and safe integers beyond the int4 range bind as int8.

    Add Pool.reserve for exclusive access to a concurrent pool item, and fix waiter wakeups and capacity replacement after invalidation.

  • #7509 c405edc Thanks @tim-smart! - Set the default multiplexConcurrency to 32 when PostgreSQL connection multiplexing is enabled. Set a lower value explicitly to limit how many statements share each connection.

  • #7503 96ea948 Thanks @tim-smart! - Allow each PostgreSQL pool connection to complete its first checkout before applying connectionTTL, so a zero TTL
    disables connection reuse without entering an invalidate/reconnect loop.

  • #7502 e203638 Thanks @tim-smart! - Add a maxMessageSize connection option so PostgreSQL clients can receive backend messages larger than the 16 MiB default.

  • #7524 0a08ae0 Thanks @fubhy! - Add NetAddress under effect/unstable/net for MAC, IP, internet socket, and Unix socket addresses, with checked parsing, schemas, equality, canonical string serialization, and URL formatting. Companion modules IpInterface and IpNetwork represent IP interfaces and CIDR networks.

    HTTP and socket servers now expose NetAddress.SocketAddress. Replace TCP hostname access with NetAddress.formatIp(address.address) and use UnixPathAddress.path for Unix sockets. URL helpers bracket IPv6 addresses and reject scoped IPv6. Bun and Deno HTTP server layers can now fail with ServeError when listener address conversion fails.

    PostgreSQL inet values now use IpInterface; cidr values use IpNetwork and reject addresses with host bits set.

  • #7734 fe3830a Thanks @kitlangton! - Honor explicit ssl options when PostgreSQL URLs use sslmode=prefer or sslmode=allow.

  • #7504 9adb9f2 Thanks @tim-smart! - Reject PostgreSQL LISTEN and NOTIFY channel names longer than 63 UTF-8 bytes.

  • Updated dependencies [49e3901, b945ded, d6422f4, 5a80204, 53511ef, 79ae49f, 0d083ba, be0f822, debe8fd, a8588f9, f17eb0a, f30cbfe, 78cc9c0, ccbdbd5, a63dcbf, b845b18, 381b794, 4ffcaf4, ba2fd82, 02be94c, 115d8c2, 1452635, 77f85fe, a3f2b31, 310f8d3, 291d616, 48dbbb2, b43bfd6, 1c89c78, 9bbe1a5, dd99ab0, 8f397ed, d7ae6b6, 8cf1203, 87654c5, f05ae0b, 436f5eb, d8ff960, 8766475, b64f406, 4697aaa, cec6c2d, 9956f0e, 5c7eed0, 183c2ea, 1e92dbd, 4eb0fa7, 534b8b9, b76a1cf, acc1e53, 4950a91, c020987, abe95d1, [027ceb9](https://github.com/Effect-TS/effect/commit/027ceb91e003fbc36f0559f72e1c614cd9198c1a...

Read more

@effect/sql-mysql2@4.0.0-rc.113

Pre-release

Choose a tag to compare

@effect-bot effect-bot released this 10 Sep 00:39
d3b837a
Read more