jasonkuhrt / molt

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

fix: update dependency effect to v3 #275

Open renovate[bot] opened 5 months ago

renovate[bot] commented 5 months ago

This PR contains the following updates:

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

Release Notes

Effect-TS/effect (effect) ### [`v3.8.4`](https://redirect.github.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#384) [Compare Source](https://redirect.github.com/Effect-TS/effect/compare/effect@3.8.3...effect@3.8.4) ##### Patch Changes - [#​3661](https://redirect.github.com/Effect-TS/effect/pull/3661) [`4509656`](https://redirect.github.com/Effect-TS/effect/commit/45096569d50262275ee984f44c456f5c83b62683) Thanks [@​KhraksMamtsov](https://redirect.github.com/KhraksMamtsov)! - `Micro.EnvRef` and `Micro.Handle` is subtype of `Micro` ### [`v3.8.3`](https://redirect.github.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#383) [Compare Source](https://redirect.github.com/Effect-TS/effect/compare/effect@3.8.2...effect@3.8.3) ##### Patch Changes - [#​3644](https://redirect.github.com/Effect-TS/effect/pull/3644) [`bb5ec6b`](https://redirect.github.com/Effect-TS/effect/commit/bb5ec6b4b6a6f537394596c5a596faf52cb2aef4) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - fix encoding of logs to tracer span events ### [`v3.8.2`](https://redirect.github.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#382) [Compare Source](https://redirect.github.com/Effect-TS/effect/compare/effect@3.8.1...effect@3.8.2) ##### Patch Changes - [#​3627](https://redirect.github.com/Effect-TS/effect/pull/3627) [`f0d8ef1`](https://redirect.github.com/Effect-TS/effect/commit/f0d8ef1ce97ec2a87b09b3e24150cfeab85d6e2f) Thanks [@​fubhy](https://redirect.github.com/fubhy)! - Revert cron schedule regression ### [`v3.8.1`](https://redirect.github.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#381) [Compare Source](https://redirect.github.com/Effect-TS/effect/compare/effect@3.8.0...effect@3.8.1) ##### Patch Changes - [#​3624](https://redirect.github.com/Effect-TS/effect/pull/3624) [`10bf621`](https://redirect.github.com/Effect-TS/effect/commit/10bf6213f36d8ddb00f058a4609b85220f3d8334) Thanks [@​fubhy](https://redirect.github.com/fubhy)! - Fixed double firing of cron schedules in cases where the current time matched the initial interval. - [#​3623](https://redirect.github.com/Effect-TS/effect/pull/3623) [`ae36fa6`](https://redirect.github.com/Effect-TS/effect/commit/ae36fa68f754eeab9a54b6dc0f8b44db513aa2b6) Thanks [@​fubhy](https://redirect.github.com/fubhy)! - Allow CRLF characters in base64 encoded strings. ### [`v3.8.0`](https://redirect.github.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#380) [Compare Source](https://redirect.github.com/Effect-TS/effect/compare/effect@3.7.3...effect@3.8.0) ##### Minor Changes - [#​3541](https://redirect.github.com/Effect-TS/effect/pull/3541) [`fcfa6ee`](https://redirect.github.com/Effect-TS/effect/commit/fcfa6ee30ffd07d998bf22799357bf58580a116f) Thanks [@​Schniz](https://redirect.github.com/Schniz)! - add `Logger.withLeveledConsole` In browsers and different platforms, `console.error` renders differently than `console.info`. This helps to distinguish between different levels of logging. `Logger.withLeveledConsole` takes any logger and calls the respective `Console` method based on the log level. For instance, `Effect.logError` will call `Console.error` and `Effect.logInfo` will call `Console.info`. To use it, you can replace the default logger with a `Logger.withLeveledConsole` logger: ```ts import { Logger, Effect } from "effect" const loggerLayer = Logger.withLeveledConsole(Logger.stringLogger) Effect.gen(function* () { yield* Effect.logError("an error") yield* Effect.logInfo("an info") }).pipe(Effect.provide(loggerLayer)) ``` - [#​3541](https://redirect.github.com/Effect-TS/effect/pull/3541) [`bb9931b`](https://redirect.github.com/Effect-TS/effect/commit/bb9931b62e249a3b801f2cb9d097aec0c8511af7) Thanks [@​KhraksMamtsov](https://redirect.github.com/KhraksMamtsov)! - Made `Ref`, `SynchronizedRed` and `SubscriptionRef` a subtype of `Effect` - [#​3541](https://redirect.github.com/Effect-TS/effect/pull/3541) [`5798f76`](https://redirect.github.com/Effect-TS/effect/commit/5798f7619529de33e5ba06f551806f68fedc19db) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - add Semaphore.withPermitsIfAvailable You can now use `Semaphore.withPermitsIfAvailable` to run an Effect only if the Semaphore has enough permits available. This is useful when you want to run an Effect only if you can acquire a permit without blocking. It will return an `Option.Some` with the result of the Effect if the permits were available, or `None` if they were not. ```ts import { Effect } from "effect" Effect.gen(function* () { const semaphore = yield* Effect.makeSemaphore(1) semaphore.withPermitsIfAvailable(1)(Effect.void) }) ``` - [#​3541](https://redirect.github.com/Effect-TS/effect/pull/3541) [`5f0bfa1`](https://redirect.github.com/Effect-TS/effect/commit/5f0bfa17205398d4e4818bfbcf9e1b505b3b1fc5) Thanks [@​KhraksMamtsov](https://redirect.github.com/KhraksMamtsov)! - The `Deferred` is now a subtype of `Effect`. This change simplifies handling of deferred values, removing the need for explicit call `Deffer.await`. ```typescript import { Effect, Deferred } from "effect" Effect.gen(function* () { const deferred = yield* Deferred.make() const before = yield* Deferred.await(deferred) const after = yield* deferred }) ``` - [#​3541](https://redirect.github.com/Effect-TS/effect/pull/3541) [`812a4e8`](https://redirect.github.com/Effect-TS/effect/commit/812a4e86e2d1aa23b477ef5829aa0e5c07784936) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - add Logger.prettyLoggerDefault, to prevent duplicate pretty loggers - [#​3541](https://redirect.github.com/Effect-TS/effect/pull/3541) [`273565e`](https://redirect.github.com/Effect-TS/effect/commit/273565e7901639e8d0541930ab715aea9c80fbaa) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - add Effect.makeLatch, for creating a simple async latch ```ts import { Effect } from "effect" Effect.gen(function* () { // Create a latch, starting in the closed state const latch = yield* Effect.makeLatch(false) // Fork a fiber that logs "open sesame" when the latch is opened const fiber = yield* Effect.log("open sesame").pipe( latch.whenOpen, Effect.fork ) // Open the latch yield* latch.open yield* fiber.await }) ``` - [#​3541](https://redirect.github.com/Effect-TS/effect/pull/3541) [`569a801`](https://redirect.github.com/Effect-TS/effect/commit/569a8017ef0a0bc203e4312867cbdd37b0effbd7) Thanks [@​KhraksMamtsov](https://redirect.github.com/KhraksMamtsov)! - `Dequeue` and `Queue` is subtype of `Effect`. This means that now it can be used as an `Effect`, and when called, it will automatically extract and return an item from the queue, without having to explicitly use the `Queue.take` function. ```ts Effect.gen(function* () { const queue = yield* Queue.unbounded() yield* Queue.offer(queue, 1) yield* Queue.offer(queue, 2) const oldWay = yield* Queue.take(queue) const newWay = yield* queue }) ``` - [#​3541](https://redirect.github.com/Effect-TS/effect/pull/3541) [`aa1fa53`](https://redirect.github.com/Effect-TS/effect/commit/aa1fa5301e886b9657c8eb0d38cb87cef92a8305) Thanks [@​vinassefranche](https://redirect.github.com/vinassefranche)! - Add Number.round - [#​3541](https://redirect.github.com/Effect-TS/effect/pull/3541) [`02f6b06`](https://redirect.github.com/Effect-TS/effect/commit/02f6b0660e12bee1069532a9cc18d3ab855257be) Thanks [@​fubhy](https://redirect.github.com/fubhy)! - Add additional `Duration` conversion apis - `Duration.toMinutes` - `Duration.toHours` - `Duration.toDays` - `Duration.toWeeks` - [#​3541](https://redirect.github.com/Effect-TS/effect/pull/3541) [`12b893e`](https://redirect.github.com/Effect-TS/effect/commit/12b893e63cc6dfada4aca7773b4783940e2edf25) Thanks [@​KhraksMamtsov](https://redirect.github.com/KhraksMamtsov)! - The `Fiber` is now a subtype of `Effect`. This change removes the need for explicit call `Fiber.join`. ```typescript import { Effect, Fiber } from "effect" Effect.gen(function*() { const fiber = yield* Effect.fork(Effect.succeed(1)) const oldWay = yield* Fiber.join(fiber) const now = yield* fiber })) ``` - [#​3541](https://redirect.github.com/Effect-TS/effect/pull/3541) [`bbad27e`](https://redirect.github.com/Effect-TS/effect/commit/bbad27ec0a90860593f759405caa877e7f4a655f) Thanks [@​dilame](https://redirect.github.com/dilame)! - add `Stream.share` api The `Stream.share` api is a ref counted variant of the broadcast apis. It allows you to share a stream between multiple consumers, and will close the upstream when the last consumer ends. - [#​3541](https://redirect.github.com/Effect-TS/effect/pull/3541) [`adf7d7a`](https://redirect.github.com/Effect-TS/effect/commit/adf7d7a7dfce3a7021e9f3b0d847dc85be89d754) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - add Mailbox module, a queue which can have done or failure signals ```ts import { Chunk, Effect, Mailbox } from "effect" import * as assert from "node:assert" Effect.gen(function* () { const mailbox = yield* Mailbox.make() // add messages to the mailbox yield* mailbox.offer(1) yield* mailbox.offer(2) yield* mailbox.offerAll([3, 4, 5]) // take messages from the mailbox const [messages, done] = yield* mailbox.takeAll assert.deepStrictEqual(Chunk.toReadonlyArray(messages), [1, 2, 3, 4, 5]) assert.strictEqual(done, false) // signal that the mailbox is done yield* mailbox.end const [messages2, done2] = yield* mailbox.takeAll assert.deepStrictEqual(messages2, Chunk.empty()) assert.strictEqual(done2, true) // signal that the mailbox is failed yield* mailbox.fail("boom") }) ``` - [#​3541](https://redirect.github.com/Effect-TS/effect/pull/3541) [`007289a`](https://redirect.github.com/Effect-TS/effect/commit/007289a52d5877f8e90e2dacf38171ff9bf603fd) Thanks [@​mikearnaldi](https://redirect.github.com/mikearnaldi)! - Cache some fiber references in the runtime to optimize reading in hot-paths - [#​3541](https://redirect.github.com/Effect-TS/effect/pull/3541) [`42a8f99`](https://redirect.github.com/Effect-TS/effect/commit/42a8f99740eefdaf2c4544d2c345313f97547a36) Thanks [@​fubhy](https://redirect.github.com/fubhy)! - Added `RcMap.keys` and `MutableHashMap.keys`. These functions allow you to get a list of keys currently stored in the underlying hash map. ```ts const map = MutableHashMap.make([ ["a", "a"], ["b", "b"], ["c", "c"] ]) const keys = MutableHashMap.keys(map) // ["a", "b", "c"] ``` ```ts Effect.gen(function* () { const map = yield* RcMap.make({ lookup: (key) => Effect.succeed(key) }) yield* RcMap.get(map, "a") yield* RcMap.get(map, "b") yield* RcMap.get(map, "c") const keys = yield* RcMap.keys(map) // ["a", "b", "c"] }) ``` - [#​3541](https://redirect.github.com/Effect-TS/effect/pull/3541) [`eebfd29`](https://redirect.github.com/Effect-TS/effect/commit/eebfd29633fd5d38b505c5c0842036f61f05e913) Thanks [@​fubhy](https://redirect.github.com/fubhy)! - Add `Duration.parts` api ```ts const parts = Duration.parts(Duration.sum("5 minutes", "20 seconds")) assert.equal(parts.minutes, 5) assert.equal(parts.seconds, 20) ``` - [#​3541](https://redirect.github.com/Effect-TS/effect/pull/3541) [`040703d`](https://redirect.github.com/Effect-TS/effect/commit/040703d0e100cd5511e52d812c15492414262b5e) Thanks [@​KhraksMamtsov](https://redirect.github.com/KhraksMamtsov)! - The `FiberRef` is now a subtype of `Effect`. This change simplifies handling of deferred values, removing the need for explicit call `FiberRef.get`. ```typescript import { Effect, FiberRef } from "effect" Effect.gen(function* () { const fiberRef = yield* FiberRef.make("value") const before = yield* FiberRef.get(fiberRef) const after = yield* fiberRef }) ``` ### [`v3.7.3`](https://redirect.github.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#373) [Compare Source](https://redirect.github.com/Effect-TS/effect/compare/effect@3.7.2...effect@3.7.3) ##### Patch Changes - [#​3592](https://redirect.github.com/Effect-TS/effect/pull/3592) [`35a0f81`](https://redirect.github.com/Effect-TS/effect/commit/35a0f813141652d696461cd5d19fd146adaf85be) Thanks [@​mikearnaldi](https://redirect.github.com/mikearnaldi)! - TestClock yield with setTimeout(0) ### [`v3.7.2`](https://redirect.github.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#372) [Compare Source](https://redirect.github.com/Effect-TS/effect/compare/effect@3.7.1...effect@3.7.2) ##### Patch Changes - [#​3548](https://redirect.github.com/Effect-TS/effect/pull/3548) [`8a601d7`](https://redirect.github.com/Effect-TS/effect/commit/8a601d7a1f8ffe52ac9e6d67e9282a1495fe59c9) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - remove console.log statements from Micro - [#​3546](https://redirect.github.com/Effect-TS/effect/pull/3546) [`353ba19`](https://redirect.github.com/Effect-TS/effect/commit/353ba19f9b2b9e959f0a00d058c6d40a4bc02db7) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - fix exported Stream types for `broadcast*` and `toPubSub` ### [`v3.7.1`](https://redirect.github.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#371) [Compare Source](https://redirect.github.com/Effect-TS/effect/compare/effect@3.7.0...effect@3.7.1) ##### Patch Changes - [#​3536](https://redirect.github.com/Effect-TS/effect/pull/3536) [`79859e7`](https://redirect.github.com/Effect-TS/effect/commit/79859e71040d8edf1868b8530b90c650f4321eff) Thanks [@​mikearnaldi](https://redirect.github.com/mikearnaldi)! - Optimize Array.sortWith to avoid calling the map function excesively - [#​3516](https://redirect.github.com/Effect-TS/effect/pull/3516) [`f6a469c`](https://redirect.github.com/Effect-TS/effect/commit/f6a469c190b9f00eee5ea0cd4d5912a0ef8b46f5) Thanks [@​KhraksMamtsov](https://redirect.github.com/KhraksMamtsov)! - support tacit usage for `Effect.tapErrorTag` and `Effect.catchTag` - [#​3543](https://redirect.github.com/Effect-TS/effect/pull/3543) [`dcb9ec0`](https://redirect.github.com/Effect-TS/effect/commit/dcb9ec0db443894dd204d87450f779c44b9ad7f1) Thanks [@​datner](https://redirect.github.com/datner)! - Align behavior of `Stream.empty` to act like `Stream.make()` to fix behavior with `NodeStream.toReadable` - [#​3545](https://redirect.github.com/Effect-TS/effect/pull/3545) [`79aa6b1`](https://redirect.github.com/Effect-TS/effect/commit/79aa6b136e1f29b36f34e88cb2ff162bff2bb4ed) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - fix Micro.forEach for empty iterables ### [`v3.7.0`](https://redirect.github.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#370) [Compare Source](https://redirect.github.com/Effect-TS/effect/compare/effect@3.6.8...effect@3.7.0) ##### Minor Changes - [#​3410](https://redirect.github.com/Effect-TS/effect/pull/3410) [`2f456cc`](https://redirect.github.com/Effect-TS/effect/commit/2f456cce5012b9fcb6b4e039190d527813b75b92) Thanks [@​vinassefranche](https://redirect.github.com/vinassefranche)! - preserve `Array.modify` `Array.modifyOption` non emptiness - [#​3410](https://redirect.github.com/Effect-TS/effect/pull/3410) [`8745e41`](https://redirect.github.com/Effect-TS/effect/commit/8745e41ed96e3765dc6048efc2a9afbe05c8a1e9) Thanks [@​patroza](https://redirect.github.com/patroza)! - improve: type Fiber.awaitAll as Exit\\[]. - [#​3410](https://redirect.github.com/Effect-TS/effect/pull/3410) [`e557838`](https://redirect.github.com/Effect-TS/effect/commit/e55783886b046d3c5f33447f455f9ccf2fa75922) Thanks [@​titouancreach](https://redirect.github.com/titouancreach)! - New constructor Config.nonEmptyString - [#​3410](https://redirect.github.com/Effect-TS/effect/pull/3410) [`d6e7e40`](https://redirect.github.com/Effect-TS/effect/commit/d6e7e40b1e2ad0c59aa02f07344d28601b14ebdc) Thanks [@​KhraksMamtsov](https://redirect.github.com/KhraksMamtsov)! - preserve `Array.replace` `Array.replaceOption` non emptiness - [#​3410](https://redirect.github.com/Effect-TS/effect/pull/3410) [`8356321`](https://redirect.github.com/Effect-TS/effect/commit/8356321598da04bd77c1001f45a4e447bec5591d) Thanks [@​KhraksMamtsov](https://redirect.github.com/KhraksMamtsov)! - add `Effect.bindAll` api This api allows you to combine `Effect.all` with `Effect.bind`. It is useful when you want to concurrently run multiple effects and then combine their results in a Do notation pipeline. ```ts import { Effect } from "effect" const result = Effect.Do.pipe( Effect.bind("x", () => Effect.succeed(2)), Effect.bindAll( ({ x }) => ({ a: Effect.succeed(x + 1), b: Effect.succeed("foo") }), { concurrency: 2 } ) ) assert.deepStrictEqual(Effect.runSync(result), { x: 2, a: 3, b: "foo" }) ``` - [#​3410](https://redirect.github.com/Effect-TS/effect/pull/3410) [`192f2eb`](https://redirect.github.com/Effect-TS/effect/commit/192f2ebb2c4ddbf4bfd8baedd32140b2376868f4) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - add `propagateInterruption` option to Fiber{Handle,Set,Map} This option will send any external interrupts to the .join result. - [#​3410](https://redirect.github.com/Effect-TS/effect/pull/3410) [`718cb70`](https://redirect.github.com/Effect-TS/effect/commit/718cb70038629a6d58d02e407760e341f7c94474) Thanks [@​dilame](https://redirect.github.com/dilame)! - feat(Stream): implement `race` operator, which accepts two upstreams and returns a stream that mirrors the first upstream to emit an item and interrupts the other upstream. ```ts import { Stream, Schedule, Console, Effect } from "effect" const stream = Stream.fromSchedule(Schedule.spaced("2 millis")).pipe( Stream.race(Stream.fromSchedule(Schedule.spaced("1 millis"))), Stream.take(6), Stream.tap((n) => Console.log(n)) ) Effect.runPromise(Stream.runDrain(stream)) // Output each millisecond from the first stream, the rest streams are interrupted // 0 // 1 // 2 // 3 // 4 // 5 ``` - [#​3410](https://redirect.github.com/Effect-TS/effect/pull/3410) [`e9d0310`](https://redirect.github.com/Effect-TS/effect/commit/e9d03107acbf204d9304f3e8aea0816b7d3c7dfb) Thanks [@​mikearnaldi](https://redirect.github.com/mikearnaldi)! - Avoid automatic propagation of finalizer concurrency, closes [#​3440](https://redirect.github.com/Effect-TS/effect/issues/3440) - [#​3410](https://redirect.github.com/Effect-TS/effect/pull/3410) [`6bf28f7`](https://redirect.github.com/Effect-TS/effect/commit/6bf28f7e3b1e5e0608ff567205fea0581d11666f) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - add Context.getOrElse api, for gettings a Tag's value with a fallback ##### Patch Changes - [#​3410](https://redirect.github.com/Effect-TS/effect/pull/3410) [`db89601`](https://redirect.github.com/Effect-TS/effect/commit/db89601ee9c1050c4e762b7bd7ec65a6a2799dfe) Thanks [@​juliusmarminge](https://redirect.github.com/juliusmarminge)! - add `Micro.isMicroCause` guard ### [`v3.6.8`](https://redirect.github.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#368) [Compare Source](https://redirect.github.com/Effect-TS/effect/compare/effect@3.6.7...effect@3.6.8) ##### Patch Changes - [#​3510](https://redirect.github.com/Effect-TS/effect/pull/3510) [`e809286`](https://redirect.github.com/Effect-TS/effect/commit/e8092865900608c4df7a6b7991b1c13cc1e4ca2d) Thanks [@​fubhy](https://redirect.github.com/fubhy)! - Detect environment in Logger.pretty using process.stdout ### [`v3.6.7`](https://redirect.github.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#367) [Compare Source](https://redirect.github.com/Effect-TS/effect/compare/effect@3.6.6...effect@3.6.7) ##### Patch Changes - [#​3504](https://redirect.github.com/Effect-TS/effect/pull/3504) [`50ec889`](https://redirect.github.com/Effect-TS/effect/commit/50ec8897a49b7d1fe84f63107f89d543c52f3dfc) Thanks [@​datner](https://redirect.github.com/datner)! - improve the performance of Effect.partitionMap ### [`v3.6.6`](https://redirect.github.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#366) [Compare Source](https://redirect.github.com/Effect-TS/effect/compare/effect@3.6.5...effect@3.6.6) ##### Patch Changes - [#​3306](https://redirect.github.com/Effect-TS/effect/pull/3306) [`f960bf4`](https://redirect.github.com/Effect-TS/effect/commit/f960bf45239e9badac6e0ad3a602f4174cd7bbdf) Thanks [@​dilame](https://redirect.github.com/dilame)! - Introduce left / right naming for Stream apis - [#​3499](https://redirect.github.com/Effect-TS/effect/pull/3499) [`46a575f`](https://redirect.github.com/Effect-TS/effect/commit/46a575f48a05457b782fb21f7827d338c9b59320) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - fix nested Config.array, by ensuring path patches aren't applied twice in sequences ### [`v3.6.5`](https://redirect.github.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#365) [Compare Source](https://redirect.github.com/Effect-TS/effect/compare/effect@3.6.4...effect@3.6.5) ##### Patch Changes - [#​3474](https://redirect.github.com/Effect-TS/effect/pull/3474) [`14a47a8`](https://redirect.github.com/Effect-TS/effect/commit/14a47a8c1f3cff2186b8fe7a919a1d773888fb5b) Thanks [@​IMax153](https://redirect.github.com/IMax153)! - Add support for incrementing and decrementing a gauge based on its prior value - [#​3490](https://redirect.github.com/Effect-TS/effect/pull/3490) [`0c09841`](https://redirect.github.com/Effect-TS/effect/commit/0c0984173be3d58f050b300a1a8aa89d76ba49ae) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - fix type error when .pipe() has no arguments ### [`v3.6.4`](https://redirect.github.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#364) [Compare Source](https://redirect.github.com/Effect-TS/effect/compare/effect@3.6.3...effect@3.6.4) ##### Patch Changes - [#​3404](https://redirect.github.com/Effect-TS/effect/pull/3404) [`8295281`](https://redirect.github.com/Effect-TS/effect/commit/8295281ae9bd7441e680402540bf3c8682ec417b) Thanks [@​KhraksMamtsov](https://redirect.github.com/KhraksMamtsov)! - Fix `Cache<_, Value, _>` type parameter variance (covariant -> invariant) - [#​3452](https://redirect.github.com/Effect-TS/effect/pull/3452) [`c940df6`](https://redirect.github.com/Effect-TS/effect/commit/c940df63800bf3c4396d91cf28ec34938642fd2c) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - ensure Scheduler tasks are added to a matching priority bucket - [#​3459](https://redirect.github.com/Effect-TS/effect/pull/3459) [`00b6c6d`](https://redirect.github.com/Effect-TS/effect/commit/00b6c6d4001f5de728b7d990a1b14560b4961a63) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - ensure defects are caught in Effect.tryPromise - [#​3458](https://redirect.github.com/Effect-TS/effect/pull/3458) [`f8d95a6`](https://redirect.github.com/Effect-TS/effect/commit/f8d95a61ad0762147933c5c32bb6d7237e18eef4) Thanks [@​thomasvargiu](https://redirect.github.com/thomasvargiu)! - fix `DateTime.makeZonedFromString` for 0 offset ### [`v3.6.3`](https://redirect.github.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#363) [Compare Source](https://redirect.github.com/Effect-TS/effect/compare/effect@3.6.2...effect@3.6.3) ##### Patch Changes - [#​3444](https://redirect.github.com/Effect-TS/effect/pull/3444) [`04adcac`](https://redirect.github.com/Effect-TS/effect/commit/04adcace913e6fc483df266874a68005e9e04ccf) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - ensure Stream.toReadableStream pulls always result in a enqueue ### [`v3.6.2`](https://redirect.github.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#362) [Compare Source](https://redirect.github.com/Effect-TS/effect/compare/effect@3.6.1...effect@3.6.2) ##### Patch Changes - [#​3435](https://redirect.github.com/Effect-TS/effect/pull/3435) [`fd4b2f6`](https://redirect.github.com/Effect-TS/effect/commit/fd4b2f6516b325740dde615f1cf0229edf13ca0c) Thanks [@​Andarist](https://redirect.github.com/Andarist)! - ensure fiber is properly cleared in FiberHandle.unsafeSet ### [`v3.6.1`](https://redirect.github.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#361) [Compare Source](https://redirect.github.com/Effect-TS/effect/compare/effect@3.6.0...effect@3.6.1) ##### Patch Changes - [#​3405](https://redirect.github.com/Effect-TS/effect/pull/3405) [`510a34d`](https://redirect.github.com/Effect-TS/effect/commit/510a34d4cc5d2f51347a53847f6c7db84d2b17c6) Thanks [@​KhraksMamtsov](https://redirect.github.com/KhraksMamtsov)! - Fix `Effect.repeat` with times option returns wrong value - [#​3398](https://redirect.github.com/Effect-TS/effect/pull/3398) [`45dbb9f`](https://redirect.github.com/Effect-TS/effect/commit/45dbb9ffeaf93d9e4df99d0cd4920e41ba9a3978) Thanks [@​sukovanej](https://redirect.github.com/sukovanej)! - Fix `Stream.asyncPush` type signature - allow the `register` effect to fail. ### [`v3.6.0`](https://redirect.github.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#360) [Compare Source](https://redirect.github.com/Effect-TS/effect/compare/effect@3.5.9...effect@3.6.0) ##### Minor Changes - [#​3380](https://redirect.github.com/Effect-TS/effect/pull/3380) [`1e0fe80`](https://redirect.github.com/Effect-TS/effect/commit/1e0fe802b36c257971296617473ce0abe730e8dc) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - make List.Cons extend NonEmptyIterable - [#​3380](https://redirect.github.com/Effect-TS/effect/pull/3380) [`8135294`](https://redirect.github.com/Effect-TS/effect/commit/8135294b591ea94fde7e6f94a504608f0e630520) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - add DateTime module The `DateTime` module provides functionality for working with time, including support for time zones and daylight saving time. It has two main data types: `DateTime.Utc` and `DateTime.Zoned`. A `DateTime.Utc` represents a time in Coordinated Universal Time (UTC), and a `DateTime.Zoned` contains both a UTC timestamp and a time zone. There is also a `CurrentTimeZone` service, for setting a time zone contextually. ```ts import { DateTime, Effect } from "effect"; Effect.gen(function* () { // Get the current time in the current time zone const now = yield* DateTime.nowInCurrentZone; // Math functions are included const tomorrow = DateTime.add(now, 1, "day"); // Convert to a different time zone // The UTC portion of the `DateTime` is preserved and only the time zone is // changed const sydneyTime = tomorrow.pipe( DateTime.unsafeSetZoneNamed("Australia/Sydney"), ); }).pipe(DateTime.withCurrentZoneNamed("America/New_York")); ``` - [#​3380](https://redirect.github.com/Effect-TS/effect/pull/3380) [`cd255a4`](https://redirect.github.com/Effect-TS/effect/commit/cd255a48872d8fb924cf713ef73f0883a9cc6987) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - add Stream.asyncPush api This api creates a stream from an external push-based resource. You can use the `emit` helper to emit values to the stream. You can also use the `emit` helper to signal the end of the stream by using apis such as `emit.end` or `emit.fail`. By default it uses an "unbounded" buffer size. You can customize the buffer size and strategy by passing an object as the second argument with the `bufferSize` and `strategy` fields. ```ts import { Effect, Stream } from "effect"; Stream.asyncPush( (emit) => Effect.acquireRelease( Effect.gen(function* () { yield* Effect.log("subscribing"); return setInterval(() => emit.single("tick"), 1000); }), (handle) => Effect.gen(function* () { yield* Effect.log("unsubscribing"); clearInterval(handle); }), ), { bufferSize: 16, strategy: "dropping" }, ); ``` - [#​3380](https://redirect.github.com/Effect-TS/effect/pull/3380) [`3845646`](https://redirect.github.com/Effect-TS/effect/commit/3845646828e98f3c7cda1217f6cfe5f642ac0603) Thanks [@​mikearnaldi](https://redirect.github.com/mikearnaldi)! - Implement Struct.keys as a typed alternative to Object.keys ```ts import { Struct } from "effect"; const symbol: unique symbol = Symbol(); const value = { a: 1, b: 2, [symbol]: 3, }; const keys: Array<"a" | "b"> = Struct.keys(value); ``` - [#​3380](https://redirect.github.com/Effect-TS/effect/pull/3380) [`2d09078`](https://redirect.github.com/Effect-TS/effect/commit/2d09078c5948b37fc2f79ef858fe4ca3e4814085) Thanks [@​sukovanej](https://redirect.github.com/sukovanej)! - Add `Random.choice`. ```ts import { Random } from "effect"; Effect.gen(function* () { const randomItem = yield* Random.choice([1, 2, 3]); console.log(randomItem); }); ``` - [#​3380](https://redirect.github.com/Effect-TS/effect/pull/3380) [`4bce5a0`](https://redirect.github.com/Effect-TS/effect/commit/4bce5a0274203550ccf117d830721891b0a3d182) Thanks [@​vinassefranche](https://redirect.github.com/vinassefranche)! - Add onlyEffect option to Effect.tap - [#​3380](https://redirect.github.com/Effect-TS/effect/pull/3380) [`4ddbff0`](https://redirect.github.com/Effect-TS/effect/commit/4ddbff0bb4e3ffddfeb509c59835b83245fb975e) Thanks [@​KhraksMamtsov](https://redirect.github.com/KhraksMamtsov)! - Support `Refinement` in `Predicate.tuple` and `Predicate.struct` - [#​3380](https://redirect.github.com/Effect-TS/effect/pull/3380) [`e74cc38`](https://redirect.github.com/Effect-TS/effect/commit/e74cc38cb420a320c4d7ef98180f19d452a8b316) Thanks [@​dilame](https://redirect.github.com/dilame)! - Implement `Stream.onEnd` that adds an effect to be executed at the end of the stream. ```ts import { Console, Effect, Stream } from "effect"; const stream = Stream.make(1, 2, 3).pipe( Stream.map((n) => n * 2), Stream.tap((n) => Console.log(`after mapping: ${n}`)), Stream.onEnd(Console.log("Stream ended")), ); Effect.runPromise(Stream.runCollect(stream)).then(console.log); // after mapping: 2 // after mapping: 4 // after mapping: 6 // Stream ended // { _id: 'Chunk', values: [ 2, 4, 6 ] } ``` - [#​3380](https://redirect.github.com/Effect-TS/effect/pull/3380) [`bb069b4`](https://redirect.github.com/Effect-TS/effect/commit/bb069b49ef291c532a02c1e8e74271f6d1bb32ec) Thanks [@​dilame](https://redirect.github.com/dilame)! - Implement `Stream.onStart` that adds an effect to be executed at the start of the stream. ```ts import { Console, Effect, Stream } from "effect"; const stream = Stream.make(1, 2, 3).pipe( Stream.onStart(Console.log("Stream started")), Stream.map((n) => n * 2), Stream.tap((n) => Console.log(`after mapping: ${n}`)), ); Effect.runPromise(Stream.runCollect(stream)).then(console.log); // Stream started // after mapping: 2 // after mapping: 4 // after mapping: 6 // { _id: 'Chunk', values: [ 2, 4, 6 ] } ``` - [#​3380](https://redirect.github.com/Effect-TS/effect/pull/3380) [`cd255a4`](https://redirect.github.com/Effect-TS/effect/commit/cd255a48872d8fb924cf713ef73f0883a9cc6987) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - add `bufferSize` option to Stream.fromEventListener - [#​3380](https://redirect.github.com/Effect-TS/effect/pull/3380) [`7d02174`](https://redirect.github.com/Effect-TS/effect/commit/7d02174af3bcbf054e5cdddb821c91d0f47e8285) Thanks [@​fubhy](https://redirect.github.com/fubhy)! - Changed various function signatures to return `Array` instead of `ReadonlyArray` ### [`v3.5.9`](https://redirect.github.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#359) [Compare Source](https://redirect.github.com/Effect-TS/effect/compare/effect@3.5.8...effect@3.5.9) ##### Patch Changes - [#​3377](https://redirect.github.com/Effect-TS/effect/pull/3377) [`6359644`](https://redirect.github.com/Effect-TS/effect/commit/635964446323cf55d4060559337e710e4a24496e) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - add MicroScheduler to Micro module - [#​3362](https://redirect.github.com/Effect-TS/effect/pull/3362) [`7f41e42`](https://redirect.github.com/Effect-TS/effect/commit/7f41e428830bf3043b8be0d28dcd235d5747c942) Thanks [@​IMax153](https://redirect.github.com/IMax153)! - Add `Service` and `Identifier` to `Context.Tag`. These helpers can be used, for example, to extract the service shape from a tag: ```ts import * as Context from "effect/Context"; export class Foo extends Context.Tag("Foo")< Foo, { readonly foo: Effect.Effect; } >() {} type ServiceShape = typeof Foo.Service; ``` - [#​3373](https://redirect.github.com/Effect-TS/effect/pull/3373) [`f566fd1`](https://redirect.github.com/Effect-TS/effect/commit/f566fd1d7eea531a0d981dd24037f14a603a1273) Thanks [@​KhraksMamtsov](https://redirect.github.com/KhraksMamtsov)! - Add test for Hash.number(0.1) !== Has.number(0) ### [`v3.5.8`](https://redirect.github.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#358) [Compare Source](https://redirect.github.com/Effect-TS/effect/compare/effect@3.5.7...effect@3.5.8) ##### Patch Changes - [#​3345](https://redirect.github.com/Effect-TS/effect/pull/3345) [`1ba640c`](https://redirect.github.com/Effect-TS/effect/commit/1ba640c702f187a866023bf043c26e25cce941ef) Thanks [@​mikearnaldi](https://redirect.github.com/mikearnaldi)! - Fix typo propety to property - [#​3349](https://redirect.github.com/Effect-TS/effect/pull/3349) [`c8c71bd`](https://redirect.github.com/Effect-TS/effect/commit/c8c71bd20eb87d23133dac6156b83bb08941597c) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - ensure all Data.Error arguments are preserved in .toJSON - [#​3355](https://redirect.github.com/Effect-TS/effect/pull/3355) [`a26ce58`](https://redirect.github.com/Effect-TS/effect/commit/a26ce581ca7d407e1e81439b58c8045b3fa65231) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - fix Hash.number not returning unique values ### [`v3.5.7`](https://redirect.github.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#357) [Compare Source](https://redirect.github.com/Effect-TS/effect/compare/effect@3.5.6...effect@3.5.7) ##### Patch Changes - [#​3288](https://redirect.github.com/Effect-TS/effect/pull/3288) [`3afcc93`](https://redirect.github.com/Effect-TS/effect/commit/3afcc93413a3d910beb69e4ce9ae120e4adaffd5) Thanks [@​mikearnaldi](https://redirect.github.com/mikearnaldi)! - Forbid usage of property "name" in Effect.Tag - [#​3310](https://redirect.github.com/Effect-TS/effect/pull/3310) [`99bddcf`](https://redirect.github.com/Effect-TS/effect/commit/99bddcfb3d6eab4d489d055404e26ad81afe52fc) Thanks [@​fubhy](https://redirect.github.com/fubhy)! - Added additional pure annotations to improve tree-shakeability ### [`v3.5.6`](https://redirect.github.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#356) [Compare Source](https://redirect.github.com/Effect-TS/effect/compare/effect@3.5.5...effect@3.5.6) ##### Patch Changes - [#​3294](https://redirect.github.com/Effect-TS/effect/pull/3294) [`cc327a1`](https://redirect.github.com/Effect-TS/effect/commit/cc327a1bccd22a4ee27ec7e58b53205e93b23e2c) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - correctly exclude symbols from Record.keys - [#​3289](https://redirect.github.com/Effect-TS/effect/pull/3289) [`4bfe4fb`](https://redirect.github.com/Effect-TS/effect/commit/4bfe4fb5c82f597c9beea9baa92e772593598b60) Thanks [@​dilame](https://redirect.github.com/dilame)! - Changed `Stream.groupByKey`/`Stream.grouped`/`Stream.groupedWithin` JSDoc category from `utils` to `grouping` - [#​3295](https://redirect.github.com/Effect-TS/effect/pull/3295) [`2b14d18`](https://redirect.github.com/Effect-TS/effect/commit/2b14d181462cad8359da4fa6bc6dfda0f742c398) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - fix YieldableError rendering on bun ### [`v3.5.5`](https://redirect.github.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#355) [Compare Source](https://redirect.github.com/Effect-TS/effect/compare/effect@3.5.4...effect@3.5.5) ##### Patch Changes - [#​3266](https://redirect.github.com/Effect-TS/effect/pull/3266) [`a9d7800`](https://redirect.github.com/Effect-TS/effect/commit/a9d7800f6a253192b653d77778b0674f39b1ca39) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - use "unbounded" buffer for Stream.fromEventListener ### [`v3.5.4`](https://redirect.github.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#354) [Compare Source](https://redirect.github.com/Effect-TS/effect/compare/effect@3.5.3...effect@3.5.4) ##### Patch Changes - [#​3253](https://redirect.github.com/Effect-TS/effect/pull/3253) [`ed0dde4`](https://redirect.github.com/Effect-TS/effect/commit/ed0dde4888e6f1a97ad5bba06b755d26a6a1c52e) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - update dependencies - [#​3247](https://redirect.github.com/Effect-TS/effect/pull/3247) [`ca775ce`](https://redirect.github.com/Effect-TS/effect/commit/ca775cec53baebc1a43d9b8852a3ac6726178498) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - if performance.timeOrigin is 0, use performance.now() directly in Clock This is a workaround for cloudflare, where performance.now() cannot be used in the global scope to calculate the origin. - [#​3259](https://redirect.github.com/Effect-TS/effect/pull/3259) [`5be9cc0`](https://redirect.github.com/Effect-TS/effect/commit/5be9cc044025a9541b9b7acefa2d3fc05fa1301b) Thanks [@​IMax153](https://redirect.github.com/IMax153)! - expose `Channel.isChannel` - [#​3250](https://redirect.github.com/Effect-TS/effect/pull/3250) [`203658f`](https://redirect.github.com/Effect-TS/effect/commit/203658f8001c132b25764ab70344b171683b554c) Thanks [@​gcanti](https://redirect.github.com/gcanti)! - add support for `Refinement`s to `Predicate.or`, closes [#​3243](https://redirect.github.com/Effect-TS/effect/issues/3243) ```ts import { Predicate } from "effect" // Refinement const isStringOrNumber = Predicate.or(Predicate.isString, Predicate.isNumber) ``` - [#​3246](https://redirect.github.com/Effect-TS/effect/pull/3246) [`eb1c4d4`](https://redirect.github.com/Effect-TS/effect/commit/eb1c4d44e54b9d8d201a366d1ff94face2a6dcd3) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - render nested causes in Cause.pretty ### [`v3.5.3`](https://redirect.github.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#353) [Compare Source](https://redirect.github.com/Effect-TS/effect/compare/effect@3.5.2...effect@3.5.3) ##### Patch Changes - [#​3234](https://redirect.github.com/Effect-TS/effect/pull/3234) [`edb0da3`](https://redirect.github.com/Effect-TS/effect/commit/edb0da383746d760f35d8582f5fb0cc0eeca9217) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - do not add a error "cause" if the upstream error does not contain one - [#​3236](https://redirect.github.com/Effect-TS/effect/pull/3236) [`c8d3fb0`](https://redirect.github.com/Effect-TS/effect/commit/c8d3fb0fe23585f6efb724af51fbab3ba1ad6e83) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - set Logger.pretty message color to deepskyblue on browsers - [#​3240](https://redirect.github.com/Effect-TS/effect/pull/3240) [`dabd028`](https://redirect.github.com/Effect-TS/effect/commit/dabd028decf9b7983ca16ebe0f48c05c11a84b68) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - fix process .isTTY detection - [#​3230](https://redirect.github.com/Effect-TS/effect/pull/3230) [`786b2ab`](https://redirect.github.com/Effect-TS/effect/commit/786b2ab29d525c877bb84035dac9e2d6499339d1) Thanks [@​KhraksMamtsov](https://redirect.github.com/KhraksMamtsov)! - support heterogenous argument in `Option.firstSomeOf` - [#​3238](https://redirect.github.com/Effect-TS/effect/pull/3238) [`fc57354`](https://redirect.github.com/Effect-TS/effect/commit/fc573547d41667016fce05eaee75960fcc6dce4d) Thanks [@​leonitousconforti](https://redirect.github.com/leonitousconforti)! - Align Stream.run public function signatures ### [`v3.5.2`](https://redirect.github.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#352) [Compare Source](https://redirect.github.com/Effect-TS/effect/compare/effect@3.5.1...effect@3.5.2) ##### Patch Changes - [#​3228](https://redirect.github.com/Effect-TS/effect/pull/3228) [`639208e`](https://redirect.github.com/Effect-TS/effect/commit/639208eeb8a44622994f832bc2d45d06ab636bc8) Thanks [@​IMax153](https://redirect.github.com/IMax153)! - Render a more helpful error message when timing out an effect - [#​3235](https://redirect.github.com/Effect-TS/effect/pull/3235) [`6684b4c`](https://redirect.github.com/Effect-TS/effect/commit/6684b4c27d77a7fcc7af2e261a450edf971b62b5) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - improve safari support for Logger.pretty - [#​3235](https://redirect.github.com/Effect-TS/effect/pull/3235) [`6684b4c`](https://redirect.github.com/Effect-TS/effect/commit/6684b4c27d77a7fcc7af2e261a450edf971b62b5) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - fix span stack rendering when stack function returns undefined - [#​3235](https://redirect.github.com/Effect-TS/effect/pull/3235) [`6684b4c`](https://redirect.github.com/Effect-TS/effect/commit/6684b4c27d77a7fcc7af2e261a450edf971b62b5) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - align UnsafeConsole group types with web apis ### [`v3.5.1`](https://redirect.github.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#351) [Compare Source](https://redirect.github.com/Effect-TS/effect/compare/effect@3.5.0...effect@3.5.1) ##### Patch Changes - [#​3220](https://redirect.github.com/Effect-TS/effect/pull/3220) [`55fdd76`](https://redirect.github.com/Effect-TS/effect/commit/55fdd761ee95afd73b6a892c13fee92b36c02837) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - fix Logger.pretty on bun ### [`v3.5.0`](https://redirect.github.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#350) [Compare Source](https://redirect.github.com/Effect-TS/effect/compare/effect@3.4.9...effect@3.5.0) ##### Minor Changes - [#​3048](https://redirect.github.com/Effect-TS/effect/pull/3048) [`a1f5b83`](https://redirect.github.com/Effect-TS/effect/commit/a1f5b831a1bc7535988b370d68d0b3eb1123e0ce) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - add renderErrorCause option to Cause.pretty - [#​3048](https://redirect.github.com/Effect-TS/effect/pull/3048) [`60bc3d0`](https://redirect.github.com/Effect-TS/effect/commit/60bc3d0867b13e48b24dc22604b4dd2e7b2c1ca4) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - add RcRef module An `RcRef` wraps a reference counted resource that can be acquired and released multiple times. The resource is lazily acquired on the first call to `get` and released when the last reference is released. ```ts import { Effect, RcRef } from "effect" Effect.gen(function* () { const ref = yield* RcRef.make({ acquire: Effect.acquireRelease(Effect.succeed("foo"), () => Effect.log("release foo") ) }) // will only acquire the resource once, and release it // when the scope is closed yield* RcRef.get(ref).pipe(Effect.andThen(RcRef.get(ref)), Effect.scoped) }) ``` - [#​3048](https://redirect.github.com/Effect-TS/effect/pull/3048) [`5ab348f`](https://redirect.github.com/Effect-TS/effect/commit/5ab348f265db3d283aa091ddca6d2d49137c16f2) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - allowing customizing Stream pubsub strategy ```ts import { Schedule, Stream } from "effect" // toPubSub Stream.fromSchedule(Schedule.spaced(1000)).pipe( Stream.toPubSub({ capacity: 16, // or "unbounded" strategy: "dropping" // or "sliding" / "suspend" }) ) // also for the broadcast apis Stream.fromSchedule(Schedule.spaced(1000)).pipe( Stream.broadcastDynamic({ capacity: 16, strategy: "dropping" }) ) ``` - [#​3048](https://redirect.github.com/Effect-TS/effect/pull/3048) [`60bc3d0`](https://redirect.github.com/Effect-TS/effect/commit/60bc3d0867b13e48b24dc22604b4dd2e7b2c1ca4) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - add Duration.isZero, for checking if a Duration is zero - [#​3048](https://redirect.github.com/Effect-TS/effect/pull/3048) [`3e04bf8`](https://redirect.github.com/Effect-TS/effect/commit/3e04bf8a7127e956cadb7684a8f4c661df57663b) Thanks [@​sukovanej](https://redirect.github.com/sukovanej)! - Add `Success` type util for `Config`. - [#​3048](https://redirect.github.com/Effect-TS/effect/pull/3048) [`e7fc45f`](https://redirect.github.com/Effect-TS/effect/commit/e7fc45f0c7002aafdaec7878149ac064cd104ea3) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - add Logger.prettyLogger and Logger.pretty `Logger.pretty` is a new logger that leverages the features of the `console` APIs to provide a more visually appealing output. To try it out, provide it to your program: ```ts import { Effect, Logger } from "effect" Effect.log("Hello, World!").pipe(Effect.provide(Logger.pretty)) ``` - [#​3048](https://redirect.github.com/Effect-TS/effect/pull/3048) [`a1f5b83`](https://redirect.github.com/Effect-TS/effect/commit/a1f5b831a1bc7535988b370d68d0b3eb1123e0ce) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - add .groupCollapsed to UnsafeConsole - [#​3048](https://redirect.github.com/Effect-TS/effect/pull/3048) [`4626de5`](https://redirect.github.com/Effect-TS/effect/commit/4626de59c25b384216faa0be87bf0b8cd36357d0) Thanks [@​giacomoran](https://redirect.github.com/giacomoran)! - export Random.make taking hashable values as seed - [#​3048](https://redirect.github.com/Effect-TS/effect/pull/3048) [`f01e7db`](https://redirect.github.com/Effect-TS/effect/commit/f01e7db317827255d7901f523f2e28b43298e8df) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - add `replay` option to PubSub constructors This option adds a replay buffer in front of the given PubSub. The buffer will replay the last `n` messages to any new subscriber. ```ts Effect.gen(function*() { const messages = [1, 2, 3, 4, 5] const pubsub = yield* PubSub.bounded({ capacity: 16, replay: 3 }) yield* PubSub.publishAll(pubsub, messages) const sub = yield* PubSub.subscribe(pubsub) assert.deepStrictEqual(Chunk.toReadonlyArray(yield* Queue.takeAll(sub)), [3, 4, 5]) })) ``` - [#​3048](https://redirect.github.com/Effect-TS/effect/pull/3048) [`60bc3d0`](https://redirect.github.com/Effect-TS/effect/commit/60bc3d0867b13e48b24dc22604b4dd2e7b2c1ca4) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - add RcMap module An `RcMap` can contain multiple reference counted resources that can be indexed by a key. The resources are lazily acquired on the first call to `get` and released when the last reference is released. Complex keys can extend `Equal` and `Hash` to allow lookups by value. ```ts import { Effect, RcMap } from "effect" Effect.gen(function* () { const map = yield* RcMap.make({ lookup: (key: string) => Effect.acquireRelease(Effect.succeed(`acquired ${key}`), () => Effect.log(`releasing ${key}`) ) }) // Get "foo" from the map twice, which will only acquire it once // It will then be released once the scope closes. yield* RcMap.get(map, "foo").pipe( Effect.andThen(RcMap.get(map, "foo")), Effect.scoped ) }) ``` - [#​3048](https://redirect.github.com/Effect-TS/effect/pull/3048) [`ac71f37`](https://redirect.github.com/Effect-TS/effect/commit/ac71f378f2413e5aa91c95f649ffe898d6a26114) Thanks [@​dilame](https://redirect.github.com/dilame)! - Ensure `Scope` is excluded from `R` in the `Channel` / `Stream` `run*` functions. This fix ensures that `Scope` is now properly excluded from the resulting effect environment. The affected functions include `run`, `runCollect`, `runCount`, `runDrain` and other non-scoped `run*` in both `Stream` and `Channel` modules. This fix brings the type declaration in line with the runtime implementation. - [#​3048](https://redirect.github.com/Effect-TS/effect/pull/3048) [`8432360`](https://redirect.github.com/Effect-TS/effect/commit/8432360ce68614a419bb328083a4109d0fc8aa93) Thanks [@​dilame](https://redirect.github.com/dilame)! - refactor(Stream/mergeLeft): rename `self`/`that` argument names to `left`/`right` for clarity refactor(Stream/mergeRight): rename `self`/`that` argument names to `left`/`right` for clarity - [#​3048](https://redirect.github.com/Effect-TS/effect/pull/3048) [`e4bf1bf`](https://redirect.github.com/Effect-TS/effect/commit/e4bf1bf2b4a970eacd77c9b77b5ea8c68bc84498) Thanks [@​dilame](https://redirect.github.com/dilame)! - feat(Stream): implement "raceAll" operator, which returns a stream that mirrors the first source stream to emit an item. ```ts import { Stream, Schedule, Console, Effect } from "effect" const stream = Stream.raceAll( Stream.fromSchedule(Schedule.spaced("1 millis")), Stream.fromSchedule(Schedule.spaced("2 millis")), Stream.fromSchedule(Schedule.spaced("4 millis")) ).pipe(Stream.take(6), Stream.tap(Console.log)) Effect.runPromise(Stream.runDrain(stream)) // Output only from the first stream, the rest streams are interrupted // 0 // 1 // 2 // 3 // 4 // 5 ``` - [#​3048](https://redirect.github.com/Effect-TS/effect/pull/3048) [`13cb861`](https://redirect.github.com/Effect-TS/effect/commit/13cb861a5eded15c55c6cdcf6a8acde8320367a6) Thanks [@​dilame](https://redirect.github.com/dilame)! - refactor(Stream): use new built-in `Types.TupleOf` instead of `Stream.DynamicTuple` and deprecate it - [#​3048](https://redirect.github.com/Effect-TS/effect/pull/3048) [`79d2d91`](https://redirect.github.com/Effect-TS/effect/commit/79d2d91464d95dde0e9444d43e7a7f309f05d6e6) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - support ErrorOptions in YieldableError constructor - [#​3048](https://redirect.github.com/Effect-TS/effect/pull/3048) [`9f66825`](https://redirect.github.com/Effect-TS/effect/commit/9f66825f1fce0fe8d10420c285f7dc4c71e8af8d) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - allow customizing the output buffer for the Stream.async\* apis ```ts import { Stream } from "effect" Stream.async( (emit) => { // ... }, { bufferSize: 16, strategy: "dropping" // you can also use "sliding" or "suspend" } ) ``` ##### Patch Changes - [#​3048](https://redirect.github.com/Effect-TS/effect/pull/3048) [`a1f5b83`](https://redirect.github.com/Effect-TS/effect/commit/a1f5b831a1bc7535988b370d68d0b3eb1123e0ce) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - include Error.cause stack in log output - [#​3048](https://redirect.github.com/Effect-TS/effect/pull/3048) [`a1f5b83`](https://redirect.github.com/Effect-TS/effect/commit/a1f5b831a1bc7535988b370d68d0b3eb1123e0ce) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - set stackTraceLimit to 1 in PrettyError to address performance issues - [#​3048](https://redirect.github.com/Effect-TS/effect/pull/3048) [`79d2d91`](https://redirect.github.com/Effect-TS/effect/commit/79d2d91464d95dde0e9444d43e7a7f309f05d6e6) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - ensure "cause" is rendered in Data.Error output - [#​3048](https://redirect.github.com/Effect-TS/effect/pull/3048) [`e7fc45f`](https://redirect.github.com/Effect-TS/effect/commit/e7fc45f0c7002aafdaec7878149ac064cd104ea3) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - fix types of UnsafeConsole.group ### [`v3.4.9`](https://redirect.github.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#349) [Compare Source](https://redirect.github.com/Effect-TS/effect/compare/effect@3.4.8...effect@3.4.9) ##### Patch Changes - [#​3210](https://redirect.github.com/Effect-TS/effect/pull/3210) [`7af137c`](https://redirect.github.com/Effect-TS/effect/commit/7af137c9433f6e74959b3887561ec1e6f12e10ee) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - prevent reclaim of manually invalidated pool items - [#​3204](https://redirect.github.com/Effect-TS/effect/pull/3204) [`ee4b3dc`](https://redirect.github.com/Effect-TS/effect/commit/ee4b3dc5f68d19dc3ae1c2d12901c5b8ffbebabb) Thanks [@​gcanti](https://redirect.github.com/gcanti)! - Updated the JSDocs for the `Stream` module by adding examples to key functions. - [#​3202](https://redirect.github.com/Effect-TS/effect/pull/3202) [`097d25c`](https://redirect.github.com/Effect-TS/effect/commit/097d25cb5d13c049e01789651be56b09620186ef) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - allow invalidated Pool items to be reclaimed with usage strategy ### [`v3.4.8`](https://redirect.github.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#348) [Compare Source](https://redirect.github.com/Effect-TS/effect/compare/effect@3.4.7...effect@3.4.8) ##### Patch Changes - [#​3181](https://redirect.github.com/Effect-TS/effect/pull/3181) [`a435e0f`](https://redirect.github.com/Effect-TS/effect/commit/a435e0fc5378b33a49bcec92ee235df6f16a2419) Thanks [@​KhraksMamtsov](https://redirect.github.com/KhraksMamtsov)! - refactor `TrimEnd` & `TrimStart` - [#​3176](https://redirect.github.com/Effect-TS/effect/pull/3176) [`b5554db`](https://redirect.github.com/Effect-TS/effect/commit/b5554db36c4dd6f64fa5e6a62a29b2759c54217a) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - allow Stream run fiber to close before trying to interrupt it - [#​3175](https://redirect.github.com/Effect-TS/effect/pull/3175) [`a9c4fb3`](https://redirect.github.com/Effect-TS/effect/commit/a9c4fb3bf3c6e92cd1c142b0605fddf7eb3c697c) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - ensure fibers are interrupted in Stream.mergeWith ### [`v3.4.7`](https://redirect.github.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#347) [Compare Source](https://redirect.github.com/Effect-TS/effect/compare/effect@3.4.6...effect@3.4.7) ##### Patch Changes - [#​3161](https://redirect.github.com/Effect-TS/effect/pull/3161) [`a5737d6`](https://redirect.github.com/Effect-TS/effect/commit/a5737d6db2b921605c332eabbc5402ee3d17357b) Thanks [@​tim-smart](https://redirect.github.com/tim-smart)! - ensure PubSub.publishAll does not increase size while there are no subscribers ### [`v3.4.6`](https://redirect.github.com/Effect-TS/effect/blob/HEAD/packages/effect/CHANGELOG.md#346) [Compare Source](https://redirect.github.com/Effect-TS/effect/compare/effect@3.4.5...effect@3.4.6) ##### Patch Changes - [#​3096](https://redirect.github.com/Effect-TS/effect/pull/3096) [`5c0ceb0`](https://redirect.github.com/Effect-TS/effect/commit/5c0ceb00826cce9e50bf9d41d83e191d5352c030) Thanks [@​gcanti](https://redirect.github.com/gcanti)! - Micro: align with `Effect` module (renamings and new combinators). General naming convention rule: ``. - `Failure` -> `MicroCause` - `Failure.Expected` -> `MicroCause.Fail` - `Failure.Unexpected` -> `MicroCause.Die` - `Failure.Aborted` -> `MicroCause.Interrupt` - `FailureExpected` -> `causeFail` - `Failure

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.