Major Changes
- #2207
2fb7d9c
Thanks @github-actions! - Release Effect 3.0 🎉
Minor Changes
-
#2207
1b5f0c7
Thanks @github-actions! - close FiberHandle/FiberSet/FiberMap when it is releasedWhen they are closed, fibers can no longer be added to them.
-
#2207
d50a652
Thanks @github-actions! - add preregisteredWords option to frequency metric key typeYou can use this to register a list of words to pre-populate the value of the
metric.import { Metric } from "effect"; const counts = Metric.frequency("counts", { preregisteredWords: ["a", "b", "c"], }).register();
-
#2207
9a3bd47
Thanks @github-actions! - Bump TypeScript min requirement to version 5.4 -
#2207
be9d025
Thanks @github-actions! - add unique identifier to Tracer.ParentSpan tag -
#2529
78b767c
Thanks @fubhy! - RenamedReadonlyArray
andReadonlyRecord
modules for better discoverability. -
#2207
5c2b561
Thanks @github-actions! - The signatures of theHaltStrategy.match
StreamHaltStrategy.match
functions have been changed to the generally accepted ones -
#2207
a18f594
Thanks @github-actions! - support variadic arguments in Effect.logThis makes Effect.log more similar to console.log:
Effect.log("hello", { foo: "bar" }, Cause.fail("error"));
-
#2207
2f96d93
Thanks @github-actions! - Fix ConfigError_tag
, with the previous implementation catching theConfigError
withEffect.catchTag
would showAnd
,Or
, etc. -
#2207
5a2314b
Thanks @github-actions! - replace use ofunit
terminology withvoid
For all the data types.
Effect.unit; // => Effect.void Stream.unit; // => Stream.void // etc
-
#2207
271b79f
Thanks @github-actions! - Either: fixgetEquivalence
parameter order fromEither.getEquivalence(left, right)
toEither.getEquivalence({ left, right })
-
#2207
53d1c2a
Thanks @github-actions! - use LazyArg for Effect.if branchesInstead of:
Effect.if(true, { onTrue: Effect.succeed("true"), onFalse: Effect.succeed("false"), });
You should now write:
Effect.if(true, { onTrue: () => Effect.succeed("true"), onFalse: () => Effect.succeed("false"), });
-
#2207
e7e1bbe
Thanks @github-actions! - Replaced customNoInfer
type with the nativeNoInfer
type from TypeScript 5.4 -
#2207
10c169e
Thanks @github-actions! -Cache<Key, Error, Value>
has been changed toCache<Key, Value, Error = never>
.
ScopedCache<Key, Error, Value>
has been changed toScopedCache<Key, Value, Error = never>
.
Lookup<Key, Environment, Error, Value>
has been changed toLookup<Key, Value, Error = never, Environment = never>
Patch Changes
-
#2104
1499974
Thanks @IMax153! - don't run resolver if there are no incomplete requests -
#2207
1b5f0c7
Thanks @github-actions! - add FiberMap.has/unsafeHas api -
#2104
1499974
Thanks @IMax153! - add String casing transformation apissnakeToCamel
snakeToPascal
snakeToKebab
camelToSnake
pascalToSnake
kebabToSnake
-
#2207
1b5f0c7
Thanks @github-actions! - add FiberHandle module, for holding a reference to a running fiberimport { Effect, FiberHandle } from "effect"; Effect.gen(function* (_) { const handle = yield* _(FiberHandle.make()); // run some effects yield* _(FiberHandle.run(handle, Effect.never)); // this will interrupt the previous fiber yield* _(FiberHandle.run(handle, Effect.never)); // this will not run, as a fiber is already running yield* _(FiberHandle.run(handle, Effect.never, { onlyIfMissing: true })); yield* _(Effect.sleep(1000)); }).pipe( Effect.scoped, // The fiber will be interrupted when the scope is closed );
-
#2521
6424181
Thanks @patroza! - change return type of Fiber.joinAll to return an array