effect
4.1.4 · 11 Nov 2026MIT67.1M / weekRepositoryHomepagenpmAtom feed
3.22.5 is the newest release of 3.x.
In short
15 new3 fixed
Security
2 advisories affect 3.11.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
Ensure scopes are preserved by stream / sink / channel operations
NOTE: This change does modify the public signature of several
Stream/Sink/Channelmethods. Namely, certain run methods that previously removed aScopefrom the environment will no longer do so. This was a bug with the previous implementation of how scopes were propagated, and is why this change is being made in a minor release.Add Context.Reference - a Tag with a default value
Add
Effect.scopedWithto run an effect that depends on aScope, and then closes theScopeafter the effect has completedimport { Effect, Scope } from "effect" const program: Effect.Effect<void> = Effect.scopedWith((scope) => Effect.acquireRelease(Effect.log("Acquiring..."), () => Effect.log("Releasing...") ).pipe(Scope.extend(scope)) ) Effect.runPromise(program) // Output: // timestamp=2024-11-26T16:44:54.158Z level=INFO fiber=#0 message=Acquiring... // timestamp=2024-11-26T16:44:54.165Z level=INFO fiber=#0 message=Releasing...Remove Env, EnvRef & FiberFlags from Micro
Config.urlconstructor has been added, which parses a string usingnew URL()Use fiber based runtime for Micro module
Improved performance
Improved interruption model
Consistency with the Effect data type
New methods
extractAllandextractSchematoUrlParams(addedSchema.BooleanFromString).Integrated
DateTimewithCronto add timezone support for cron expressions.URLandURLFromSelfschemas have been addedAdded
BigDecimal.toExponentialfor scientific notation formatting ofBigDecimalvalues.The implementation of
BigDecimal.formatnow uses scientific notation for values with
at least 16 decimal places or trailing zeroes. Previously, extremely large or small values
could causeOutOfMemoryerrors when formatting.JSONSchema module
add
format?: stringoptional field toJsonSchema7StringinterfaceSchema module
add custom json schema annotation to
UUIDschema includingformat: "uuid"
OpenApiJsonSchema module
add
format?: stringoptional field toStringandNumericinterfaces
Implement Effect.fn to define traced functions.
import { Effect } from "effect" const logExample = Effect.fn("example")(function* <N extends number>(n: N) { yield* Effect.annotateCurrentSpan("n", n) yield* Effect.logInfo(`got: ${n}`) yield* Effect.fail(new Error()) }, Effect.delay("1 second")) Effect.runFork(logExample(100).pipe(Effect.catchAllCause(Effect.logError)))Config.redactedhas been made more flexible and can now wrap any other config. This allows to transform or validate config values before it’s hidden.import { Config } from "effect" Effect.gen(function* () { // can be any string including empty const pass1 = yield* Config.redacted("PASSWORD") // ^? Redacted<string> // can't be empty string const pass2 = yield* Config.redacted(Config.nonEmptyString("PASSWORD")) // ^? Redacted<string> const pass2 = yield* Config.redacted(Config.number("SECRET_NUMBER")) // ^? Redacted<number> })Added
BigDecimal.unsafeFromNumberandBigDecimal.safeFromNumber.Deprecated
BigDecimal.fromNumberin favour ofBigDecimal.unsafeFromNumber.The current implementation of
BigDecimal.fromNumberandBigDecimal.unsafeFromNumbernow throws
aRangeErrorfor numbers that are not finite such asNaN,+Infinityor-Infinity.
Patch Changes
Fix multipart support for bun http server
Inherit child fibers created by merged streams
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.