Effect 3.10 has been released! This release includes a number of new features and improvements. Here’s a summary of what’s new:
@effect/schema moved to effect/Schema
We are pleased to announce that @effect/schema has reached a level of maturity that allows us to merge it into the effect package.
This means that you no longer need to install @effect/schema separately, and it is now available as effect/Schema.
Here is where the various schema modules can now be found:
Modules
Before
import { Arbitrary, AST, FastCheck, JSONSchema, ParseResult, Pretty, Schema } from "@effect/schema"After
import { Arbitrary, SchemaAST, // changed FastCheck, JSONSchema, ParseResult, Pretty, Schema,} from "effect"Formatters
ArrayFormatter / TreeFormatter has been merged into the ParseResult module.
Before
import { ArrayFormatter, TreeFormatter } from "@effect/schema"After
import { ArrayFormatter, TreeFormatter } from "effect/ParseResult"Serializable
Merged into the Schema module.
Equivalence
Merged into the Schema module.
Before
import { Equivalence } from "@effect/schema"
Equivalence.make(myschema)After
import { Schema } from "effect"
Schema.equivalence(myschema)HttpApi improvements
The HttpApi modules have undergone a number of improvements:
HttpApi,HttpApiGroup&HttpApiEndpointnow use a chainable api instead of a pipeable api.HttpApiMiddlewaremodule has been added, with an updated way of defining security middleware.- You can now add multiple success schemas
- A url search parameter schema has been added
- Error schemas now support
HttpApiSchemaencoding apis toWebHandlerhas been simplified
For more information, see the README.
TSubscriptionRef
The TSubscriptionRef module has been added. A TSubscriptionRef is from the STM family of modules,
which allows you to create a subcribe-able Ref that also can be composed with the other STM modules, to
create complex atomic operations.
Stream.fromTQueue & Stream.fromTPubSub
These new apis allow you to create a stream from a TQueue or TPubSub.
import { Effect, Stream, TQueue } from "effect"
Effect.gen(function* () { const queue = yield* TQueue.unbounded<number>()
const stream: Stream.Stream<number> = Stream.fromTQueue(queue)})Redactable trait
The Redactable trait has been added to the Inspectable module. It is integrated with the Effect loggers,
to allow you to create data types that can have sensitive data redacted when logged.
import { Headers } from "@effect/platform"import { NodeRuntime } from "@effect/platform-node"import { Effect } from "effect"
/*
Output:[09:18:35.182] INFO (#0): { authorization: <redacted> }
*/Effect.gen(function* () { yield* Effect.log( Headers.fromInput({ authorization: "Some secret key", }), )}).pipe(NodeRuntime.runMain)Other changes
There were several other smaller changes made. Take a look through the CHANGELOG to see them all: CHANGELOG.
Don’t forget to join our Discord Community to follow the last updates and discuss every tiny detail!