effect
4.1.4 · 11 Nov 2026MIT67.1M / weekRepositoryHomepagenpmAtom feed
3.22.5 is the newest release of 3.x.
In short
1 new5 fixed
Security
2 advisories affect 3.11.7; 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
Arbitrary: Fix bug where refinements in declarations raised an incorrect missing annotation error, closes #4136
JSONSchema: Ignore never members in unions.
Before
import { JSONSchema, Schema } from "effect" const schema = Schema.Union(Schema.String, Schema.Never) console.log(JSON.stringify(JSONSchema.make(schema), null, 2)) /* { "$schema": "http://json-schema.org/draft-07/schema#", "anyOf": [ { "type": "string" }, { "$id": "/schemas/never", "not": {}, "title": "never" } ] } */After
import { JSONSchema, Schema } from "effect" const schema = Schema.Union(Schema.String, Schema.Never) console.log(JSON.stringify(JSONSchema.make(schema), null, 2)) /* { "$schema": "http://json-schema.org/draft-07/schema#", "type": "string" } */JSONSchema: Handle the
nullablekeyword for OpenAPI target, closes #4075.Before
import { OpenApiJsonSchema } from "@effect/platform" import { Schema } from "effect" const schema = Schema.NullOr(Schema.String) console.log(JSON.stringify(OpenApiJsonSchema.make(schema), null, 2)) /* { "anyOf": [ { "type": "string" }, { "enum": [ null ] } ] } */After
import { OpenApiJsonSchema } from "@effect/platform" import { Schema } from "effect" const schema = Schema.NullOr(Schema.String) console.log(JSON.stringify(OpenApiJsonSchema.make(schema), null, 2)) /* { "type": "string", "nullable": true } */JSONSchema: Add
typefor homogeneous enum schemas, closes #4127Before
import { JSONSchema, Schema } from "effect" const schema = Schema.Literal("a", "b") console.log(JSON.stringify(JSONSchema.make(schema), null, 2)) /* { "$schema": "http://json-schema.org/draft-07/schema#", "enum": [ "a", "b" ] } */After
import { JSONSchema, Schema } from "effect" const schema = Schema.Literal("a", "b") console.log(JSON.stringify(JSONSchema.make(schema), null, 2)) /* { "$schema": "http://json-schema.org/draft-07/schema#", "type": "string", "enum": [ "a", "b" ] } */JSONSchema: Use
{ "type": "null" }to represent thenullliteralBefore
import { JSONSchema, Schema } from "effect" const schema = Schema.NullOr(Schema.String) console.log(JSON.stringify(JSONSchema.make(schema), null, 2)) /* { "$schema": "http://json-schema.org/draft-07/schema#", "anyOf": [ { "type": "string" }, { "enum": [ null ] } ] } */After
import { JSONSchema, Schema } from "effect" const schema = Schema.NullOr(Schema.String) console.log(JSON.stringify(JSONSchema.make(schema), null, 2)) /* { "$schema": "http://json-schema.org/draft-07/schema#", "anyOf": [ { "type": "string" }, { "type": "null" } ] } */JSONSchema: Handle empty native enums.
Before
import { JSONSchema, Schema } from "effect" enum Empty {} const schema = Schema.Enums(Empty) console.log(JSON.stringify(JSONSchema.make(schema), null, 2)) /* { "$schema": "http://json-schema.org/draft-07/schema#", "$comment": "/schemas/enums", "anyOf": [] // <= invalid schema! } */After
import { JSONSchema, Schema } from "effect" enum Empty {} const schema = Schema.Enums(Empty) console.log(JSON.stringify(JSONSchema.make(schema), null, 2)) /* { "$schema": "http://json-schema.org/draft-07/schema#", "$id": "/schemas/never", "not": {} } */
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.