Releases: Effect-TS/effect
Releases · Effect-TS/effect
@effect/[email protected]
Patch Changes
- #3710
dc14e96
Thanks @tim-smart! - ensure rpc chunks are always delimited on write
@effect/[email protected]
Patch Changes
-
#3705
534abce
Thanks @Schniz! - add withActiveSpan function to attach Effect to current SpanThis function allows you to connect the Effect spans into a parent span
that was created outside of Effect, using the OpenTelemetry context propagation:Effect.gen(function* () { yield* Effect.sleep("100 millis").pipe(Effect.withSpan("sleep")) yield* Console.log("done") }).pipe( Effect.withSpan("program"), // This connects child spans to the current OpenTelemetry context Tracer.withActiveSpan )
@effect/[email protected]
Patch Changes
-
#3689
4d91f41
Thanks @tim-smart! - add layer api to@effect/vitest
This allows you to share a
Layer
between multiple tests, optionally wrapping
the tests in adescribe
block.import { expect, layer } from "@effect/vitest" import { Context, Effect, Layer } from "effect" class Foo extends Context.Tag("Foo")<Foo, "foo">() { static Live = Layer.succeed(Foo, "foo") } class Bar extends Context.Tag("Bar")<Bar, "bar">() { static Live = Layer.effect( Bar, Effect.map(Foo, () => "bar" as const) ) } layer(Foo.Live)("layer", (it) => { it.effect("adds context", () => Effect.gen(function* () { const foo = yield* Foo expect(foo).toEqual("foo") }) ) it.layer(Bar.Live)("nested", (it) => { it.effect("adds context", () => Effect.gen(function* () { const foo = yield* Foo const bar = yield* Bar expect(foo).toEqual("foo") expect(bar).toEqual("bar") }) ) }) })
[email protected]
Patch Changes
- #3661
4509656
Thanks @KhraksMamtsov! -Micro.EnvRef
andMicro.Handle
is subtype ofMicro
@effect/[email protected]
Patch Changes
- Updated dependencies [
4509656
]:
@effect/[email protected]
Patch Changes
- Updated dependencies [
4509656
]:
@effect/[email protected]
Minor Changes
- #3683
f100e20
Thanks @tim-smart! - use decoded ids in sql resolvers
@effect/[email protected]
Patch Changes
- Updated dependencies []:
- @effect/[email protected]
@effect/[email protected]
Patch Changes
-
#3676
0a68746
Thanks @tomglaize! - Add VariantSchema fieldFromKey utility to rename the encoded side of a field by variant.Example usage:
import { Schema } from "@effect/schema" import { VariantSchema } from "@effect/experimental" const { Class, fieldFromKey } = VariantSchema.make({ variants: ["domain", "json"], defaultVariant: "domain" }) class User extends Class<User>("User")({ id: Schema.Int, firstName: Schema.String.pipe(fieldFromKey({ json: "first_name" })) }) {} console.log( Schema.encodeSync(User.json)({ id: 1, firstName: "Bob" }) ) /* { id: 1, first_name: 'Bob' } */
-
Updated dependencies [
0a68746
,734eae6
,fd83d0e
,4509656
,ad7e1de
,090e41c
,090e41c
]:- @effect/[email protected]
- @effect/[email protected]
- @effect/[email protected]
- [email protected]
@effect/[email protected]
Patch Changes
- Updated dependencies [
f100e20
]:- @effect/[email protected]