effect
4.1.4 · 11 Nov 2026MIT66.6M / weekRepositoryHomepagenpmAtom feed
2.4.19 is the newest release of 2.x.
In short
11 new1 fixed
Security
2 advisories affect 2.4.0; 3.22.1 fixes them
- HighEffect: ReDoS in Schema.TemplateLiteral compiled regexGHSA-7589-6fvf-x4pw · 19 Nov 2026Fixed in 3.22.1
- HighEffect `AsyncLocalStorage` context lost/contaminated inside Effect fibers under concurrent load with RPCGHSA-38f7-945m-qr2g · 20 Mar 2026Fixed in 3.20.0
Release note
Minor Changes
Remove ReadonlyRecord.fromIterable (duplicate of fromEntries)
Swap
Scheduletype parameters fromSchedule<out Env, in In, out Out>toSchedule<out Out, in In = unknown, out R = never>, closes #2154swap
ScheduleDrivertype parameters fromScheduleDriver<out Env, in In, out Out>toScheduleDriver<out Out, in In = unknown, out R = never>
Consolidate
Effect.asyncOption,Effect.asyncEither,Stream.asyncOption,Stream.asyncEither, andStream.asyncInterruptThis PR removes
Effect.asyncOptionandEffect.asyncEitheras their behavior can be entirely implemented with the new signature ofEffect.async, which optionally returns a cleanupEffectfrom the registration callback.declare const async: <A, E = never, R = never>( register: ( callback: (_: Effect<A, E, R>) => void, signal: AbortSignal, ) => void | Effect<void, never, R>, blockingOn?: FiberId, ) => Effect<A, E, R>;Additionally, this PR removes
Stream.asyncOption,Stream.asyncEither, andStream.asyncInterruptas their behavior can be entirely implemented with the new signature ofStream.async, which can optionally return a cleanupEffectfrom the registration callback.declare const async: <A, E = never, R = never>( register: (emit: Emit<R, E, A, void>) => Effect<void, never, R> | void, outputBuffer?: number, ) => Stream<A, E, R>;
Swap
GroupBytype parameters fromGroupBy<out R, out E, out K, out V>toGroupBy<out K, out V, out E = never, out R = never>Remove Effect.unified and Effect.unifiedFn in favour of Unify.unify.
The
Unifymodule fully replaces the need for specific unify functions, when before you did:import { Effect } from "effect"; const effect = Effect.unified( Math.random() > 0.5 ? Effect.succeed("OK") : Effect.fail("NO"), ); const effectFn = Effect.unifiedFn((n: number) => Math.random() > 0.5 ? Effect.succeed("OK") : Effect.fail("NO"), );You can now do:
import { Effect, Unify } from "effect"; const effect = Unify.unify( Math.random() > 0.5 ? Effect.succeed("OK") : Effect.fail("NO"), ); const effectFn = Unify.unify((n: number) => Math.random() > 0.5 ? Effect.succeed("OK") : Effect.fail("NO"), );Add key type to ReadonlyRecord
Add support for optional property keys to
pick,omitandgetBefore:
import { pipe } from "effect/Function"; import * as S from "effect/Struct"; const struct: { a?: string; b: number; c: boolean; } = { b: 1, c: true }; // error const x = pipe(struct, S.pick("a", "b")); const record: Record<string, number> = {}; const y = pipe(record, S.pick("a", "b")); console.log(y); // => { a: undefined, b: undefined } // error console.log(pipe(struct, S.get("a")));Now
import { pipe } from "effect/Function"; import * as S from "effect/Struct"; const struct: { a?: string; b: number; c: boolean; } = { b: 1, c: true }; const x = pipe(struct, S.pick("a", "b")); console.log(x); // => { b: 1 } const record: Record<string, number> = {}; const y = pipe(record, S.pick("a", "b")); console.log(y); // => {} console.log(pipe(struct, S.get("a"))); // => undefinedSwap type params of Either from
Either<E, A>toEither<R, L = never>.Along the same line of the other changes this allows to shorten the most common types such as:
import { Either } from "effect"; const right: Either.Either<string> = Either.right("ok");
Patch Changes
Added Number.parse, BigInt.toNumber, ParseResult.fromOption
ReadonlyArray.groupBy: Allow for grouping by symbols, closes #2180
Either: Fix
fromOptionoverloads orderAdd Do notation methods
Do,bindTo,bindandletto Either
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.