Packages

effect

4.1.4 · 11 Nov 2026MIT66.6M / weekRepositoryHomepagenpmAtom feed

Your version

2.3.6

15 Feb 2024Where it was published

2.4.19 is the newest release of 2.x.

In short

5 new5 fixed

Security

2 advisories affect 2.3.6; 3.22.1 fixes them

Release note

Patch Changes

  • Add RequestResolver.aroundRequests api

    This can be used to run side effects that introspect the requests being
    executed.

    Example:

    import { Effect, Request, RequestResolver } from "effect";
    
    interface GetUserById extends Request.Request<unknown> {
      readonly id: number;
    }
    
    declare const resolver: RequestResolver.RequestResolver<GetUserById>;
    
    RequestResolver.aroundRequests(
      resolver,
      (requests) => Effect.log(`got ${requests.length} requests`),
      (requests, _) => Effect.log(`finised running ${requests.length} requests`),
    );
  • Flipped scheduleForked types to match new <A, E, R> signature

  • 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.

  • Expose Random Tag and functions to use a specific random service implementation

  • Fix Cause.pretty when toString is invalid

    import { Cause } from "effect";
    
    console.log(Cause.pretty(Cause.fail([{ toString: "" }])));

    The code above used to throw now it prints:

    Error: [{"toString":""}]
  • 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.

    import { satisfies } from "effect/Function";
    
    const test1 = satisfies<number>()(5 as const);
    // ^? const test: 5
    
    // @ts-expect-error
    const test2 = satisfies<string>()(5);
    // ^? Argument of type 'number' is not assignable to parameter of type 'string'
  • Generate a random span id for the built-in tracer

    This ensures the same span id isn't used between application runs.

  • Fix withRandom and withClock types

  • Fix internals of TestAnnotationsMap making it respect equality

  • Add Runtime.updateFiberRefs/setFiberRef/deleteFiberRef

    This change allows you to update fiber ref values inside a Runtime object.

    Example:

    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));

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.