effect
4.1.4 · 11 Nov 2026MIT67.1M / weekRepositoryHomepagenpmAtom feed
3.22.5 is the newest release of 3.x.
In short
1 new4 fixed5 changed
Security
2 advisories affect 3.11.10; 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
Fix Stream.scoped example
Schema: Fix
withDecodingDefaultimplementation to align with its signature (now removesundefinedfrom the AST).Additionally, a new constraint has been added to the signature to prevent calling
withDecodingDefaultafterwithConstructorDefault, which previously led to the following issue:import { Schema } from "effect" const schema = Schema.Struct({ a: Schema.optional(Schema.String).pipe( Schema.withConstructorDefault(() => undefined), // this is invalidated by the following call to `withDecodingDefault` Schema.withDecodingDefault(() => "") ) })Schema: Refactor annotations:
Export internal
Uint8schemaExport internal
NonNegativeIntschemaRemove title annotations that are identical to identifiers
Avoid setting a title annotation when applying branding
Add more title annotations to refinements
Improve
toStringoutput and provide more precise error messages for refinements:Before
import { Schema } from "effect" const schema = Schema.Number.pipe( Schema.int({ identifier: "MyInt" }), Schema.positive() ) console.log(String(schema)) // Output: a positive number Schema.decodeUnknownSync(schema)(1.1) /* throws: ParseError: a positive number └─ From side refinement failure └─ MyInt └─ Predicate refinement failure └─ Expected MyInt, actual 1.1 */After
toStringnow combines all refinements with" & "instead of showing only the last one.The last message (
"Expected ...") now uses the extended description to make the error message clearer.
import { Schema } from "effect" const schema = Schema.Number.pipe( Schema.int({ identifier: "MyInt" }), Schema.positive() ) console.log(String(schema)) // Output: MyInt & positive // <= all the refinements Schema.decodeUnknownSync(schema)(1.1) /* throws: ParseError: MyInt & positive └─ From side refinement failure └─ MyInt └─ Predicate refinement failure └─ Expected an integer, actual 1.1 // <= extended description */
Replace absolute imports with relative ones
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.