github Effect-TS/effect @effect/platform-bun@0.32.29

latest releases: @effect/typeclass@0.29.14, @effect/vitest@0.13.14, @effect/sql-sqlite-wasm@0.20.5...
7 months ago

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

Don't miss a new effect release

NewReleases is sending notifications on new releases.