Skip to content

Effect 3.10 (Release)

Effect 3.10 has been released! This release includes a number of new features and improvements. Here’s a summary of what’s new:

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:

Before

1
import {
2
Arbitrary,
3
AST,
4
FastCheck,
5
JSONSchema,
6
ParseResult,
7
Pretty,
8
Schema
9
} from "@effect/schema"

After

1
import {
2
Arbitrary,
3
SchemaAST, // changed
4
FastCheck,
5
JSONSchema,
6
ParseResult,
7
Pretty,
8
Schema
9
} from "effect"

ArrayFormatter / TreeFormatter has been merged into the ParseResult module.

Before

1
import { ArrayFormatter, TreeFormatter } from "@effect/schema"

After

1
import { ArrayFormatter, TreeFormatter } from "effect/ParseResult"

Merged into the Schema module.

Merged into the Schema module.

Before

1
import { Equivalence } from "@effect/schema"
2
3
Equivalence.make(myschema)

After

1
import { Schema } from "effect"
2
3
Schema.equivalence(myschema)

The HttpApi modules have undergone a number of improvements:

  • HttpApi, HttpApiGroup & HttpApiEndpoint now use a chainable api instead of a pipeable api.
  • HttpApiMiddleware module 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 HttpApiSchema encoding apis
  • toWebHandler has been simplified

For more information, see the README.

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.

These new apis allow you to create a stream from a TQueue or TPubSub.

1
import { Effect, Stream, TQueue } from "effect"
2
3
Effect.gen(function* () {
4
const queue = yield* TQueue.unbounded<number>()
5
6
const stream: Stream.Stream<number> = Stream.fromTQueue(queue)
7
})

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.

1
import { Headers } from "@effect/platform"
2
import { NodeRuntime } from "@effect/platform-node"
3
import { Effect } from "effect"
4
5
/*
6
7
Output:
8
[09:18:35.182] INFO (#0):
9
{ authorization: <redacted> }
10
11
*/
12
Effect.gen(function* () {
13
yield* Effect.log(
14
Headers.fromInput({
15
authorization: "Some secret key"
16
})
17
)
18
}).pipe(NodeRuntime.runMain)

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!