Skip to content

Effect

4.0.0-beta.81

Patch Changes

  • #2387 93cb4f8 Thanks @gcanti! - Config.withDefault now only recovers from missing data for literal/union schemas. Invalid present values now propagate validation errors instead of using the default, closes #2384.

  • #2388 60341d9 Thanks @gcanti! - Config.withDefault no longer recovers from schema filter failures. A filter failure means a present value reached refinement checks, so using the default could hide invalid configuration values.

  • #2389 1105ab5 Thanks @gcanti! - Fix Schema.toTaggedUnion(...).isAnyOf narrowing for custom discriminant keys, closes #2386.

    Previously, the type predicate always extracted union members by _tag, even when toTaggedUnion was created with a different discriminant key. Runtime behavior already used the supplied key, so this aligns the type-level narrowing with the existing runtime behavior.

  • #2270 4500fbf Thanks @IMax153! - Add HTTP API streaming response support

4.0.0-beta.80

Patch Changes

  • #2205 d944330 Thanks @lloydrichards! - add support for merging external events into Prompt.custom render loops via an optional events dequeue and receive handler.

    The prompt races user input against events from the dequeue, allowing background events to trigger re-renders without waiting for a keypress:

    const eventQueue = yield * Queue.make<number>();
    const prompt = Prompt.custom(
    { count: 0 },
    Queue.asDequeue(eventQueue), // <-- provide the event queue as a dequeue to the prompt
    {
    render: (state) => Effect.succeed(`Count: ${state.count}`),
    process: (input, state) =>
    Effect.succeed(
    Match.value(input).pipe(
    // handle user input
    Match.tag("Input", () => Action.Submit({ value: state.count })),
    // handle external events from the queue
    Match.tag("Event", (input) =>
    Action.NextFrame({ state: { count: state.count + input.value } }),
    ),
    Match.exhaustive,
    ),
    ),
    clear: () => Effect.succeed(""),
    },
    );
  • #2369 f48659f Thanks @gcanti! - Round fractional durations symmetrically when normalizing to nanoseconds.

  • #2373 7652aaa Thanks @StarpTech! - Stream.fromReadableStream: swallow the reader.cancel() rejection in the finalizer. Cancelling the reader of an already-errored ReadableStream rejects with the stored error, which turned the typed onError failure into a defect.

  • #2371 98630b7 Thanks @gcanti! - Emit Schema.ObjectKeyword as an object-or-array JSON Schema union.

  • #2376 90ae23c Thanks @fubhy! - Add Graph.successors and Graph.predecessors, deprecate Graph.neighborsDirected, and fix graph algorithm edge cases around reversal, undirected edge queries, shortest-path weight validation, topological sort initials, and strongly connected components.

4.0.0-beta.79

Patch Changes

  • #2364 b9704dc Thanks @mikearnaldi! - Fix module-level side effects that defeated bundler tree-shaking.

    Bare top-level statements cannot be #__PURE__-annotated by the build, so bundlers must retain them and everything they reference, even in bundles that never use the code:

    • Option: the standalone Object.defineProperty(SomeProto, "valueOrUndefined", ...) statement anchored the whole Option proto chain into every bundle. It is now folded into the SomeProto initializer.
    • Headers: same pattern with Object.defineProperties(Proto, ...), folded into the initializer.
    • Logger: module-level process.stdout.isTTY property reads (potential getters, never droppable) moved inside consolePretty.
    • Utils: when internalCall was unused, its dropped binding left behind a retained initializer tail (standard/forced probe with computed property reads). The selection is now wrapped in a single pure-annotated call.

    A minimal Effect.succeed(123).pipe(Effect.runFork) bundle shrinks by ~1.3% gzipped; bundles that don’t use Option or Headers no longer pay for them.

  • #2339 a207113 Thanks @tim-smart! - Fix EntityManager defect restarts so in-flight requests are replayed instead of being dropped when the old entity scope is interrupted.

  • #2362 5e9b9e2 Thanks @fubhy! - Fix Graph traversal and shortest-path algorithms to traverse undirected edges independently of their stored source/target orientation.

  • #2366 7c128ae Thanks @IMax153! - Fix string seed encoding in Random.withSeed so short, trailing, and astral UTF-8 bytes affect deterministic streams.

  • #2352 0ada457 Thanks @alvarosevilla95! - Fix the Redis RateLimiterStore token-bucket failing with opaque errors under memory pressure: it now writes its keys with a TTL and guards against a missing refill timestamp.

  • #2359 d7cc5a2 Thanks @gcanti! - Fix Struct key renaming and Schema.encodeKeys to support symbol keys, and reject duplicate encoded keys.

  • #2365 aad63be Thanks @gcanti! - Fix Schema encoding so container-level checks are validated against the decoded value instead of the encoded output.

    Disallow adding checks directly to Schema.suspend(...); add the checks to the suspended schema instead.

    Fix StructWithRest so index signatures do not re-parse or overwrite fixed properties.

  • #2342 09809f6 Thanks @gcanti! - Use generic ordered constraints for schema arbitrary derivation.

    Range checks such as isGreaterThan, isLessThan, and isBetween now populate ctx.constraints.ordered instead of type-specific range fields on number, date, or bigint constraints. Custom toArbitrary annotations that read range constraints should migrate to ctx.constraints.ordered.

    This also fixes BigDecimal arbitrary generation by adapting decimal bounds to the generated scale, avoiding invalid fast-check bigint ranges for narrow decimal intervals.

  • #2368 2fddda5 Thanks @IMax153! - Encode HTTP API client path parameters when building request URLs.

  • #2348 5f21768 Thanks @gcanti! - Update Schema arbitrary derivation to use the new filter metadata, candidate generation, optional derivation reports, recursion-aware generation, and the renamed OrderedConstraint<T> model.

    Migration from the previous v4 API:

    • Replace filter annotations from toArbitraryConstraint: constraint to arbitrary: { constraint }. When a filter cannot be described as a constraint, use arbitrary: { candidate } to add a weighted source that is still checked by the filter.
    • Replace bucketed constraints with the flat Schema.Annotations.ToArbitrary.Constraint shape:
      • string.minLength, array.minLength, object property counts, collection sizes -> minLength
      • string.maxLength, array.maxLength, object property counts, collection sizes -> maxLength
      • string.patterns -> patterns
      • number.isInteger -> integer
      • number.noNaN -> noNaN
      • number.noDefaultInfinity -> noInfinity
      • date.noInvalidDate -> valid
      • array.comparator for uniqueness -> unique using Effect equality
      • ordered.min / minExcluded / max / maxExcluded -> ordered.minimum / exclusiveMinimum / maximum / exclusiveMaximum
    • In arbitrary hooks, read context.constraint instead of context.constraints. Replace context.isSuspend with context.recursion; when combining finite and recursive branches, pass context.recursion to fc.oneof with the finite branch first.
    • Generic declaration hooks now receive type parameters as { arbitrary, terminal }. Atomic declarations may still return a bare FastCheck.Arbitrary<T>, but generic declarations should return { arbitrary, terminal } when they can preserve a finite terminal branch.
    • Schema.toArbitrary(schema, { report: true }) now returns { value, report }; without { report: true }, it keeps returning the arbitrary directly. Schema.toArbitraryLazy always returns a lazy arbitrary.
  • #2343 f27003e Thanks @MohanedMashaly! - Add meta-var that shows log level and bash options in command line.

4.0.0-beta.78

Patch Changes

  • #2333 7836b8e Thanks @tim-smart! - Fix Schema.Defect JSON encoding for Error values whose message property is not a string.

  • #2329 35d49a3 Thanks @alvarosevilla95! - Retry Redis scripts after NOSCRIPT and declare the token bucket refill key

  • #2334 4093258 Thanks @tim-smart! - clean up otlp config

4.0.0-beta.77

Patch Changes

  • #2326 6e9a5ca Thanks @fubhy! - Prefer OTEL resource environment variables over explicit OtlpResource.fromConfig options.

  • #2325 302f398 Thanks @fubhy! - Add OTEL environment variable configuration for unstable OTLP observability.

4.0.0-beta.76

Patch Changes

  • #2320 016108a Thanks @gcanti! - Add Schema.isGUID and update Schema.isUUID to accept the RFC 9562 max UUID.

  • #2319 95c03d2 Thanks @fubhy! - Add support for configuring Scalar API reference pages with a custom fetch implementation.

  • #2318 07299a3 Thanks @gcanti! - Replace the Schema.Error and Schema.Defect schema constants with constructor functions, Schema.Error() and Schema.Defect().

    Unify Schema.ErrorWithStack into Schema.Error({ includeStack: true }) and Schema.DefectWithStack into Schema.Defect({ includeStack: true }).

    Error causes are encoded by default using the same JSON defect encoding semantics used by Schema.Defect; pass { excludeCause: true } to omit nested cause data.

    Equivalent Schema.Error and Schema.Defect options are canonicalized, so repeated constructor calls with the same option values reuse the same schema.

    Schema.Defect() now models defects as unknown values with a JSON encoded form. Error-shaped JSON objects with a string message decode to JavaScript Error values, so non-Error objects such as { message: "boom" } do not round-trip unchanged. Other non-Error values are normalized through JSON serialization, with non-JSON values falling back to Effect’s formatted string representation.

4.0.0-beta.75

Patch Changes

  • #2294 81b187c Thanks @mattiamanzati! - Align workflow tags with RPCs by changing Workflow.make to accept the tag as its first argument, exposing workflow tags as _tag, and supporting class MyWorkflow extends Workflow.make(...) {}.

  • #2312 ad4b535 Thanks @gcanti! - Validate Schema.StructWithRest fixed fields against rest index signatures at the type level so schemas cannot be constructed with incompatible decoded, encoded, or make shapes. This keeps StructWithRest types sound and updates the generated OpenAI conversation-items request schema to keep accepting arbitrary additional fields under the stricter validation.

  • #2314 a29c2e7 Thanks @gcanti! - Preserve Schema.Redacted options when roundtripping through schema representations. This keeps label validation and disallowJsonEncode behavior intact when schemas are revived from a representation or emitted through code generation.

  • #2298 1fdd9ae Thanks @gcanti! - Remove the Types.MergeRecord alias. Use Types.MergeLeft instead.

  • #2298 1fdd9ae Thanks @gcanti! - Align Schema adapter failures: Schema result, promise, and sync adapters now surface SchemaError, while SchemaParser result, promise, and sync adapters expose SchemaIssue.Issue. Mark SchemaParser option adapters as internal because their error details are discarded.

  • #2313 ffea4ec Thanks @MohanedMashaly! - Add -v alias for version flag

  • #2306 4255c9b Thanks @sam-goodwin! - Fix HttpApiSecurity bearer/http credential decoding

4.0.0-beta.74

Patch Changes

  • #2295 b1fc6a4 Thanks @jgoux! - Fix CLI parsing so command-local flags can override globals without breaking global flags before subcommands.

4.0.0-beta.73

Patch Changes

  • #2291 361ca30 Thanks @tim-smart! - Add HttpApiSecurity.http for passing custom schemes

  • #2289 b9598c6 Thanks @tim-smart! - make EntityResource lazy by default

4.0.0-beta.72

Patch Changes

  • #2287 73e67d1 Thanks @tim-smart! - Ensure ClusterWorkflowEngine routes durable clock wakeups and registered workflow deferred completions through the owning workflow’s shard group.

  • #2286 01d71ec Thanks @tim-smart! - Add default value support to Prompt.file.

  • #2285 fcd707e Thanks @tim-smart! - Add default value support to CLI integer prompts.