Skip to content

Releases: Effect-TS/effect

@effect/platform-node-shared@0.3.16

24 Mar 22:30
0a92b7f
Compare
Choose a tag to compare

Patch Changes

  • #2387 75a8d16 Thanks @tim-smart! - add Cookies module to /platform http

    To add cookies to a http response:

    import * as Http from "@effect/platform/HttpServer";
    
    Http.response.empty().pipe(
      Http.response.setCookies([
        ["name", "value"],
        ["foo", "bar", { httpOnly: true }],
      ]),
    );

    You can also use cookies with the http client:

    import * as Http from "@effect/platform/HttpClient";
    import { Effect, Ref } from "effect";
    
    Effect.gen(function* (_) {
      const ref = yield* _(Ref.make(Http.cookies.empty));
      const defaultClient = yield* _(Http.client.Client);
      const clientWithCookies = defaultClient.pipe(
        Http.client.withCookiesRef(ref),
        Http.client.filterStatusOk,
      );
    
      // cookies will be stored in the ref and sent in any subsequent requests
      yield* _(
        Http.request.get("https://www.google.com/"),
        clientWithCookies,
        Effect.scoped,
      );
    });
  • #2385 3307729 Thanks @tim-smart! - update typescript to 5.4

  • Updated dependencies [75a8d16, 3307729]:

    • @effect/platform@0.48.16
    • effect@2.4.12

@effect/platform-bun@0.32.29

24 Mar 22:30
0a92b7f
Compare
Choose a tag to compare

Patch Changes

  • #2387 75a8d16 Thanks @tim-smart! - add Cookies module to /platform http

    To add cookies to a http response:

    import * as Http from "@effect/platform/HttpServer";
    
    Http.response.empty().pipe(
      Http.response.setCookies([
        ["name", "value"],
        ["foo", "bar", { httpOnly: true }],
      ]),
    );

    You can also use cookies with the http client:

    import * as Http from "@effect/platform/HttpClient";
    import { Effect, Ref } from "effect";
    
    Effect.gen(function* (_) {
      const ref = yield* _(Ref.make(Http.cookies.empty));
      const defaultClient = yield* _(Http.client.Client);
      const clientWithCookies = defaultClient.pipe(
        Http.client.withCookiesRef(ref),
        Http.client.filterStatusOk,
      );
    
      // cookies will be stored in the ref and sent in any subsequent requests
      yield* _(
        Http.request.get("https://www.google.com/"),
        clientWithCookies,
        Effect.scoped,
      );
    });
  • #2385 3307729 Thanks @tim-smart! - update typescript to 5.4

  • Updated dependencies [75a8d16, 3307729]:

    • @effect/platform-node-shared@0.3.16
    • @effect/platform@0.48.16
    • effect@2.4.12

@effect/platform-browser@0.31.16

24 Mar 22:30
0a92b7f
Compare
Choose a tag to compare

Patch Changes

  • #2387 75a8d16 Thanks @tim-smart! - add Cookies module to /platform http

    To add cookies to a http response:

    import * as Http from "@effect/platform/HttpServer";
    
    Http.response.empty().pipe(
      Http.response.setCookies([
        ["name", "value"],
        ["foo", "bar", { httpOnly: true }],
      ]),
    );

    You can also use cookies with the http client:

    import * as Http from "@effect/platform/HttpClient";
    import { Effect, Ref } from "effect";
    
    Effect.gen(function* (_) {
      const ref = yield* _(Ref.make(Http.cookies.empty));
      const defaultClient = yield* _(Http.client.Client);
      const clientWithCookies = defaultClient.pipe(
        Http.client.withCookiesRef(ref),
        Http.client.filterStatusOk,
      );
    
      // cookies will be stored in the ref and sent in any subsequent requests
      yield* _(
        Http.request.get("https://www.google.com/"),
        clientWithCookies,
        Effect.scoped,
      );
    });
  • #2385 3307729 Thanks @tim-smart! - update typescript to 5.4

  • Updated dependencies [75a8d16, 3307729]:

    • @effect/platform@0.48.16
    • effect@2.4.12

@effect/opentelemetry@0.31.22

24 Mar 22:30
0a92b7f
Compare
Choose a tag to compare

Patch Changes

@effect/experimental@0.14.1

24 Mar 22:29
0a92b7f
Compare
Choose a tag to compare

Patch Changes

@effect/cli@0.35.18

24 Mar 22:29
0a92b7f
Compare
Choose a tag to compare

Patch Changes

effect@2.4.11

22 Mar 03:02
706b64d
Compare
Choose a tag to compare

Patch Changes

  • #2384 2f488c4 Thanks @tim-smart! - update dependencies

  • #2381 37ca592 Thanks @tim-smart! - add fiber ref for disabling the tracer

    You can use it with the Effect.withTracerEnabled api:

    import { Effect } from "effect";
    
    Effect.succeed(42).pipe(
      Effect.withSpan("my-span"),
      // the span will not be registered with the tracer
      Effect.withTracerEnabled(false),
    );
  • #2383 317b5b8 Thanks @tim-smart! - add Duration.isFinite api, to determine if a duration is not Infinity

@effect/vitest@0.1.1

22 Mar 03:03
706b64d
Compare
Choose a tag to compare

Patch Changes

@effect/typeclass@0.23.11

22 Mar 03:03
706b64d
Compare
Choose a tag to compare

Patch Changes

@effect/schema@0.64.11

22 Mar 03:03
706b64d
Compare
Choose a tag to compare

Patch Changes