jasonkuhrt / molt

⚡️ CLI building blocks & framework for the TypeScript era.
MIT License
77 stars 1 forks source link

deps(deps): update dependency effect to v2.4.19 #272

Open renovate[bot] opened 7 months ago

renovate[bot] commented 7 months ago

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
effect (source) 2.2.4 -> 2.4.19 age adoption passing confidence

Release Notes

Effect-TS/effect (effect) ### [`v2.4.19`](https://togithub.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#2419) [Compare Source](https://togithub.com/Effect-TS/effect/compare/effect@2.4.18...effect@2.4.19) ##### Patch Changes - [#​2503](https://togithub.com/Effect-TS/effect/pull/2503) [`41c8102`](https://togithub.com/Effect-TS/effect/commit/41c810228b1a50e4b41f19e735d7c62fe8d36871) Thanks [@​gcanti](https://togithub.com/gcanti)! - Centralize error messages for bugs - [#​2493](https://togithub.com/Effect-TS/effect/pull/2493) [`776ef2b`](https://togithub.com/Effect-TS/effect/commit/776ef2bb66db9aa9f68b7beab14f6986f9c1288b) Thanks [@​gcanti](https://togithub.com/gcanti)! - add a `RegExp` module to `packages/effect`, closes [#​2488](https://togithub.com/Effect-TS/effect/issues/2488) - [#​2499](https://togithub.com/Effect-TS/effect/pull/2499) [`217147e`](https://togithub.com/Effect-TS/effect/commit/217147ea67c5c42c96f024775c41e5b070f81e4c) Thanks [@​tim-smart](https://togithub.com/tim-smart)! - ensure FIFO ordering when a Deferred is resolved - [#​2502](https://togithub.com/Effect-TS/effect/pull/2502) [`90776ec`](https://togithub.com/Effect-TS/effect/commit/90776ec8e8671d835b65fc33ead1de6c864b81b9) Thanks [@​tim-smart](https://togithub.com/tim-smart)! - make tracing spans cheaper to construct - [#​2472](https://togithub.com/Effect-TS/effect/pull/2472) [`8709856`](https://togithub.com/Effect-TS/effect/commit/870985694ae985c3cb9360ad8a25c60e6f785f55) Thanks [@​tim-smart](https://togithub.com/tim-smart)! - add Subscribable trait / module Subscribable represents a resource that has a current value and can be subscribed to for updates. The following data types are subscribable: - A `SubscriptionRef` - An `Actor` from the experimental `Machine` module - [#​2500](https://togithub.com/Effect-TS/effect/pull/2500) [`232c353`](https://togithub.com/Effect-TS/effect/commit/232c353c2e6f743f38e57639ee30e324ffa9c2a9) Thanks [@​tim-smart](https://togithub.com/tim-smart)! - simplify scope internals - [#​2507](https://togithub.com/Effect-TS/effect/pull/2507) [`0ca835c`](https://togithub.com/Effect-TS/effect/commit/0ca835cbac8e69072a93ace83b534219faba24e8) Thanks [@​gcanti](https://togithub.com/gcanti)! - ensure correct value is passed to mapping function in `mapAccum` loop, closes [#​2506](https://togithub.com/Effect-TS/effect/issues/2506) - [#​2472](https://togithub.com/Effect-TS/effect/pull/2472) [`8709856`](https://togithub.com/Effect-TS/effect/commit/870985694ae985c3cb9360ad8a25c60e6f785f55) Thanks [@​tim-smart](https://togithub.com/tim-smart)! - add Readable module / trait `Readable` is a common interface for objects that can be read from using a `get` Effect. For example, `Ref`'s implement `Readable`: ```ts import { Effect, Readable, Ref } from "effect"; import assert from "assert"; Effect.gen(function* (_) { const ref = yield* _(Ref.make(123)); assert(Readable.isReadable(ref)); const result = yield* _(ref.get); assert(result === 123); }); ``` - [#​2498](https://togithub.com/Effect-TS/effect/pull/2498) [`e983740`](https://togithub.com/Effect-TS/effect/commit/e9837401145605aff5bc2ec7e73004f397c5d2d1) Thanks [@​jessekelly881](https://togithub.com/jessekelly881)! - added {Readable, Subscribable}.unwrap - [#​2494](https://togithub.com/Effect-TS/effect/pull/2494) [`e3e0924`](https://togithub.com/Effect-TS/effect/commit/e3e09247d46a35430fc60e4aa4032cc50814f212) Thanks [@​thewilkybarkid](https://togithub.com/thewilkybarkid)! - Add `Duration.divide` and `Duration.unsafeDivide`. ```ts import { Duration, Option } from "effect"; import assert from "assert"; assert.deepStrictEqual( Duration.divide("10 seconds", 2), Option.some(Duration.decode("5 seconds")), ); assert.deepStrictEqual(Duration.divide("10 seconds", 0), Option.none()); assert.deepStrictEqual(Duration.divide("1 nano", 1.5), Option.none()); assert.deepStrictEqual( Duration.unsafeDivide("10 seconds", 2), Duration.decode("5 seconds"), ); assert.deepStrictEqual( Duration.unsafeDivide("10 seconds", 0), Duration.infinity, ); assert.throws(() => Duration.unsafeDivide("1 nano", 1.5)); ``` ### [`v2.4.18`](https://togithub.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#2418) [Compare Source](https://togithub.com/Effect-TS/effect/compare/effect@2.4.17...effect@2.4.18) ##### Patch Changes - [#​2473](https://togithub.com/Effect-TS/effect/pull/2473) [`dadc690`](https://togithub.com/Effect-TS/effect/commit/dadc6906121c512bc32be22b52adbd1ada834594) Thanks [@​tim-smart](https://togithub.com/tim-smart)! - add Logger.withConsoleLog/withConsoleError apis These apis send a Logger's output to console.log/console.error respectively. ```ts import { Logger } from "effect"; // send output to stderr const stderrLogger = Logger.withConsoleError(Logger.stringLogger); ``` ### [`v2.4.17`](https://togithub.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#2417) [Compare Source](https://togithub.com/Effect-TS/effect/compare/effect@2.4.16...effect@2.4.17) ##### Patch Changes - [#​2461](https://togithub.com/Effect-TS/effect/pull/2461) [`8fdfda6`](https://togithub.com/Effect-TS/effect/commit/8fdfda6618be848c01b399d13bc05a9a3adfb613) Thanks [@​tim-smart](https://togithub.com/tim-smart)! - add Inspectable.toStringUnknown/stringifyCircular - [#​2462](https://togithub.com/Effect-TS/effect/pull/2462) [`607b2e7`](https://togithub.com/Effect-TS/effect/commit/607b2e7a7fd9318c57acf4e50ec61747eea74ad7) Thanks [@​tim-smart](https://togithub.com/tim-smart)! - remove handled errors from Effect.retryOrElse - [#​2461](https://togithub.com/Effect-TS/effect/pull/2461) [`8fdfda6`](https://togithub.com/Effect-TS/effect/commit/8fdfda6618be848c01b399d13bc05a9a3adfb613) Thanks [@​tim-smart](https://togithub.com/tim-smart)! - improve formatting of Runtime failures - [#​2415](https://togithub.com/Effect-TS/effect/pull/2415) [`8206caf`](https://togithub.com/Effect-TS/effect/commit/8206caf7c2d22c68be4313318b61cfdacf6222b6) Thanks [@​tim-smart](https://togithub.com/tim-smart)! - add Iterable module This module shares many apis compared to "effect/ReadonlyArray", but is fully lazy. ```ts import { Iterable, pipe } from "effect"; // Only 5 items will be generated & transformed pipe( Iterable.range(1, 100), Iterable.map((i) => `item ${i}`), Iterable.take(5), ); ``` - [#​2438](https://togithub.com/Effect-TS/effect/pull/2438) [`7ddd654`](https://togithub.com/Effect-TS/effect/commit/7ddd65415b65ccb654ad04f4dbefe39402f15117) Thanks [@​mikearnaldi](https://togithub.com/mikearnaldi)! - Support Heterogeneous Effects in Effect Iterable apis Including: - `Effect.allSuccesses` - `Effect.firstSuccessOf` - `Effect.mergeAll` - `Effect.reduceEffect` - `Effect.raceAll` - `Effect.forkAll` For example: ```ts import { Effect } from "effect"; class Foo extends Effect.Tag("Foo")() {} class Bar extends Effect.Tag("Bar")() {} // const program: Effect.Effect<(1 | 2 | 3 | 4)[], never, Foo | Bar> export const program = Effect.allSuccesses([ Effect.succeed(1 as const), Effect.succeed(2 as const), Foo, Bar, ]); ``` The above is now possible while before it was expecting all Effects to conform to the same type - [#​2438](https://togithub.com/Effect-TS/effect/pull/2438) [`7ddd654`](https://togithub.com/Effect-TS/effect/commit/7ddd65415b65ccb654ad04f4dbefe39402f15117) Thanks [@​mikearnaldi](https://togithub.com/mikearnaldi)! - add Effect.filterMap api Which allows you to filter and map an Iterable of Effects in one step. ```ts import { Effect, Option } from "effect"; // resolves with `["even: 2"] Effect.filterMap( [Effect.succeed(1), Effect.succeed(2), Effect.succeed(3)], (i) => (i % 2 === 0 ? Option.some(`even: ${i}`) : Option.none()), ); ``` - [#​2461](https://togithub.com/Effect-TS/effect/pull/2461) [`8fdfda6`](https://togithub.com/Effect-TS/effect/commit/8fdfda6618be848c01b399d13bc05a9a3adfb613) Thanks [@​tim-smart](https://togithub.com/tim-smart)! - use Inspectable.toStringUnknown for absurd runtime errors - [#​2460](https://togithub.com/Effect-TS/effect/pull/2460) [`f456ba2`](https://togithub.com/Effect-TS/effect/commit/f456ba273bae21a6dcf8c966c50c97b5f0897d9f) Thanks [@​tim-smart](https://togithub.com/tim-smart)! - use const type parameter for Config.withDefault Which ensures that the fallback value type is not widened for literals. ### [`v2.4.16`](https://togithub.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#2416) [Compare Source](https://togithub.com/Effect-TS/effect/compare/effect@2.4.15...effect@2.4.16) ##### Patch Changes - [#​2445](https://togithub.com/Effect-TS/effect/pull/2445) [`5170ce7`](https://togithub.com/Effect-TS/effect/commit/5170ce708c606283e8a30d273950f1a21c7eddc2) Thanks [@​vecerek](https://togithub.com/vecerek)! - generate proper trace ids in default effect Tracer ### [`v2.4.15`](https://togithub.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#2415) [Compare Source](https://togithub.com/Effect-TS/effect/compare/effect@2.4.14...effect@2.4.15) ##### Patch Changes - [#​2407](https://togithub.com/Effect-TS/effect/pull/2407) [`d7688c0`](https://togithub.com/Effect-TS/effect/commit/d7688c0c72717fe7876c871567f6946dabfc0546) Thanks [@​thewilkybarkid](https://togithub.com/thewilkybarkid)! - Add Config.duration This can be used to parse Duration's from environment variables: ```ts import { Config, Effect } from "effect" Config.duration("CACHE_TTL").pipe( Effect.andThen((duration) => ...) ) ``` - [#​2416](https://togithub.com/Effect-TS/effect/pull/2416) [`b3a4fac`](https://togithub.com/Effect-TS/effect/commit/b3a4face2acaca422f0b0530436e8f13129f3b3a) Thanks [@​mikearnaldi](https://togithub.com/mikearnaldi)! - Collect exits on forEach interrupt of residual requests ### [`v2.4.14`](https://togithub.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#2414) [Compare Source](https://togithub.com/Effect-TS/effect/compare/effect@2.4.13...effect@2.4.14) ##### Patch Changes - [#​2404](https://togithub.com/Effect-TS/effect/pull/2404) [`6180c0c`](https://togithub.com/Effect-TS/effect/commit/6180c0cc51dee785cfce72220a52c9fc3b9bf9aa) Thanks [@​patroza](https://togithub.com/patroza)! - fix interruption of parked Requests ### [`v2.4.13`](https://togithub.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#2413) [Compare Source](https://togithub.com/Effect-TS/effect/compare/effect@2.4.12...effect@2.4.13) ##### Patch Changes - [#​2402](https://togithub.com/Effect-TS/effect/pull/2402) [`3336287`](https://togithub.com/Effect-TS/effect/commit/3336287ff55a25e56d759b83847bfaa21c40f499) Thanks [@​tim-smart](https://togithub.com/tim-smart)! - add Duration.subtract api - [#​2399](https://togithub.com/Effect-TS/effect/pull/2399) [`54b7c00`](https://togithub.com/Effect-TS/effect/commit/54b7c0077fa784ad2646b812d6a44641f672edcd) Thanks [@​coleea](https://togithub.com/coleea)! - add BigInt.fromString and BigInt.fromNumber - [#​2402](https://togithub.com/Effect-TS/effect/pull/2402) [`3336287`](https://togithub.com/Effect-TS/effect/commit/3336287ff55a25e56d759b83847bfaa21c40f499) Thanks [@​tim-smart](https://togithub.com/tim-smart)! - remove use of bigint literals in Duration ### [`v2.4.12`](https://togithub.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#2412) [Compare Source](https://togithub.com/Effect-TS/effect/compare/effect@2.4.11...effect@2.4.12) ##### Patch Changes - [#​2385](https://togithub.com/Effect-TS/effect/pull/2385) [`3307729`](https://togithub.com/Effect-TS/effect/commit/3307729de162a033fa9caa8e14c111013dcf0d87) Thanks [@​tim-smart](https://togithub.com/tim-smart)! - update typescript to 5.4 ### [`v2.4.11`](https://togithub.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#2411) [Compare Source](https://togithub.com/Effect-TS/effect/compare/effect@2.4.10...effect@2.4.11) ##### Patch Changes - [#​2384](https://togithub.com/Effect-TS/effect/pull/2384) [`2f488c4`](https://togithub.com/Effect-TS/effect/commit/2f488c436de52576562803c57ebc132ef40ccdd8) Thanks [@​tim-smart](https://togithub.com/tim-smart)! - update dependencies - [#​2381](https://togithub.com/Effect-TS/effect/pull/2381) [`37ca592`](https://togithub.com/Effect-TS/effect/commit/37ca592a4101ad90adbf8c8b3f727faf3110cae5) Thanks [@​tim-smart](https://togithub.com/tim-smart)! - add fiber ref for disabling the tracer You can use it with the Effect.withTracerEnabled api: ```ts import { Effect } from "effect"; Effect.succeed(42).pipe( Effect.withSpan("my-span"), // the span will not be registered with the tracer Effect.withTracerEnabled(false), ); ``` - [#​2383](https://togithub.com/Effect-TS/effect/pull/2383) [`317b5b8`](https://togithub.com/Effect-TS/effect/commit/317b5b8e8c8c2207469b3ebfcf72bf3a9f7cbc60) Thanks [@​tim-smart](https://togithub.com/tim-smart)! - add Duration.isFinite api, to determine if a duration is not Infinity ### [`v2.4.10`](https://togithub.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#2410) [Compare Source](https://togithub.com/Effect-TS/effect/compare/effect@2.4.9...effect@2.4.10) ##### Patch Changes - [#​2375](https://togithub.com/Effect-TS/effect/pull/2375) [`9bab1f9`](https://togithub.com/Effect-TS/effect/commit/9bab1f9fa5b999740755e4e82485cb77c638643a) Thanks [@​tim-smart](https://togithub.com/tim-smart)! - remove dangling variable in frequency metric hook - [#​2373](https://togithub.com/Effect-TS/effect/pull/2373) [`9bbde5b`](https://togithub.com/Effect-TS/effect/commit/9bbde5be9a0168d1c2a0308bfc27167ed62f3968) Thanks [@​patroza](https://togithub.com/patroza)! - Use incremental counters instead of up-down for runtime metrics ### [`v2.4.9`](https://togithub.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#249) [Compare Source](https://togithub.com/Effect-TS/effect/compare/effect@2.4.8...effect@2.4.9) ##### Patch Changes - [#​2357](https://togithub.com/Effect-TS/effect/pull/2357) [`71fd528`](https://togithub.com/Effect-TS/effect/commit/71fd5287500f9ce155a7d9f0df6ee3e0ac3aeb99) Thanks [@​tim-smart](https://togithub.com/tim-smart)! - make more data types in /platform implement Inspectable ### [`v2.4.8`](https://togithub.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#248) [Compare Source](https://togithub.com/Effect-TS/effect/compare/effect@2.4.7...effect@2.4.8) ##### Patch Changes - [#​2354](https://togithub.com/Effect-TS/effect/pull/2354) [`bb0b69e`](https://togithub.com/Effect-TS/effect/commit/bb0b69e519698c7c76aa68217de423c78ad16566) Thanks [@​tim-smart](https://togithub.com/tim-smart)! - add overload to Effect.filterOrFail that fails with NoSuchElementException This allows you to perform a filterOrFail without providing a fallback failure function. Example: ```ts import { Effect } from "effect"; // fails with NoSuchElementException Effect.succeed(1).pipe(Effect.filterOrFail((n) => n === 0)); ``` - [#​2336](https://togithub.com/Effect-TS/effect/pull/2336) [`6b20bad`](https://togithub.com/Effect-TS/effect/commit/6b20badebb3a7ca4d38857753e8ecaa09d02ccfb) Thanks [@​jessekelly881](https://togithub.com/jessekelly881)! - added Predicate.isTruthy - [#​2351](https://togithub.com/Effect-TS/effect/pull/2351) [`4e64e9b`](https://togithub.com/Effect-TS/effect/commit/4e64e9b9876de6bfcbabe39e18a91a08e5f3fbb0) Thanks [@​tim-smart](https://togithub.com/tim-smart)! - fix metrics not using labels from fiber ref - [#​2266](https://togithub.com/Effect-TS/effect/pull/2266) [`3851a02`](https://togithub.com/Effect-TS/effect/commit/3851a022c481006aec1db36651e4b4fd727aa742) Thanks [@​patroza](https://togithub.com/patroza)! - fix Effect.Tag generated proxy functions to work with andThen/tap, or others that do function/isEffect checks - [#​2353](https://togithub.com/Effect-TS/effect/pull/2353) [`5f5fcd9`](https://togithub.com/Effect-TS/effect/commit/5f5fcd969ae30ed6fe61d566a571498d9e895e16) Thanks [@​tim-smart](https://togithub.com/tim-smart)! - Types: add `Has` helper - [#​2299](https://togithub.com/Effect-TS/effect/pull/2299) [`814e5b8`](https://togithub.com/Effect-TS/effect/commit/814e5b828f68210b9e8f336fd6ac688646835dd9) Thanks [@​alex-dixon](https://togithub.com/alex-dixon)! - Prevent Effect.if from crashing when first argument is not an Effect ### [`v2.4.7`](https://togithub.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#247) [Compare Source](https://togithub.com/Effect-TS/effect/compare/effect@2.4.6...effect@2.4.7) ##### Patch Changes - [#​2328](https://togithub.com/Effect-TS/effect/pull/2328) [`eb93283`](https://togithub.com/Effect-TS/effect/commit/eb93283985913d7b04ca750e36ac8513e7b6cef6) Thanks [@​tim-smart](https://togithub.com/tim-smart)! - set unhandled log level to none for fibers in FiberSet/Map ### [`v2.4.6`](https://togithub.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#246) [Compare Source](https://togithub.com/Effect-TS/effect/compare/effect@2.4.5...effect@2.4.6) ##### Patch Changes - [#​2290](https://togithub.com/Effect-TS/effect/pull/2290) [`4f35a7e`](https://togithub.com/Effect-TS/effect/commit/4f35a7e7c4eba598924aff24d1158b9056bb24be) Thanks [@​mikearnaldi](https://togithub.com/mikearnaldi)! - Remove function renaming from internals, introduce new cutpoint strategy - [#​2311](https://togithub.com/Effect-TS/effect/pull/2311) [`9971186`](https://togithub.com/Effect-TS/effect/commit/99711862722188fbb5ed3ee75126ad5edf13f72f) Thanks [@​tim-smart](https://togithub.com/tim-smart)! - add Channel.splitLines api It splits strings on newlines. Handles both Windows newlines (`\r\n`) and UNIX newlines (`\n`). ### [`v2.4.5`](https://togithub.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#245) [Compare Source](https://togithub.com/Effect-TS/effect/compare/effect@2.4.4...effect@2.4.5) ##### Patch Changes - [#​2300](https://togithub.com/Effect-TS/effect/pull/2300) [`bce21c5`](https://togithub.com/Effect-TS/effect/commit/bce21c5ded2177114666ba229bd5029fa000dee3) Thanks [@​gcanti](https://togithub.com/gcanti)! - ReadonlyArray: fix `intersperse` signature - [#​2303](https://togithub.com/Effect-TS/effect/pull/2303) [`c7d3036`](https://togithub.com/Effect-TS/effect/commit/c7d303630b7f0825cb2e584557c5767a67214d9f) Thanks [@​gcanti](https://togithub.com/gcanti)! - ReadonlyArray: fix `sort` signature, closes [#​2301](https://togithub.com/Effect-TS/effect/issues/2301) ### [`v2.4.4`](https://togithub.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#244) [Compare Source](https://togithub.com/Effect-TS/effect/compare/effect@2.4.3...effect@2.4.4) ##### Patch Changes - [#​2172](https://togithub.com/Effect-TS/effect/pull/2172) [`5d47ee0`](https://togithub.com/Effect-TS/effect/commit/5d47ee0855e492532085b6092879b1b952d84949) Thanks [@​gcanti](https://togithub.com/gcanti)! - Brand: add `refined` overload ```ts export function refined>( f: (unbranded: Brand.Unbranded) => Option.Option, ): Brand.Constructor; ``` - [#​2285](https://togithub.com/Effect-TS/effect/pull/2285) [`817a04c`](https://togithub.com/Effect-TS/effect/commit/817a04cb2df0f4140984dc97eb3e1bb14a6c4a38) Thanks [@​tim-smart](https://togithub.com/tim-smart)! - add support for AbortSignal's to runPromise If the signal is aborted, the effect execution will be interrupted. ```ts import { Effect } from "effect"; const controller = new AbortController(); Effect.runPromise(Effect.never, { signal: controller.signal }); // abort after 1 second setTimeout(() => controller.abort(), 1000); ``` - [#​2293](https://togithub.com/Effect-TS/effect/pull/2293) [`d90a99d`](https://togithub.com/Effect-TS/effect/commit/d90a99d03d074adc7cd2533f15419138264da5a2) Thanks [@​tim-smart](https://togithub.com/tim-smart)! - add AbortSignal support to ManagedRuntime - [#​2288](https://togithub.com/Effect-TS/effect/pull/2288) [`dd05faa`](https://togithub.com/Effect-TS/effect/commit/dd05faa621555ef3585ecd914ac13ecd89b710f4) Thanks [@​tim-smart](https://togithub.com/tim-smart)! - optimize addition of blocked requests to parallel collection - [#​2288](https://togithub.com/Effect-TS/effect/pull/2288) [`dd05faa`](https://togithub.com/Effect-TS/effect/commit/dd05faa621555ef3585ecd914ac13ecd89b710f4) Thanks [@​tim-smart](https://togithub.com/tim-smart)! - use Chunk for request block collections - [#​2280](https://togithub.com/Effect-TS/effect/pull/2280) [`802674b`](https://togithub.com/Effect-TS/effect/commit/802674b379b7559ad3ff09b33388891445a9e48b) Thanks [@​jessekelly881](https://togithub.com/jessekelly881)! - added support for PromiseLike ### [`v2.4.3`](https://togithub.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#243) [Compare Source](https://togithub.com/Effect-TS/effect/compare/effect@2.4.2...effect@2.4.3) ##### Patch Changes - [#​2211](https://togithub.com/Effect-TS/effect/pull/2211) [`20e63fb`](https://togithub.com/Effect-TS/effect/commit/20e63fb9207210f3fe2d136ec40d0a2dbff3225e) Thanks [@​tim-smart](https://togithub.com/tim-smart)! - add ManagedRuntime module, to make incremental adoption easier You can use a ManagedRuntime to run Effect's that can use the dependencies from the given Layer. For example: ```ts import { Console, Effect, Layer, ManagedRuntime } from "effect"; class Notifications extends Effect.Tag("Notifications")< Notifications, { readonly notify: (message: string) => Effect.Effect } >() { static Live = Layer.succeed(this, { notify: (message) => Console.log(message), }); } async function main() { const runtime = ManagedRuntime.make(Notifications.Live); await runtime.runPromise(Notifications.notify("Hello, world!")); await runtime.dispose(); } main(); ``` - [#​2211](https://togithub.com/Effect-TS/effect/pull/2211) [`20e63fb`](https://togithub.com/Effect-TS/effect/commit/20e63fb9207210f3fe2d136ec40d0a2dbff3225e) Thanks [@​tim-smart](https://togithub.com/tim-smart)! - add Layer.toRuntimeWithMemoMap api Similar to Layer.toRuntime, but allows you to share a Layer.MemoMap between layer builds. By sharing the MemoMap, layers are shared between each build - ensuring layers are only built once between multiple calls to Layer.toRuntimeWithMemoMap. ### [`v2.4.2`](https://togithub.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#242) [Compare Source](https://togithub.com/Effect-TS/effect/compare/effect@2.4.1...effect@2.4.2) ##### Patch Changes - [#​2264](https://togithub.com/Effect-TS/effect/pull/2264) [`e03811e`](https://togithub.com/Effect-TS/effect/commit/e03811e80c93e986e6348b3b67ac2ed6d5fefff0) Thanks [@​patroza](https://togithub.com/patroza)! - fix: unmatched function fallthrough in `andThen` and `tap` - [#​2225](https://togithub.com/Effect-TS/effect/pull/2225) [`ac41d84`](https://togithub.com/Effect-TS/effect/commit/ac41d84776484cdce8165b7ca2c9c9b6377eee2d) Thanks [@​mikearnaldi](https://togithub.com/mikearnaldi)! - Add Effect.Tag to simplify access to service. This change allows to define tags in the following way: ```ts class DemoTag extends Effect.Tag("DemoTag")< DemoTag, { readonly getNumbers: () => Array; readonly strings: Array; } >() {} ``` And use them like: ```ts DemoTag.getNumbers(); DemoTag.strings; ``` This fuses together `serviceFunctions` and `serviceConstants` in the static side of the tag. Additionally it allows using the service like: ```ts DemoTag.use((_) => _.getNumbers()); ``` This is especially useful when having functions that contain generics in the service given that those can't be reliably transformed at the type level and because of that we can't put them on the tag. - [#​2238](https://togithub.com/Effect-TS/effect/pull/2238) [`6137533`](https://togithub.com/Effect-TS/effect/commit/613753300c7705518ab1fea2f370b032851c2750) Thanks [@​JJayet](https://togithub.com/JJayet)! - Request: swap Success and Error params - [#​2270](https://togithub.com/Effect-TS/effect/pull/2270) [`f373529`](https://togithub.com/Effect-TS/effect/commit/f373529999f4b8bc92b634f6ea14f19271388eed) Thanks [@​tim-smart](https://togithub.com/tim-smart)! - add structured logging apis - Logger.json / Logger.jsonLogger - Logger.structured / Logger.structuredLogger `Logger.json` logs JSON serialized strings to the console. `Logger.structured` logs structured objects, which is useful in the browser where you can inspect objects logged to the console. - [#​2257](https://togithub.com/Effect-TS/effect/pull/2257) [`1bf9f31`](https://togithub.com/Effect-TS/effect/commit/1bf9f31f07667de677673f7c29a4e7a26ebad3c8) Thanks [@​mikearnaldi](https://togithub.com/mikearnaldi)! - Make sure Effect.Tag works on primitives. This change allows the following to work just fine: ```ts import { Effect, Layer } from "effect"; class DateTag extends Effect.Tag("DateTag")() { static date = new Date(1970, 1, 1); static Live = Layer.succeed(this, this.date); } class MapTag extends Effect.Tag("MapTag")>() { static Live = Layer.effect( this, Effect.sync(() => new Map()), ); } class NumberTag extends Effect.Tag("NumberTag")() { static Live = Layer.succeed(this, 100); } ``` - [#​2244](https://togithub.com/Effect-TS/effect/pull/2244) [`e3ff789`](https://togithub.com/Effect-TS/effect/commit/e3ff789226f89e71eb28ca38ce79f90af6a03f1a) Thanks [@​tim-smart](https://togithub.com/tim-smart)! - add FiberMap/FiberSet.join api This api can be used to propogate failures back to a parent fiber, in case any of the fibers added to the FiberMap/FiberSet fail with an error. Example: ```ts import { Effect, FiberSet } from "effect"; Effect.gen(function* (_) { const set = yield* _(FiberSet.make()); yield* _(FiberSet.add(set, Effect.runFork(Effect.fail("error")))); // parent fiber will fail with "error" yield* _(FiberSet.join(set)); }); ``` - [#​2238](https://togithub.com/Effect-TS/effect/pull/2238) [`6137533`](https://togithub.com/Effect-TS/effect/commit/613753300c7705518ab1fea2f370b032851c2750) Thanks [@​JJayet](https://togithub.com/JJayet)! - make Effect.request dual - [#​2263](https://togithub.com/Effect-TS/effect/pull/2263) [`507ba40`](https://togithub.com/Effect-TS/effect/commit/507ba4060ff043c1a8d541dae723fa6940633b00) Thanks [@​thewilkybarkid](https://togithub.com/thewilkybarkid)! - Allow duration inputs to be singular - [#​2255](https://togithub.com/Effect-TS/effect/pull/2255) [`e466afe`](https://togithub.com/Effect-TS/effect/commit/e466afe32f2de598ceafd8982bd0cfbd388e5671) Thanks [@​jessekelly881](https://togithub.com/jessekelly881)! - added Either.Either.{Left,Right} and Option.Option.Value type utils - [#​2270](https://togithub.com/Effect-TS/effect/pull/2270) [`f373529`](https://togithub.com/Effect-TS/effect/commit/f373529999f4b8bc92b634f6ea14f19271388eed) Thanks [@​tim-smart](https://togithub.com/tim-smart)! - add Logger.batched, for batching logger output It takes a duration window and an effectful function that processes the batched output. Example: ```ts import { Console, Effect, Logger } from "effect"; const LoggerLive = Logger.replaceScoped( Logger.defaultLogger, Logger.logfmtLogger.pipe( Logger.batched("500 millis", (messages) => Console.log("BATCH", messages.join("\n")), ), ), ); Effect.gen(function* (_) { yield* _(Effect.log("one")); yield* _(Effect.log("two")); yield* _(Effect.log("three")); }).pipe(Effect.provide(LoggerLive), Effect.runFork); ``` - [#​2233](https://togithub.com/Effect-TS/effect/pull/2233) [`de74eb8`](https://togithub.com/Effect-TS/effect/commit/de74eb80a79eebde5ff645033765e7a617e92f27) Thanks [@​gcanti](https://togithub.com/gcanti)! - Struct: make `pick` / `omit` dual ### [`v2.4.1`](https://togithub.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#2419) [Compare Source](https://togithub.com/Effect-TS/effect/compare/effect@2.4.0...effect@2.4.1) ##### Patch Changes - [#​2503](https://togithub.com/Effect-TS/effect/pull/2503) [`41c8102`](https://togithub.com/Effect-TS/effect/commit/41c810228b1a50e4b41f19e735d7c62fe8d36871) Thanks [@​gcanti](https://togithub.com/gcanti)! - Centralize error messages for bugs - [#​2493](https://togithub.com/Effect-TS/effect/pull/2493) [`776ef2b`](https://togithub.com/Effect-TS/effect/commit/776ef2bb66db9aa9f68b7beab14f6986f9c1288b) Thanks [@​gcanti](https://togithub.com/gcanti)! - add a `RegExp` module to `packages/effect`, closes [#​2488](https://togithub.com/Effect-TS/effect/issues/2488) - [#​2499](https://togithub.com/Effect-TS/effect/pull/2499) [`217147e`](https://togithub.com/Effect-TS/effect/commit/217147ea67c5c42c96f024775c41e5b070f81e4c) Thanks [@​tim-smart](https://togithub.com/tim-smart)! - ensure FIFO ordering when a Deferred is resolved - [#​2502](https://togithub.com/Effect-TS/effect/pull/2502) [`90776ec`](https://togithub.com/Effect-TS/effect/commit/90776ec8e8671d835b65fc33ead1de6c864b81b9) Thanks [@​tim-smart](https://togithub.com/tim-smart)! - make tracing spans cheaper to construct - [#​2472](https://togithub.com/Effect-TS/effect/pull/2472) [`8709856`](https://togithub.com/Effect-TS/effect/commit/870985694ae985c3cb9360ad8a25c60e6f785f55) Thanks [@​tim-smart](https://togithub.com/tim-smart)! - add Subscribable trait / module Subscribable represents a resource that has a current value and can be subscribed to for updates. The following data types are subscribable: - A `SubscriptionRef` - An `Actor` from the experimental `Machine` module - [#​2500](https://togithub.com/Effect-TS/effect/pull/2500) [`232c353`](https://togithub.com/Effect-TS/effect/commit/232c353c2e6f743f38e57639ee30e324ffa9c2a9) Thanks [@​tim-smart](https://togithub.com/tim-smart)! - simplify scope internals - [#​2507](https://togithub.com/Effect-TS/effect/pull/2507) [`0ca835c`](https://togithub.com/Effect-TS/effect/commit/0ca835cbac8e69072a93ace83b534219faba24e8) Thanks [@​gcanti](https://togithub.com/gcanti)! - ensure correct value is passed to mapping function in `mapAccum` loop, closes [#​2506](https://togithub.com/Effect-TS/effect/issues/2506) - [#​2472](https://togithub.com/Effect-TS/effect/pull/2472) [`8709856`](https://togithub.com/Effect-TS/effect/commit/870985694ae985c3cb9360ad8a25c60e6f785f55) Thanks [@​tim-smart](https://togithub.com/tim-smart)! - add Readable module / trait `Readable` is a common interface for objects that can be read from using a `get` Effect. For example, `Ref`'s implement `Readable`: ```ts import { Effect, Readable, Ref } from "effect"; import assert from "assert"; Effect.gen(function* (_) { const ref = yield* _(Ref.make(123)); assert(Readable.isReadable(ref)); const result = yield* _(ref.get); assert(result === 123); }); ``` - [#​2498](https://togithub.com/Effect-TS/effect/pull/2498) [`e983740`](https://togithub.com/Effect-TS/effect/commit/e9837401145605aff5bc2ec7e73004f397c5d2d1) Thanks [@​jessekelly881](https://togithub.com/jessekelly881)! - added {Readable, Subscribable}.unwrap - [#​2494](https://togithub.com/Effect-TS/effect/pull/2494) [`e3e0924`](https://togithub.com/Effect-TS/effect/commit/e3e09247d46a35430fc60e4aa4032cc50814f212) Thanks [@​thewilkybarkid](https://togithub.com/thewilkybarkid)! - Add `Duration.divide` and `Duration.unsafeDivide`. ```ts import { Duration, Option } from "effect"; import assert from "assert"; assert.deepStrictEqual( Duration.divide("10 seconds", 2), Option.some(Duration.decode("5 seconds")), ); assert.deepStrictEqual(Duration.divide("10 seconds", 0), Option.none()); assert.deepStrictEqual(Duration.divide("1 nano", 1.5), Option.none()); assert.deepStrictEqual( Duration.unsafeDivide("10 seconds", 2), Duration.decode("5 seconds"), ); assert.deepStrictEqual( Duration.unsafeDivide("10 seconds", 0), Duration.infinity, ); assert.throws(() => Duration.unsafeDivide("1 nano", 1.5)); ``` ### [`v2.4.0`](https://togithub.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#240) [Compare Source](https://togithub.com/Effect-TS/effect/compare/effect@2.3.8...effect@2.4.0) ##### Minor Changes - [#​2101](https://togithub.com/Effect-TS/effect/pull/2101) [`5de7be5`](https://togithub.com/Effect-TS/effect/commit/5de7be5beca2e963b503e6029dcc3217848187d2) Thanks [@​github-actions](https://togithub.com/apps/github-actions)! - remove ReadonlyRecord.fromIterable (duplicate of fromEntries) - [#​2101](https://togithub.com/Effect-TS/effect/pull/2101) [`489fcf3`](https://togithub.com/Effect-TS/effect/commit/489fcf363ff2b2a953166b740cb9a62d7fc2a101) Thanks [@​github-actions](https://togithub.com/apps/github-actions)! - - swap `Schedule` type parameters from `Schedule` to `Schedule`, closes [#​2154](https://togithub.com/Effect-TS/effect/issues/2154) - swap `ScheduleDriver` type parameters from `ScheduleDriver` to `ScheduleDriver` - [#​2101](https://togithub.com/Effect-TS/effect/pull/2101) [`7d9c3bf`](https://togithub.com/Effect-TS/effect/commit/7d9c3bff6c18d451e0e4781042945ec5c7be1b9f) Thanks [@​github-actions](https://togithub.com/apps/github-actions)! - Consolidate `Effect.asyncOption`, `Effect.asyncEither`, `Stream.asyncOption`, `Stream.asyncEither`, and `Stream.asyncInterrupt` This PR removes `Effect.asyncOption` and `Effect.asyncEither` as their behavior can be entirely implemented with the new signature of `Effect.async`, which optionally returns a cleanup `Effect` from the registration callback. ```ts declare const async: ( register: ( callback: (_: Effect) => void, signal: AbortSignal, ) => void | Effect, blockingOn?: FiberId, ) => Effect; ``` Additionally, this PR removes `Stream.asyncOption`, `Stream.asyncEither`, and `Stream.asyncInterrupt` as their behavior can be entirely implemented with the new signature of `Stream.async`, which can optionally return a cleanup `Effect` from the registration callback. ```ts declare const async: ( register: (emit: Emit) => Effect | void, outputBuffer?: number, ) => Stream; ``` - [#​2101](https://togithub.com/Effect-TS/effect/pull/2101) [`d8d278b`](https://togithub.com/Effect-TS/effect/commit/d8d278b2efb2966947029885e01f7b68348a021f) Thanks [@​github-actions](https://togithub.com/apps/github-actions)! - swap `GroupBy` type parameters from `GroupBy` to `GroupBy` - [#​2101](https://togithub.com/Effect-TS/effect/pull/2101) [`14c5711`](https://togithub.com/Effect-TS/effect/commit/14c57110078f0862b8da5c7a2c5d980f54447484) Thanks [@​github-actions](https://togithub.com/apps/github-actions)! - Remove Effect.unified and Effect.unifiedFn in favour of Unify.unify. The `Unify` module fully replaces the need for specific unify functions, when before you did: ```ts import { Effect } from "effect"; const effect = Effect.unified( Math.random() > 0.5 ? Effect.succeed("OK") : Effect.fail("NO"), ); const effectFn = Effect.unifiedFn((n: number) => Math.random() > 0.5 ? Effect.succeed("OK") : Effect.fail("NO"), ); ``` You can now do: ```ts import { Effect, Unify } from "effect"; const effect = Unify.unify( Math.random() > 0.5 ? Effect.succeed("OK") : Effect.fail("NO"), ); const effectFn = Unify.unify((n: number) => Math.random() > 0.5 ? Effect.succeed("OK") : Effect.fail("NO"), ); ``` - [#​2101](https://togithub.com/Effect-TS/effect/pull/2101) [`5de7be5`](https://togithub.com/Effect-TS/effect/commit/5de7be5beca2e963b503e6029dcc3217848187d2) Thanks [@​github-actions](https://togithub.com/apps/github-actions)! - add key type to ReadonlyRecord - [#​2101](https://togithub.com/Effect-TS/effect/pull/2101) [`585fcce`](https://togithub.com/Effect-TS/effect/commit/585fcce162d0f07a48d7cd984a9b722966fbebbe) Thanks [@​github-actions](https://togithub.com/apps/github-actions)! - add support for optional property keys to `pick`, `omit` and `get` Before: ```ts import { pipe } from "effect/Function"; import * as S from "effect/Struct"; const struct: { a?: string; b: number; c: boolean; } = { b: 1, c: true }; // error const x = pipe(struct, S.pick("a", "b")); const record: Record = {}; const y = pipe(record, S.pick("a", "b")); console.log(y); // => { a: undefined, b: undefined } // error console.log(pipe(struct, S.get("a"))); ``` Now ```ts import { pipe } from "effect/Function"; import * as S from "effect/Struct"; const struct: { a?: string; b: number; c: boolean; } = { b: 1, c: true }; const x = pipe(struct, S.pick("a", "b")); console.log(x); // => { b: 1 } const record: Record = {}; const y = pipe(record, S.pick("a", "b")); console.log(y); // => {} console.log(pipe(struct, S.get("a"))); // => undefined ``` - [#​2101](https://togithub.com/Effect-TS/effect/pull/2101) [`a025b12`](https://togithub.com/Effect-TS/effect/commit/a025b121235ba01cfce8d62a775491880c575561) Thanks [@​github-actions](https://togithub.com/apps/github-actions)! - Swap type params of Either from `Either` to `Either`. Along the same line of the other changes this allows to shorten the most common types such as: ```ts import { Either } from "effect"; const right: Either.Either = Either.right("ok"); ``` ##### Patch Changes - [#​2193](https://togithub.com/Effect-TS/effect/pull/2193) [`b9cb3a9`](https://togithub.com/Effect-TS/effect/commit/b9cb3a9c9bfdd75536bd70b4e8b557c12d4923ff) Thanks [@​jessekelly881](https://togithub.com/jessekelly881)! - added Number.parse, BigInt.toNumber, ParseResult.fromOption - [#​2101](https://togithub.com/Effect-TS/effect/pull/2101) [`93b412d`](https://togithub.com/Effect-TS/effect/commit/93b412d4a9ed762dc9fa5807e51fad0fc78a614a) Thanks [@​github-actions](https://togithub.com/apps/github-actions)! - ReadonlyArray.groupBy: allow for grouping by symbols, closes [#​2180](https://togithub.com/Effect-TS/effect/issues/2180) - [#​2101](https://togithub.com/Effect-TS/effect/pull/2101) [`55b26a6`](https://togithub.com/Effect-TS/effect/commit/55b26a6342b4826f1116e7a1eb660118c274458e) Thanks [@​github-actions](https://togithub.com/apps/github-actions)! - Either: fix `fromOption` overloads order - [#​2101](https://togithub.com/Effect-TS/effect/pull/2101) [`2097739`](https://togithub.com/Effect-TS/effect/commit/20977393d2383bff709304e81ec7d51cafd57108) Thanks [@​github-actions](https://togithub.com/apps/github-actions)! - Add Do notation methods `Do`, `bindTo`, `bind` and `let` to Either ### [`v2.3.8`](https://togithub.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#238) [Compare Source](https://togithub.com/Effect-TS/effect/compare/effect@2.3.7...effect@2.3.8) ##### Patch Changes - [#​2167](https://togithub.com/Effect-TS/effect/pull/2167) [`5ad2eec`](https://togithub.com/Effect-TS/effect/commit/5ad2eece0280b6db6a749d25cac1dcf6d33659a9) Thanks [@​tim-smart](https://togithub.com/tim-smart)! - add Hash.cached This api assists with adding a layer of caching, when hashing immutable data structures. ```ts import { Data, Hash } from "effect"; class User extends Data.Class<{ id: number; name: string; }> { [Hash.symbol]() { return Hash.cached(this, Hash.string(`${this.id}-${this.name}`)); } } ``` - [#​2187](https://togithub.com/Effect-TS/effect/pull/2187) [`e6d36c0`](https://togithub.com/Effect-TS/effect/commit/e6d36c0813d836f17eabb6a9c7849baffca12dbf) Thanks [@​tim-smart](https://togithub.com/tim-smart)! - update development dependencies ### [`v2.3.7`](https://togithub.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#237) [Compare Source](https://togithub.com/Effect-TS/effect/compare/effect@2.3.6...effect@2.3.7) ##### Patch Changes - [#​2142](https://togithub.com/Effect-TS/effect/pull/2142) [`bc8404d`](https://togithub.com/Effect-TS/effect/commit/bc8404d54fd42072d200c0399cb39672837afa9f) Thanks [@​mikearnaldi](https://togithub.com/mikearnaldi)! - Expose version control via ModuleVersion. This enables low level framework authors to run their own effect version which won't conflict with any other effect versions running on the same process. Imagine cases where for example a function runtime is built on effect, we don't want lifecycle of the runtime to clash with lifecycle of user-land provided code. To manually control the module version one can use: ```ts import * as ModuleVersion from "effect/ModuleVersion"; ModuleVersion.setCurrentVersion( `my-effect-runtime-${ModuleVersion.getCurrentVersion()}`, ); ``` Note that this code performs side effects and should be executed before any module is imported ideally via an init script. The resulting order of execution has to be: ```ts import * as ModuleVersion from "effect/ModuleVersion"; ModuleVersion.setCurrentVersion( `my-effect-runtime-${ModuleVersion.getCurrentVersion()}`, ); import { Effect } from "effect"; // rest of code ``` - [#​2159](https://togithub.com/Effect-TS/effect/pull/2159) [`2c5cbcd`](https://togithub.com/Effect-TS/effect/commit/2c5cbcd1161b4f40dab184999291e817314107de) Thanks [@​IMax153](https://togithub.com/IMax153)! - Avoid incrementing cache hits for expired entries - [#​2165](https://togithub.com/Effect-TS/effect/pull/2165) [`6565916`](https://togithub.com/Effect-TS/effect/commit/6565916ef254bf910e47d25fd0ef55e7cb420241) Thanks [@​tim-smart](https://togithub.com/tim-smart)! - fix Hash implemention for Option.none ### [`v2.3.6`](https://togithub.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#236) [Compare Source](https://togithub.com/Effect-TS/effect/compare/effect@2.3.5...effect@2.3.6) ##### Patch Changes - [#​2145](https://togithub.com/Effect-TS/effect/pull/2145) [`b1163b2`](https://togithub.com/Effect-TS/effect/commit/b1163b2bd67b65bafbbb39fc4c67576e5cbaf444) Thanks [@​tim-smart](https://togithub.com/tim-smart)! - add RequestResolver.aroundRequests api This can be used to run side effects that introspect the requests being executed. Example: ```ts import { Effect, Request, RequestResolver } from "effect"; interface GetUserById extends Request.Request { readonly id: number; } declare const resolver: RequestResolver.RequestResolver; RequestResolver.aroundRequests( resolver, (requests) => Effect.log(`got ${requests.length} requests`), (requests, _) => Effect.log(`finised running ${requests.length} requests`), ); ``` - [#​2148](https://togithub.com/Effect-TS/effect/pull/2148) [`b46b869`](https://togithub.com/Effect-TS/effect/commit/b46b869e59a6da5aa235a9fcc25e1e0d24e9e8f8) Thanks [@​riordanpawley](https://togithub.com/riordanpawley)! - Flipped scheduleForked types to match new \ signature - [#​2139](https://togithub.com/Effect-TS/effect/pull/2139) [`de1b226`](https://togithub.com/Effect-TS/effect/commit/de1b226282b5ab6c2809dd93f3bdb066f24a1333) Thanks [@​mikearnaldi](https://togithub.com/mikearnaldi)! - Introduce FiberId.Single, make FiberId.None behave like FiberId.Runtime, relax FiberRefs to use Single instead of Runtime. This change is a precursor to enable easier APIs to modify the Runtime when patching FiberRefs. - [#​2137](https://togithub.com/Effect-TS/effect/pull/2137) [`a663390`](https://togithub.com/Effect-TS/effect/commit/a66339090ae7b960f8a8b90a0dcdc505de5aaf3e) Thanks [@​mikearnaldi](https://togithub.com/mikearnaldi)! - Expose Random Tag and functions to use a specific random service implementation - [#​2143](https://togithub.com/Effect-TS/effect/pull/2143) [`ff88f80`](https://togithub.com/Effect-TS/effect/commit/ff88f808c4ed9947a148045849e7410b00acad0a) Thanks [@​mikearnaldi](https://togithub.com/mikearnaldi)! - Fix Cause.pretty when toString is invalid ```ts import { Cause } from "effect"; console.log(Cause.pretty(Cause.fail([{ toString: "" }]))); ``` The code above used to throw now it prints: ```bash Error: [{"toString":""}] ``` - [#​2080](https://togithub.com/Effect-TS/effect/pull/2080) [`11be07b`](https://togithub.com/Effect-TS/effect/commit/11be07bf65d82cfdf994cdb9d8ca937f995cb4f0) Thanks [@​KhraksMamtsov](https://togithub.com/KhraksMamtsov)! - Add functional analogue of `satisfies` operator. This is a convenient operator to use in the `pipe` chain to localize type errors closer to their source. ```ts import { satisfies } from "effect/Function"; const test1 = satisfies()(5 as const); // ^? const test: 5 // @​ts-expect-error const test2 = satisfies()(5); // ^? Argument of type 'number' is not assignable to parameter of type 'string' ``` - [#​2147](https://togithub.com/Effect-TS/effect/pull/2147) [`c568645`](https://togithub.com/Effect-TS/effect/commit/c5686451c87d26382135a1c63b00ef171bb24f62) Thanks [@​tim-smart](https://togithub.com/tim-smart)! - generate a random span id for the built-in tracer This ensures the same span id isn't used between application runs. - [#​2144](https://togithub.com/Effect-TS/effect/pull/2144) [`88835e5`](https://togithub.com/Effect-TS/effect/commit/88835e575a0bfbeff9a3696a332f32192c940e12) Thanks [@​mikearnaldi](https://togithub.com/mikearnaldi)! - Fix withRandom and withClock types - [#​2138](https://togithub.com/Effect-TS/effect/pull/2138) [`b415577`](https://togithub.com/Effect-TS/effect/commit/b415577f6c576073733929c858e5aac27b6d5880) Thanks [@​mikearnaldi](https://togithub.com/mikearnaldi)! - Fix internals of TestAnnotationsMap making it respect equality - [#​2149](https://togithub.com/Effect-TS/effect/pull/2149) [`ff8046f`](https://togithub.com/Effect-TS/effect/commit/ff8046f57dfd073eba60ce6d3144ab060fbf93ce) Thanks [@​tim-smart](https://togithub.com/tim-smart)! - add Runtime.updateFiberRefs/setFiberRef/deleteFiberRef This change allows you to update fiber ref values inside a Runtime object. Example: ```ts import { Effect, FiberRef, Runtime } from "effect"; const ref = FiberRef.unsafeMake(0); const updatedRuntime = Runtime.defaultRuntime.pipe( Runtime.setFiberRef(ref, 1), ); // returns 1 const result = Runtime.runSync(updatedRuntime)(FiberRef.get(ref)); ``` ### [`v2.3.5`](https://togithub.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#235) [Compare Source](https://togithub.com/Effect-TS/effect/compare/effect@2.3.4...effect@2.3.5) ##### Patch Changes - [#​2114](https://togithub.com/Effect-TS/effect/pull/2114) [`b881365`](https://togithub.com/Effect-TS/effect/commit/b8813650355322ea2fc1fbaa4f846bd87a7a05f3) Thanks [@​IMax153](https://togithub.com/IMax153)! - Fix the ordering of results returned from batched requests ### [`v2.3.4`](https://togithub.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#234) [Compare Source](https://togithub.com/Effect-TS/effect/compare/effect@2.3.3...effect@2.3.4) ##### Patch Changes - [#​2107](https://togithub.com/Effect-TS/effect/pull/2107) [`17bda66`](https://togithub.com/Effect-TS/effect/commit/17bda66431c999a546920c10adb205e6c8bea7d1) Thanks [@​tim-smart](https://togithub.com/tim-smart)! - ensure large semaphore takes don't block smaller takes ### [`v2.3.3`](https://togithub.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#233) [Compare Source](https://togithub.com/Effect-TS/effect/compare/effect@2.3.2...effect@2.3.3) ##### Patch Changes - [#​2090](https://togithub.com/Effect-TS/effect/pull/2090) [`efd41d8`](https://togithub.com/Effect-TS/effect/commit/efd41d8131c3d90867608969ef7c4eef490eb5e6) Thanks [@​hsubra89](https://togithub.com/hsubra89)! - Update `RateLimiter` to support passing in a custom `cost` per effect. This is really useful for API(s) that have a "credit cost" per endpoint. Usage Example : ```ts import { Effect, RateLimiter } from "effect"; import { compose } from "effect/Function"; const program = Effect.scoped( Effect.gen(function* ($) { // Create a rate limiter that has an hourly limit of 1000 credits const rateLimiter = yield* $(RateLimiter.make(1000, "1 hours")); // Query API costs 1 credit per call ( 1 is the default cost ) const queryAPIRL = compose(rateLimiter, RateLimiter.withCost(1)); // Mutation API costs 5 credits per call const mutationAPIRL = compose(rateLimiter, RateLimiter.withCost(5)); // ... // Use the pre-defined rate limiters yield* $(queryAPIRL(Effect.log("Sample Query"))); yield* $(mutationAPIRL(Effect.log("Sample Mutation"))); // Or set a cost on-the-fly yield* $( rateLimiter(Effect.log("Another query with a different cost")).pipe( RateLimiter.withCost(3), ), ); }), ); ``` - [#​2097](https://togithub.com/Effect-TS/effect/pull/2097) [`0f83515`](https://togithub.com/Effect-TS/effect/commit/0f83515a9c01d13c7c15a3f026e02d22c3c6bb7f) Thanks [@​IMax153](https://togithub.com/IMax153)! - Updates the `RateLimiter.make` constructor to take an object of `RateLimiter.Options`, which allows for specifying the rate-limiting algorithm to utilize: You can choose from either the `token-bucket` or the `fixed-window` algorithms for rate-limiting. ```ts export declare namespace RateLimiter { export interface Options { /** * The maximum number of requests that should be allowed. */ readonly limit: number; /** * The interval to utilize for rate-limiting requests. The semantics of the * specified `interval` vary depending on the chosen `algorithm`: * * `token-bucket`: The maximum number of requests will be spread out over * the provided interval if no tokens are available. * * For example, for a `RateLimiter` using the `token-bucket` algorithm with * a `limit` of `10` and an `interval` of `1 seconds`, `1` request can be * made every `100 millis`. * * `fixed-window`: The maximum number of requests will be reset during each * interval. For example, for a `RateLimiter` using the `fixed-window` * algorithm with a `limit` of `10` and an `interval` of `1 seconds`, a * maximum of `10` requests can be made each second. */ readonly interval: DurationInput; /** * The algorithm to utilize for rate-limiting requests. * * Defaults to `token-bucket`. */ readonly algorithm?: "fixed-window" | "token-bucket"; } } ``` - [#​2097](https://togithub.com/Effect-TS/effect/pull/2097) [`0f83515`](https://togithub.com/Effect-TS/effect/commit/0f83515a9c01d13c7c15a3f026e02d22c3c6bb7f) Thanks [@​IMax153](https://togithub.com/IMax153)! - return the resulting available permits from Semaphore.release ### [`v2.3.2`](https://togithub.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#232) [Compare Source](https://togithub.com/Effect-TS/effect/compare/effect@2.3.1...effect@2.3.2) ##### Patch Changes - [#​2096](https://togithub.com/Effect-TS/effect/pull/2096) [`6654f5f`](https://togithub.com/Effect-TS/effect/commit/6654f5f0f6b9d97165ede5e04ca16776e2599328) Thanks [@​tim-smart](https://togithub.com/tim-smart)! - default to `never` for Runtime returning functions This includes: - Effect.runtime - FiberSet.makeRuntime It prevents `unknown` from creeping into types, as well as `never` being a useful default type for propogating Fiber Refs and other context. - [#​2094](https://togithub.com/Effect-TS/effect/pull/2094) [`2eb11b4`](https://togithub.com/Effect-TS/effect/commit/2eb11b47752cedf233ef4c4395d9c4efc9b9e180) Thanks [@​tim-smart](https://togithub.com/tim-smart)! - revert some type param adjustments in FiberSet `makeRuntime` now has the R parameter first again. Default to `unknown` for the A and E parameters instead of never. - [#​2103](https://togithub.com/Effect-TS/effect/pull/2103) [`56c09bd`](https://togithub.com/Effect-TS/effect/commit/56c09bd369279a6a7785209d172739935818cba6) Thanks [@​patroza](https://togithub.com/patroza)! - Expand Either and Option `andThen` to support the `map` case like Effects' `andThen` For example: ```ts expect(pipe(Either.right(1), Either.andThen(2))).toStrictEqual( Either.right(2), ); expect( pipe( Either.right(1), Either.andThen(() => 2), ), ).toStrictEqual(Either.right(2)); expect(pipe(Option.some(1), Option.andThen(2))).toStrictEqual(Option.some(2)); expect( pipe( Option.some(1), Option.andThen(() => 2), ), ).toStrictEqual(Option.some(2)); ``` - [#​2098](https://togithub.com/Effect-TS/effect/pull/2098) [`71aa5b1`](https://togithub.com/Effect-TS/effect/commit/71aa5b1c180dcb8b53aefe232d12a97bd06b5447) Thanks [@​ethanniser](https://togithub.com/ethanniser)! - removed `./internal/timeout` and replaced all usages with `setTimeout` directly previously it was required to abstract away conditionally solving an bun had an issue with `setTimeout`, that caused incorrect behavior that bug has since been fixed, and the `isBun` check is no longer needed as such the timeout module is also no longer needed - [#​2099](https://togithub.com/Effect-TS/effect/pull/2099) [`1700af8`](https://togithub.com/Effect-TS/effect/commit/1700af8af1131602887da721914c8562b6342393) Thanks [@​tim-smart](https://togithub.com/tim-smart)! - optimize Effect.zip{Left,Right} for the sequential case, avoid using Effect.all internally ### [`v2.3.1`](https://togithub.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#231) [Compare Source](https://togithub.com/Effect-TS/effect/compare/effect@2.3.0...effect@2.3.1) ##### Patch Changes - [#​2085](https://togithub.com/Effect-TS/effect/pull/2085) [`b5a8215`](https://togithub.com/Effect-TS/effect/commit/b5a8215ee2a97a8865d69ee55ce1b9835948c922) Thanks [@​gcanti](https://togithub.com/gcanti)! - Fix Schedule typings (some APIs didn't have Effect parameters swapped). ### [`v2.3.0`](https://togithub.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#230) [Compare Source](https://togithub.com/Effect-TS/effect/compare/effect@2.2.5...effect@2.3.0) ##### Minor Changes - [#​2006](https://togithub.com/Effect-TS/effect/pull/2006) [`96bcee2`](https://togithub.com/Effect-TS/effect/commit/96bcee21021aecd8ffd86440a2c9be353c4668e3) Thanks [@​github-actions](https://togithub.com/apps/github-actions)! - change `Runtime.AsyncFiberException` type parameters order from `AsyncFiberException` to `AsyncFiberException` - [#​2006](https://togithub.com/Effect-TS/effect/pull/2006) [`96bcee2`](https://togithub.com/Effect-TS/effect/commit/96bcee21021aecd8ffd86440a2c9be353c4668e3) Thanks [@​github-actions](https://togithub.com/apps/github-actions)! - change `Runtime.Cancel` type parameters order from `Cancel` to `Cancel` - [#​2006](https://togithub.com/Effect-TS/effect/pull/2006) [`c77f635`](https://togithub.com/Effect-TS/effect/commit/c77f635f8a26ca6d83cb569d911f

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • [ ] If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.