effect
4.1.4 · 11 Nov 2026MIT67.1M / weekRepositoryHomepagenpmAtom feed
3.22.5 is the newest release of 3.x.
In short
10 new1 fixed
Security
2 advisories affect 3.14.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 DateTime.nowAsDate creator
Expose the Layer.MemoMap via Layer.CurrentMemoMap to the layers being built
Add Tracer Span.addLinks, for dynamically linking spans
Add HashMap.every
Add Either.transposeOption
Make TestClock.setTime accept a DateTime.Input
Add Effect.transposeMapOption
Add
Array.windowfunctionAdd LayerMap module
A
LayerMapallows you to create a map of Layer's that can be used to
dynamically access resources based on a key.Here is an example of how you can use a
LayerMapto create a service that
provides access to multiple OpenAI completions services.import { Completions } from "@effect/ai" import { OpenAiClient, OpenAiCompletions } from "@effect/ai-openai" import { FetchHttpClient } from "@effect/platform" import { NodeRuntime } from "@effect/platform-node" import { Config, Effect, Layer, LayerMap } from "effect" // create the openai client layer const OpenAiLayer = OpenAiClient.layerConfig({ apiKey: Config.redacted("OPENAI_API_KEY") }).pipe(Layer.provide(FetchHttpClient.layer)) // create a service that wraps a LayerMap class AiClients extends LayerMap.Service<AiClients>()("AiClients", { // this LayerMap will provide the ai Completions service provides: Completions.Completions, // define the lookup function for the layer map // // The returned Layer will be used to provide the Completions service for the // given model. lookup: (model: OpenAiCompletions.Model) => OpenAiCompletions.layer({ model }), // If a layer is not used for a certain amount of time, it can be removed idleTimeToLive: "5 seconds", // Supply the dependencies for the layers in the LayerMap dependencies: [OpenAiLayer] }) {} // usage Effect.gen(function* () { // access and use the generic Completions service const ai = yield* Completions.Completions const response = yield* ai.create("Hello, world!") console.log(response.text) }).pipe( // use the AiClients service to provide a variant of the Completions service AiClients.provide("gpt-4o"), // provide the LayerMap service Effect.provide(AiClients.Default), NodeRuntime.runMain )Make Runtime.run* apis dual
Patch Changes
Preserve interruptors in channel executor .runIn
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.