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

Version Packages #2195

Merged
merged 1 commit into from
Feb 21, 2024
Merged

Version Packages #2195

merged 1 commit into from
Feb 21, 2024

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Feb 21, 2024

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

@effect/cli@0.34.0

Minor Changes

  • #2101 a025b12 Thanks @github-actions! - Swap type params of Either from Either<E, A> to Either<R, L = never>.

    Along the same line of the other changes this allows to shorten the most common types such as:

    import { Either } from "effect";
    
    const right: Either.Either<string> = Either.right("ok");

Patch Changes

effect@2.4.0

Minor Changes

  • #2101 5de7be5 Thanks @github-actions! - remove ReadonlyRecord.fromIterable (duplicate of fromEntries)

  • #2101 489fcf3 Thanks @github-actions! - - swap Schedule type parameters from Schedule<out Env, in In, out Out> to Schedule<out Out, in In = unknown, out R = never>, closes From Discord: Proposed Change to Schedule Class Parameters #2154

    • swap ScheduleDriver type parameters from ScheduleDriver<out Env, in In, out Out> to ScheduleDriver<out Out, in In = unknown, out R = never>
  • #2101 7d9c3bf Thanks @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.

    declare const async: <A, E = never, R = never>(
      register: (
        callback: (_: Effect<A, E, R>) => void,
        signal: AbortSignal,
      ) => void | Effect<void, never, R>,
      blockingOn?: FiberId,
    ) => Effect<A, E, R>;

    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.

    declare const async: <A, E = never, R = never>(
      register: (emit: Emit<R, E, A, void>) => Effect<void, never, R> | void,
      outputBuffer?: number,
    ) => Stream<A, E, R>;
  • #2101 d8d278b Thanks @github-actions! - swap GroupBy type parameters from GroupBy<out R, out E, out K, out V> to GroupBy<out K, out V, out E = never, out R = never>

  • #2101 14c5711 Thanks @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:

    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:

    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 5de7be5 Thanks @github-actions! - add key type to ReadonlyRecord

  • #2101 585fcce Thanks @github-actions! - add support for optional property keys to pick, omit and get

    Before:

    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<string, number> = {};
    
    const y = pipe(record, S.pick("a", "b"));
    console.log(y); // => { a: undefined, b: undefined }
    
    // error
    console.log(pipe(struct, S.get("a")));

    Now

    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<string, number> = {};
    
    const y = pipe(record, S.pick("a", "b"));
    console.log(y); // => {}
    
    console.log(pipe(struct, S.get("a"))); // => undefined
  • #2101 a025b12 Thanks @github-actions! - Swap type params of Either from Either<E, A> to Either<R, L = never>.

    Along the same line of the other changes this allows to shorten the most common types such as:

    import { Either } from "effect";
    
    const right: Either.Either<string> = Either.right("ok");

Patch Changes

@effect/platform@0.46.0

Minor Changes

Patch Changes

@effect/platform-node-shared@0.2.0

Minor Changes

  • #2101 a025b12 Thanks @github-actions! - Swap type params of Either from Either<E, A> to Either<R, L = never>.

    Along the same line of the other changes this allows to shorten the most common types such as:

    import { Either } from "effect";
    
    const right: Either.Either<string> = Either.right("ok");

Patch Changes

@effect/schema@0.63.0

Minor Changes

  • #2101 54ddbb7 Thanks @github-actions! - Updated the MessageAnnotation type to accept a ParseIssue; it's now (issue: ParseResult.ParseIssue) => string to support custom error messages, which can be triggered under any circumstances.

    You can retrieve the actual value by accessing the actual property of the issue object:

    import * as S from "@effect/schema/Schema";
    
    const schema = S.string.pipe(
      S.filter((s): s is string => s.length === 1, {
    -    message: (actual) => `invalid value ${actual}`,
    +    message: (issue) => `invalid value ${issue.actual}`,
      })
    );
  • #2101 a025b12 Thanks @github-actions! - Swap type params of Either from Either<E, A> to Either<R, L = never>.

    Along the same line of the other changes this allows to shorten the most common types such as:

    import { Either } from "effect";
    
    const right: Either.Either<string> = Either.right("ok");

Patch Changes

@effect/typeclass@0.23.0

Minor Changes

  • #2101 5de7be5 Thanks @github-actions! - add key type to ReadonlyRecord

  • #2101 a025b12 Thanks @github-actions! - Swap type params of Either from Either<E, A> to Either<R, L = never>.

    Along the same line of the other changes this allows to shorten the most common types such as:

    import { Either } from "effect";
    
    const right: Either.Either<string> = Either.right("ok");

Patch Changes

@effect/experimental@0.9.17

Patch Changes

@effect/opentelemetry@0.31.10

Patch Changes

@effect/platform-browser@0.30.7

Patch Changes

@effect/platform-bun@0.32.7

Patch Changes

@effect/platform-node@0.44.8

Patch Changes

@effect/printer@0.31.9

Patch Changes

@effect/printer-ansi@0.32.9

Patch Changes

@effect/rpc@0.27.15

Patch Changes

@effect/rpc-http@0.26.15

Patch Changes

@mikearnaldi mikearnaldi merged commit 7356dd8 into main Feb 21, 2024
@mikearnaldi mikearnaldi deleted the changeset-release/main branch February 21, 2024 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
1 participant