effect
4.1.4 · 11 Nov 2026MIT66.6M / weekRepositoryHomepagenpmAtom feed
3.22.5 is the newest release of 3.x.
In short
7 new
Security
2 advisories affect 3.1.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
Add SortedMap.lastOption & partition apis
Add
Types.DeepMutable, an alternative toTypes.Mutablethat makes all properties recursively mutableAdd Effect.annotateLogsScoped
This api allows you to annotate logs until the Scope has been closed.
import { Effect } from "effect"; Effect.gen(function* () { yield* Effect.log("no annotations"); yield* Effect.annotateLogsScoped({ foo: "bar" }); yield* Effect.log("annotated with foo=bar"); }).pipe(Effect.scoped, Effect.andThen(Effect.log("no annotations again")));Added Stream.fromEventListener, and BrowserStream.{fromEventListenerWindow, fromEventListenerDocument} for constructing a stream from addEventListener
Add
kindproperty toTracer.SpanThis can be used to specify what kind of service created the span.
Add Effect.timeoutOption
Returns an effect that will return
Noneif the effect times out, otherwise it
will returnSomeof the produced value.import { Effect } from "effect"; // will return `None` after 500 millis Effect.succeed("hello").pipe( Effect.delay(1000), Effect.timeoutOption("500 millis"), );Add $is & $match helpers to Data.TaggedEnum constructors
import { Data } from "effect"; type HttpError = Data.TaggedEnum<{ NotFound: {}; InternalServerError: { reason: string }; }>; const { $is, $match, InternalServerError, NotFound } = Data.taggedEnum<HttpError>(); // create a matcher const matcher = $match({ NotFound: () => 0, InternalServerError: () => 1, }); // true $is("NotFound")(NotFound()); // false $is("NotFound")(InternalServerError({ reason: "fail" }));
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.