Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⬆️ Update dependency effect to v3 #126

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Apr 16, 2024

Mend Renovate

This PR contains the following updates:

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

Release Notes

Effect-TS/effect (effect)

v3.5.6

Compare Source

Patch Changes

v3.5.5

Compare Source

Patch Changes

v3.5.4

Compare Source

Patch Changes

v3.5.3

Compare Source

Patch Changes

v3.5.2

Compare Source

Patch Changes

v3.5.1

Compare Source

Patch Changes

v3.5.0

Compare Source

Minor Changes
  • #​3048 a1f5b83 Thanks @​tim-smart! - add renderErrorCause option to Cause.pretty

  • #​3048 60bc3d0 Thanks @​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.

    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 5ab348f Thanks @​tim-smart! - allowing customizing Stream pubsub strategy

    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 60bc3d0 Thanks @​tim-smart! - add Duration.isZero, for checking if a Duration is zero

  • #​3048 3e04bf8 Thanks @​sukovanej! - Add Success type util for Config.

  • #​3048 e7fc45f Thanks @​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:

    import { Effect, Logger } from "effect";
    
    Effect.log("Hello, World!").pipe(Effect.provide(Logger.pretty));
  • #​3048 a1f5b83 Thanks @​tim-smart! - add .groupCollapsed to UnsafeConsole

  • #​3048 4626de5 Thanks @​giacomoran! - export Random.make taking hashable values as seed

  • #​3048 f01e7db Thanks @​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.

    Effect.gen(function*() {
      const messages = [1, 2, 3, 4, 5]
      const pubsub = yield* PubSub.bounded<number>({ 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 60bc3d0 Thanks @​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.

    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 ac71f37 Thanks @​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 8432360 Thanks @​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 e4bf1bf Thanks @​dilame! - feat(Stream): implement "raceAll" operator, which returns a stream that mirrors the first source stream to emit an item.

    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 13cb861 Thanks @​dilame! - refactor(Stream): use new built-in Types.TupleOf instead of Stream.DynamicTuple and deprecate it

  • #​3048 79d2d91 Thanks @​tim-smart! - support ErrorOptions in YieldableError constructor

  • #​3048 9f66825 Thanks @​tim-smart! - allow customizing the output buffer for the Stream.async* apis

    import { Stream } from "effect";
    
    Stream.async<string>(
      (emit) => {
        // ...
      },
      {
        bufferSize: 16,
        strategy: "dropping", // you can also use "sliding" or "suspend"
      },
    );
Patch Changes

v3.4.9

Compare Source

Patch Changes

v3.4.8

Compare Source

Patch Changes

v3.4.7

Compare Source

Patch Changes

v3.4.6

Compare Source

Patch Changes
  • #​3096 5c0ceb0 Thanks @​gcanti! - Micro: align with Effect module (renamings and new combinators).

    General naming convention rule: <reference module (start with lowercase)><api (start with Uppercase)>.

    • Failure -> MicroCause
      • Failure.Expected<E> -> MicroCause.Fail<E>
      • Failure.Unexpected -> MicroCause.Die
      • Failure.Aborted -> MicroCause.Interrupt
      • FailureExpected -> causeFail
      • FailureUnexpected -> causeDie
      • FailureAborted -> causeInterrupt
      • failureIsExpected -> causeIsFail
      • failureIsExpected -> causeIsFail
      • failureIsUnexpected -> causeIsDie
      • failureIsAborted -> causeIsInterrupt
      • failureSquash -> causeSquash
      • failureWithTrace -> causeWithTrace
    • Result -> MicroExit
      • ResultAborted -> exitInterrupt
      • ResultSuccess -> exitSucceed
      • ResultFail -> exitFail
      • ResultFailUnexpected -> exitDie
      • ResultFailWith -> exitFailCause
      • resultIsSuccess -> exitIsSuccess
      • resultIsFailure -> exitIsFailure
      • resultIsAborted -> exitIsInterrupt
      • resultIsFailureExpected -> exitIsFail
      • resultIsFailureUnexpected -> exitIsDie
      • resultVoid -> exitVoid
    • DelayFn -> MicroSchedule
      • delayExponential -> scheduleExponential
      • delaySpaced -> scheduleSpaced
      • delayWithMax -> scheduleWithMaxDelay
      • delayWithMaxElapsed -> scheduleWithMaxElapsed
      • delayWithRecurs -> scheduleRecurs and make it a constructor
      • add scheduleAddDelay combinator
      • add scheduleUnion combinator
      • add scheduleIntersect combinator
    • Handle
      • abort -> interrupt
      • unsafeAbort -> unsafeInterrupt
    • provideServiceMicro -> provideServiceEffect
    • fromResult -> fromExit
    • fromResultSync -> fromExitSync
    • failWith -> failCause
    • failWithSync -> failCauseSync
    • asResult -> exit
    • filterOrFailWith -> filterOrFailCause
    • repeatResult -> repeatExit
    • catchFailure -> catchAllCause
    • catchFailureIf -> catchCauseIf
    • catchExpected -> catchAll
    • catchUnexpected -> catchAllDefect
    • tapFailure -> tapErrorCause
    • tapFailureIf -> tapErrorCauseIf
    • tapExpected -> tapError
    • tapUnexpected -> tapDefect
    • mapFailure -> mapErrorCause
    • matchFailureMicro -> matchCauseEffect
    • matchFailure -> matchCause
    • matchMicro -> matchEffect
    • onResult -> onExit
    • onResultIf -> onExitIf
    • onFailure -> onError
    • onAbort -> onInterrupt
    • abort -> interrupt
    • runPromiseResult -> runPromiseExit
    • runSyncResult -> runSyncExit
    • rename delay option to schedule
  • #​3096 5c0ceb0 Thanks @​gcanti! - Micro: rename timeout to timeoutOption, and add a timeout that fails with a TimeoutException

  • #​3121 33735b1 Thanks @​KhraksMamtsov! - Support for the tacit usage of external handlers for Match.tag and Match.tagStartsWith functions

    type Value = { _tag: "A"; a: string } | { _tag: "B"; b: number };
    const handlerA = (_: { _tag: "A"; a: number }) => _.a;
    
    // $ExpectType string | number
    pipe(
      M.type<Value>(),
      M.tag("A", handlerA), // <-- no type issue
      M.orElse((_) => _.b),
    )(value);
  • #​3096 5c0ceb0 Thanks @​gcanti! - Micro: move MicroExit types to a namespace

  • #​3134 139d4b3 Thanks @​tim-smart! - use Channel.acquireUseRelease for Channel.withSpan

v3.4.5

Compare Source

Patch Changes

v3.4.4

Compare Source

Patch Changes

v3.4.3

Compare Source

Patch Changes

v3.4.2

Compare Source

Patch Changes

v3.4.1

Compare Source

Patch Changes

v3.4.0

Compare Source

Minor Changes
  • #​2938 c0ce180 Thanks @​LaureRC! - Make Option.liftPredicate dual

  • #​2938 61707b6 Thanks @​LaureRC! - Add Effect.liftPredicate

    Effect.liftPredicate transforms a Predicate function into an Effect returning the input value if the predicate returns true or failing with specified error if the predicate fails.

    import { Effect } from "effect";
    
    const isPositive = (n: number): boolean => n > 0;
    
    // succeeds with `1`
    Effect.liftPredicate(1, isPositive, (n) => `${n} is not positive`);
    
    // fails with `"0 is not positive"`
    Effect.liftPredicate(0, isPositive, (n) => `${n} is not positive`);
  • #​2938 9c1b5b3 Thanks @​tim-smart! - add EventListener type to Stream to avoid use of dom lib

  • #​2938 a35faf8 Thanks @​gcanti! - Add lastNonEmpty function to Chunk module, closes #​2946

  • #​2938 ff73c0c Thanks @​dilame! - feat(Stream): implement Success, Error, Context type accessors

  • #​2938 984d516 Thanks @​tim-smart! - add Micro module

    A lightweight alternative to Effect, for when bundle size really matters.

    At a minimum, Micro adds 5kb gzipped to your bundle, and scales with the amount
    of features you use.

  • #​2938 8c3b8a2 Thanks @​gcanti! - add ManagedRuntime type utils (Context, and Error)

  • #​2938 017e2f9 Thanks @​LaureRC! - Add Either.liftPredicate

  • #​2938 91bf8a2 Thanks @​msensys! - Add Tuple.at api, to retrieve an element at a specified index from a tuple.

    import { Tuple } from "effect";
    
    assert.deepStrictEqual(Tuple.at([1, "hello", true], 1), "hello");
  • #​2938 c6a4a26 Thanks @​datner! - add ensure util for Array, used to normalize A | ReadonlyArray<A>

    import { ensure } from "effect/Array";
    
    // lets say you are not 100% sure if it's a member or a collection
    declare const someValue: { foo: string } | Array<{ foo: string }>;
    
    // $ExpectType ({ foo: string })[]
    const normalized = ensure(someValue);

v3.3.5

Compare Source

Patch Changes

v3.3.4

Compare Source

Patch Changes

v3.3.3

Compare Source

Patch Changes

v3.3.2

Compare Source

Patch Changes

v3.3.1

Compare Source

Patch Changes

v3.3.0

Compare Source

Minor Changes
  • #​2837 1f4ac00 Thanks @​dilame! - add Stream.zipLatestAll api

  • #​2837 9305b76 Thanks @​mattrossman! - Add queuing strategy option for Stream.toReadableStream

  • #​2837 0f40d98 Thanks @​tim-smart! - add timeToLiveStrategy to Pool options

    The timeToLiveStrategy determines how items are invalidated. If set to
    "creation", then items are invalidated based on their creation time. If set
    to "usage", then items are invalidated based on pool usage.

    By default, the timeToLiveStrategy is set to "usage".

  • #​2837 b761ef0 Thanks @​tim-smart! - add Layer.annotateLogs & Layer.annotateSpans

    This allows you to add log & span annotation to a Layer.

    import { Effect, Layer } from "effect";
    
    Layer.effectDiscard(Effect.log("hello")).pipe(
      Layer.annotateLogs({
        service: "my-service",
      }),
    );
  • #​2837 b53f69b Thanks @​dilame! - Types: implement TupleOf and TupleOfAtLeast types

    Predicate: implement isTupleOf and isTupleOfAtLeast type guards

  • #​2837 0f40d98 Thanks @​tim-smart! - add concurrency & targetUtilization option to Pool.make & Pool.makeWithTTL

    This option allows you to specify the level of concurrent access per pool item.
    I.e. setting concurrency: 2 will allow each pool item to be in use by 2 concurrent tasks.

    targetUtilization determines when to create new pool items. It is a value
    between 0 and 1, where 1 means only create new pool items when all the existing
    items are fully utilized.

    A targetUtilization of 0.5 will create new pool items when the existing items are
    50% utilized.

  • #​2837 5bd549e Thanks @​KhraksMamtsov! - Support this argument for {STM, Either, Option}.gen

  • #​2837 67f160a Thanks @​KhraksMamtsov! - Introduced Redacted<out T = string> module - Secret generalization
    Secret extends Redacted
    The use of the Redacted has been replaced by the use of the Redacted in packages with version 0.*.*

v3.2.9

Compare Source

Patch Changes

v3.2.8

Compare Source

Patch Changes

v3.2.7

Compare Source

Patch Changes

v3.2.6

Compare Source

Patch Changes

v3.2.5

Compare Source

Patch Changes

v3.2.4

Compare Source

Patch Changes

v3.2.3

Compare Source

Patch Changes

v3.2.2

Compare Source

Patch Changes
  • #​2787 5d9266e Thanks @​mikearnaldi! - Prohibit name clashes in Effect.Tag

    The following now correctly flags a type error given that the property context exists already in Tag:

    import { Effect } from "effect";
    
    class LoaderArgs extends Effect.Tag("@&#8203;services/LoaderContext")<
      LoaderArgs,
      { context: number }
    >() {}
  • #​2797 9f8122e Thanks @​mikearnaldi! - Improve internalization of functions to clean stack traces

  • #​2798 6a6f670 Thanks @​mikearnaldi! - Avoid eager read of the stack when captured by a span

v3.2.1

Compare Source

Patch Changes

v3.2.0

Compare Source

Minor Changes
Patch Changes

v3.1.6

Compare Source

Patch Changes

v3.1.5

Compare Source

Patch Changes

v3.1.4

Compare Source

Patch Changes

v3.1.3

Compare Source

Patch Changes

v3.1.2

Compare Source

Patch Changes

v3.1.1

Compare Source

Patch Changes

v3.1.0

Compare Source

Minor Changes
  • #​2543 c3c12c6 Thanks @​github-actions! - add SortedMap.lastOption & partition apis

  • #​2543 ba64ea6 Thanks @​github-actions! - add Types.DeepMutable, an alternative to Types.Mutable that makes all properties recursively mutable

  • #​2543 b5de2d2 Thanks @​github-actions! - add Effect.annotateLogsScoped

    This api allows you to annotate logs until the Scope has been closed.

    import { Effect } from "effect";
    
    Effect.gen(function* () {
      yield* Effect.log("no annotations");
      yield* Effect.annotateLogsScoped({ foo: "bar" });
      yield* Effect.log("annotated with foo=bar");
    }).pipe(Effect.scoped, Effect.andThen(Effect.log("no annotations again")));
  • #​2543 a1c7ab8 Thanks @​github-actions! - added Stream.fromEventListener, and BrowserStream.{fromEventListenerWindow, fromEventListenerDocument} for constructing a stream from addEventListener

  • #​2543 a023f28 Thanks @​github-actions! - add kind property to Tracer.Span

    This can be used to specify what kind of service created the span.

  • #​2543 1c9454d Thanks @​github-actions! - add Effect.timeoutOption

    Returns an effect that will return None if the effect times out, otherw


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 has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot added renovate upgrade Any kind of dependency updates labels Apr 16, 2024
Copy link
Contributor Author

renovate bot commented Apr 16, 2024

⚠ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: package-lock.json
npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error
npm error While resolving: @effect/schema@0.60.4
npm error Found: effect@3.1.3
npm error node_modules/effect
npm error   effect@"3.1.3" from the root project
npm error
npm error Could not resolve dependency:
npm error peer effect@"^2.1.1" from @effect/schema@0.60.4
npm error node_modules/@effect/schema
npm error   @effect/schema@"0.60.4" from the root project
npm error
npm error Conflicting peer dependency: effect@2.4.19
npm error node_modules/effect
npm error   peer effect@"^2.1.1" from @effect/schema@0.60.4
npm error   node_modules/@effect/schema
npm error     @effect/schema@"0.60.4" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error /tmp/renovate/cache/others/npm/_logs/2024-05-08T22_22_18_081Z-eresolve-report.txt

npm error A complete log of this run can be found in: /tmp/renovate/cache/others/npm/_logs/2024-05-08T22_22_18_081Z-debug-0.log

@renovate renovate bot force-pushed the renovate/effect-3.x branch 8 times, most recently from ac64789 to 5c44085 Compare April 25, 2024 04:19
@renovate renovate bot force-pushed the renovate/effect-3.x branch 10 times, most recently from 9d2cf0f to d4fa257 Compare May 2, 2024 22:37
@renovate renovate bot force-pushed the renovate/effect-3.x branch 9 times, most recently from b3879b8 to a7c2703 Compare May 8, 2024 22:22
@renovate renovate bot force-pushed the renovate/effect-3.x branch 10 times, most recently from 9e382ee to c62480e Compare July 1, 2024 07:19
@renovate renovate bot force-pushed the renovate/effect-3.x branch 6 times, most recently from fa324ab to dd0c70f Compare July 8, 2024 17:02
@renovate renovate bot force-pushed the renovate/effect-3.x branch 11 times, most recently from 487b449 to dfb7f25 Compare July 17, 2024 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
renovate upgrade Any kind of dependency updates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

0 participants