Packages

effect

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

Your version

3.0.0

major16 Apr 2024Where it was published

3.22.5 is the newest release of 3.x.

In short

1 breaking14 new4 fixed

  • Breaking

    Release Effect 3.0 🎉

Security

2 advisories affect 3.0.0; 3.22.1 fixes them

Release note

Major Changes

  • Breaking

    Release Effect 3.0 🎉

Minor Changes

  • Close FiberHandle/FiberSet/FiberMap when it is released

    When they are closed, fibers can no longer be added to them.

  • Add preregisteredWords option to frequency metric key type

    You can use this to register a list of words to pre-populate the value of the
    metric.

    import { Metric } from "effect";
    
    const counts = Metric.frequency("counts", {
      preregisteredWords: ["a", "b", "c"],
    }).register();
  • Bump TypeScript min requirement to version 5.4

  • Add unique identifier to Tracer.ParentSpan tag

  • Renamed ReadonlyArray and ReadonlyRecord modules for better discoverability.

  • The signatures of the HaltStrategy.match StreamHaltStrategy.match functions have been changed to the generally accepted ones

  • Support variadic arguments in Effect.log

    This makes Effect.log more similar to console.log:

    Effect.log("hello", { foo: "bar" }, Cause.fail("error"));
  • Fix ConfigError _tag, with the previous implementation catching the ConfigError with Effect.catchTag would show And, Or, etc.

  • Replace use of unit terminology with void

    For all the data types.

    Effect.unit; // => Effect.void
    Stream.unit; // => Stream.void
    
    // etc
  • Either: Fix getEquivalence parameter order from Either.getEquivalence(left, right) to Either.getEquivalence({ left, right })

  • Use LazyArg for Effect.if branches

    Instead of:

    Effect.if(true, {
      onTrue: Effect.succeed("true"),
      onFalse: Effect.succeed("false"),
    });

    You should now write:

    Effect.if(true, {
      onTrue: () => Effect.succeed("true"),
      onFalse: () => Effect.succeed("false"),
    });
  • Replaced custom NoInfer type with the native NoInfer type from TypeScript 5.4

  • Cache<Key, Error, Value> has been changed to Cache<Key, Value, Error = never>.
    ScopedCache<Key, Error, Value> has been changed to ScopedCache<Key, Value, Error = never>.
    Lookup<Key, Environment, Error, Value> has been changed to Lookup<Key, Value, Error = never, Environment = never>

Patch Changes

  • Don't run resolver if there are no incomplete requests

  • Add FiberMap.has/unsafeHas api

  • Add String casing transformation apis

    • snakeToCamel

    • snakeToPascal

    • snakeToKebab

    • camelToSnake

    • pascalToSnake

    • kebabToSnake

  • Add FiberHandle module, for holding a reference to a running fiber

    import { Effect, FiberHandle } from "effect";
    
    Effect.gen(function* (_) {
      const handle = yield* _(FiberHandle.make());
    
      // run some effects
      yield* _(FiberHandle.run(handle, Effect.never));
      // this will interrupt the previous fiber
      yield* _(FiberHandle.run(handle, Effect.never));
      // this will not run, as a fiber is already running
      yield* _(FiberHandle.run(handle, Effect.never, { onlyIfMissing: true }));
    
      yield* _(Effect.sleep(1000));
    }).pipe(
      Effect.scoped, // The fiber will be interrupted when the scope is closed
    );
  • Change return type of Fiber.joinAll to return an array

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.