effect
4.1.4 · 11 Nov 2026MIT67.1M / weekRepositoryHomepagenpmAtom feed
3.22.5 is the newest release of 3.x.
In short
1 new1 fixed
Security
2 advisories affect 3.13.12; 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
Patch Changes
Preserve specific annotations (e.g.,
arbitrary) when usingSchema.typeSchema, closes #4609.Previously, annotations such as
arbitrarywere lost when callingSchema.typeSchemaon a transformation. This update ensures that certain annotations, which depend only on the "to" side of the transformation, are preserved.Annotations that are now retained:
examplesdefaultjsonSchemaarbitraryprettyequivalence
Example
Before
import { Arbitrary, FastCheck, Schema } from "effect" const schema = Schema.NumberFromString.annotations({ arbitrary: () => (fc) => fc.constant(1) }) const to = Schema.typeSchema(schema) // ❌ Annotation is lost console.log(FastCheck.sample(Arbitrary.make(to), 5)) /* [ 2.5223372357846707e-44, -2.145443957806771e+25, -3.4028179901346956e+38, 5.278086259208735e+29, 1.8216880036222622e-44 ] */After
import { Arbitrary, FastCheck, Schema } from "effect" const schema = Schema.NumberFromString.annotations({ arbitrary: () => (fc) => fc.constant(1) }) const to = Schema.typeSchema(schema) // ✅ Annotation is now preserved console.log(FastCheck.sample(Arbitrary.make(to), 5)) /* [ 1, 1, 1, 1, 1 ] */Add support for
jsonSchemaannotations onSymbolFromSelfindex signatures.Before
import { JSONSchema, Schema } from "effect" const schema = Schema.Record({ key: Schema.SymbolFromSelf.annotations({ jsonSchema: { type: "string" } }), value: Schema.Number }) JSONSchema.make(schema) /* throws: Error: Unsupported index signature parameter schema (SymbolKeyword): symbol */After
import { JSONSchema, Schema } from "effect" const schema = Schema.Record({ key: Schema.SymbolFromSelf.annotations({ jsonSchema: { type: "string" } }), value: Schema.Number }) console.log(JSON.stringify(JSONSchema.make(schema), null, 2)) /* Output: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "required": [], "properties": {}, "additionalProperties": { "type": "number" }, "propertyNames": { "type": "string" } } */
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.