Releases: Effect-TS/effect
@effect/platform-node-shared@0.3.16
Patch Changes
-
#2387
75a8d16
Thanks @tim-smart! - add Cookies module to /platform httpTo 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
Patch Changes
-
#2387
75a8d16
Thanks @tim-smart! - add Cookies module to /platform httpTo 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
Patch Changes
-
#2387
75a8d16
Thanks @tim-smart! - add Cookies module to /platform httpTo 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
Patch Changes
-
#2385
3307729
Thanks @tim-smart! - update typescript to 5.4 -
Updated dependencies [
3307729
]:- effect@2.4.12
@effect/experimental@0.14.1
@effect/cli@0.35.18
effect@2.4.11
Patch Changes
-
#2384
2f488c4
Thanks @tim-smart! - update dependencies -
#2381
37ca592
Thanks @tim-smart! - add fiber ref for disabling the tracerYou 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