Skip to content
Effect Days 2026 Get your ticket

@effect/platform

0.97.2

Patch Changes

  • #7998 2e471d9 Thanks @javascript-unsafe! - Fix multipart limit failures being silently ignored.

  • Updated dependencies [291d5a9, 7c6e1e5]:

    • effect@3.22.2

0.97.1

Patch Changes

  • #6652 e5dfd78 Thanks @IMax153! - Add an extendEnv option to Command.env for spawning commands with a clean environment.

  • #6774 4b03605 Thanks @tim-smart! - Reject empty, . and .. keys in file-backed key-value stores.

  • #6311 8a405fd Thanks @tim-smart! - update multipasta

  • #6756 8ee801d Thanks @tim-smart! - Fix a security issue in HTML escaping for generated Scalar and Swagger API documentation.

  • #6765 5859b37 Thanks @tim-smart! - Reject invalid cookie names and cookie attribute separators in domains and paths.

  • Updated dependencies [7ccbd9c, ab2af6d, 3cc3c6e, 3d390f2, fcabf08, 735d81b]:

    • effect@3.22.1

0.97.0

Patch Changes

  • Updated dependencies [fffdee0]:
    • effect@3.22.0

0.96.3

Patch Changes

  • #6244 99d5575 Thanks @spokodev! - Fix HttpLayerRouter.addHttpApi so two registered APIs no longer share error encoders. Previously each call’s middleware was added to a shared context map and applied to every route, so a 500 response from one API was sometimes encoded against the other API’s error schema. The fix scopes each API’s middleware to its own endpoints (matched by method + path) and wraps each route handler directly.

  • Updated dependencies [307d54a, d95868a, 95c7d2e, d24511f]:

    • effect@3.21.5

0.96.2

Patch Changes

  • #6273 7e00169 Thanks @tim-smart! - Remove the content-length header before sending FetchHttpClient requests.

  • Updated dependencies [8222963]:

    • effect@3.21.4

0.96.1

Patch Changes

  • #6147 518d0e3 Thanks @syhstanley! - Fix HttpLayerRouter.addHttpApi silently skipping API-level middleware.

  • #6191 c016642 Thanks @IGassmann! - Update msgpackr to 1.11.10 to fix silent decode failures in environments that block new Function() at runtime (e.g. Cloudflare Workers). The new version wraps the JIT new Function() call in a try/catch, falling back to the interpreted path when dynamic code evaluation is blocked.

  • Updated dependencies [74f3267]:

    • effect@3.21.2

0.96.0

Patch Changes

0.95.0

Patch Changes

0.94.5

Patch Changes

  • #6050 d67c708 Thanks @tim-smart! - Backport Effect 4 contentType support for HttpBody JSON / URL-encoded constructors and HttpServerResponse JSON / URL-encoded helpers.

  • Updated dependencies [a8c436f]:

    • effect@3.19.17

0.94.4

Patch Changes

  • #6035 22d9d27 Thanks @tim-smart! - Fix HttpServerError.causeResponse to prefer 499 when a client abort interrupt is present.

0.94.3

Patch Changes

  • #6021 0023c19 Thanks @codewithkenzo! - Fix HttpClientRequest.appendUrl to properly join URL paths.

    Previously, appendUrl used simple string concatenation which could produce invalid URLs:

    // Before (broken):
    appendUrl("https://api.example.com/v1", "users")
    // Result: "https://api.example.com/v1users" (missing slash!)

    Now it ensures proper path joining:

    // After (fixed):
    appendUrl("https://api.example.com/v1", "users")
    // Result: "https://api.example.com/v1/users"
  • #6019 9a96b87 Thanks @codewithkenzo! - Fix retryTransient to use correct transient status codes

    Changed isTransientResponse from status >= 429 to an explicit allowlist (408, 429, 500, 502, 503, 504). This correctly excludes 501 (Not Implemented) and 505+ permanent errors, while including 408 (Request Timeout) which was previously missed.

    Also aligned response retry behavior with v4: the while predicate now only applies to error retries, not response retries. Response retries are determined solely by isTransientResponse. This matches the semantic intent since while is typed for errors, not responses.

    Fixes #5995

  • Updated dependencies [e71889f]:

    • effect@3.19.16

0.94.2

Patch Changes

0.94.1

Patch Changes

  • #5936 65e9e35 Thanks @schickling! - Document subtle CORS middleware allowedHeaders behavior: when empty array (default), it reflects back the client’s Access-Control-Request-Headers (permissive), and when non-empty array, it only allows specified headers (restrictive). Added comprehensive JSDoc with examples.

  • #5940 ee69cd7 Thanks @kitlangton! - HttpServerResponse: fix fromWeb to preserve Content-Type header when response has a body

    Previously, when converting a web Response to an HttpServerResponse via fromWeb, the Content-Type header was not passed to Body.stream(), causing it to default to application/octet-stream. This affected any code using HttpApp.fromWebHandler to wrap web handlers, as JSON responses would incorrectly have their Content-Type set to application/octet-stream instead of application/json.

  • Updated dependencies [488d6e8]:

    • effect@3.19.14

0.94.0

Minor Changes

  • #5917 ff7053f Thanks @tim-smart! - support non-errors in HttpClient.retryTransient

Patch Changes

0.93.8

Patch Changes

  • #5902 a0a84d8 Thanks @tim-smart! - add HttpApp.fromWebHandler

  • Updated dependencies [a6dfca9]:

    • effect@3.19.12

0.93.7

Patch Changes

  • #5896 65bff45 Thanks @tim-smart! - add basic apis for converting to web Request/Response

0.93.6

Patch Changes

  • #5835 25d1cb6 Thanks @tim-smart! - consider clean http interrupts as successful responses

0.93.5

Patch Changes

  • #5818 ebfbbd6 Thanks @KhraksMamtsov! - Support HttpApiError unification

0.93.4

Patch Changes

  • #5797 8ebd29e Thanks @tim-smart! - use original status code if headers have already been sent

0.93.3

Patch Changes

  • #5759 e144f02 Thanks @rohovskoi! - fix scalar configuration and types

0.93.2

Patch Changes

  • #5737 2bb8242 Thanks @tim-smart! - ensure HttpApiScalar source is tree-shakable

0.93.1

Patch Changes

  • #5728 1961185 Thanks @kitlangton! - Fix UrlParams.setAll overwrite semantics

0.93.0

Patch Changes

0.92.1

Patch Changes

  • #5588 f6987c0 Thanks @wmaurer! - add additional predicate typings for HttpMiddleware.cors allowOrigins

0.92.0

Patch Changes

0.91.1

Patch Changes

  • #5552 ffa494c Thanks @tim-smart! - allow predicates for HttpMiddleware.cors allowOrigins

0.91.0

Minor Changes

  • #5549 d4d86a8 Thanks @tim-smart! - remove msgpackr re-exports

0.90.10

Patch Changes

  • #5517 de07e58 Thanks @tim-smart! - add onOpen option to Socket.run

0.90.9

Patch Changes

  • #5492 0421c8c Thanks @tim-smart! - provide http span to global middleware

0.90.8

Patch Changes

  • #5481 333be04 Thanks @jpowersdev! - Allow user to set extension of file created using FileSystem.makeTempFile

0.90.7

Patch Changes

  • #5466 75dffc8 Thanks @tim-smart! - ensure HttpApiClient adds encoding contentType to headers

0.90.6

Patch Changes

  • #5418 7ad7b3c Thanks @tim-smart! - exclude layer services from HttpLayerRouter.toWebHandler request context

0.90.5

Patch Changes

  • #5410 fef9771 Thanks @beeman! - export isQuitExection function from @effect/platform/Terminal

  • Updated dependencies [84bc300]:

    • effect@3.17.8

0.90.4

Patch Changes

  • #5402 8c7bb52 Thanks @tim-smart! - abort HttpClientResponse.stream regardless of how stream ends

  • #5397 0e46e24 Thanks @IMax153! - Avoid issues with ESM builds by removing dependency on @opentelemetry/semantic-conventions

0.90.3

Patch Changes

  • #5391 786867b Thanks @tim-smart! - support multiple HttpLayerRouter.addHttpApi

0.90.2

Patch Changes

  • #5357 99302f4 Thanks @nounder! - Add HttpServerResponse.expireCookie

0.90.1

Patch Changes

  • #5355 27a4e02 Thanks @nounder! - Use 302 Found status in HttpServerResponse.redirect as default

0.90.0

Minor Changes

  • #5258 7813640 Thanks @kitlangton! - Changes Terminal.readInput to return a ReadonlyMailbox of events

    This allows for more efficient handling of input events, as well as ensuring events are not lost.

0.89.0

Patch Changes

0.88.2

Patch Changes

  • #5234 de513d9 Thanks @tim-smart! - ensure duplicate paths are a defect in HttpApi

0.88.1

Patch Changes

  • #5192 17a5ea8 Thanks @nikelborm! - Updated deprecated OTel Resource attributes names and values.

    Many of the attributes have undergone the process of deprecation not once, but twice. Most of the constants holding attribute names have been renamed. These are minor changes.

    Additionally, there were numerous changes to the attribute keys themselves. These changes can be considered major.

    In the @opentelemetry/semantic-conventions package, new attributes having ongoing discussion about them are going through a process called incubation, until a consensus about their necessity and form is reached. Otel team recommends devs to copy them directly into their code. Luckily, it’s not necessary because all of the new attribute names and values came out of this process (some of them were changed again) and are now considered stable.

    Reasoning for minor version bump

    PackageMajor attribute changesMajor value changes
    Clickhouse clientdb.system -> db.system.name
    db.name -> db.namespace
    MsSQL clientdb.system -> db.system.name
    db.name -> db.namespace
    mssql -> microsoft.sql_server
    MySQL clientdb.system -> db.system.name
    db.name -> db.namespace
    Pg clientdb.system -> db.system.name
    db.name -> db.namespace
    Bun SQLite clientdb.system -> db.system.name
    Node SQLite clientdb.system -> db.system.name
    React.Native SQLite clientdb.system -> db.system.name
    Wasm SQLite clientdb.system -> db.system.name
    SQLite Do clientdb.system -> db.system.name
    LibSQL clientdb.system -> db.system.name
    D1 clientdb.system -> db.system.name
    Kysely clientdb.statement -> db.query.text
    @effect/sqldb.statement -> db.query.text
    db.operation -> db.operation.name
  • #5211 d25f22b Thanks @mattiamanzati! - Removed some unnecessary single-arg pipe calls

  • Updated dependencies [f5dfabf, 17a5ea8, d25f22b]:

    • effect@3.16.14

0.88.0

Minor Changes

  • #5208 dbabf5e Thanks @tim-smart! - consolidate Http web handler layer apis

Patch Changes

  • #5206 27206d7 Thanks @tim-smart! - lazily build HttpLayerRouter web handlers

0.87.13

Patch Changes

0.87.12

Patch Changes

  • #5177 32ba77a Thanks @johtso! - Fix KeyValueStore.make type mismatch

  • #5174 d5e25b2 Thanks @schickling! - feat(platform): add recursive option to FileSystem.watch

    Added a recursive option to FileSystem.watch that allows watching for changes in subdirectories. When set to true, the watcher will monitor changes in all nested directories.

    Note: The recursive option is only supported on macOS and Windows. On other platforms, it will be ignored.

    Example:

    import { FileSystem } from "@effect/platform"
    import { Effect, Stream } from "effect"
    Effect.gen(function* () {
    const fs = yield* FileSystem.FileSystem
    // Watch directory and all subdirectories
    yield* fs
    .watch("src", { recursive: true })
    .pipe(Stream.runForEach(console.log))
    })

0.87.11

Patch Changes

  • #5184 001392b Thanks @tim-smart! - ensure HttpApiClient schemas are composed correctly

  • #5181 7bfb099 Thanks @tim-smart! - update find-my-way-ts

0.87.10

Patch Changes

  • #5175 678318d Thanks @tim-smart! - rename HttpLayerRouter.Type to Request

  • #5175 678318d Thanks @tim-smart! - propagate headers to HttpServerResponse.raw(Response)

0.87.9

Patch Changes

  • #5170 54514a2 Thanks @tim-smart! - add HttpLayerRouter.toWebHandler

0.87.8

Patch Changes

  • #5166 4ce4f82 Thanks @tim-smart! - add global middleware to HttpLayerRouter

0.87.7

Patch Changes

  • #5153 a9b617f Thanks @thewilkybarkid! - Fix UrlParams.toRecord when there’s a proto key

  • #5159 7e26e86 Thanks @tim-smart! - add HttpLayerRouter.add & addAll apis

0.87.6

Patch Changes

  • Updated dependencies [905da99]:
    • effect@3.16.12

0.87.5

Patch Changes

  • #5142 2fd8676 Thanks @tim-smart! - improve type safety of HttpLayerRouter.middleware error handling

0.87.4

Patch Changes

  • #5137 e82a4fd Thanks @tim-smart! - move HttpLayerRouter request errors to Layer error channel

0.87.3

Patch Changes

  • #5128 1b6e396 Thanks @tim-smart! - attach http request scope to stream lifetime for stream responses

0.87.2

Patch Changes

0.87.1

Patch Changes

  • Updated dependencies [faad30e]:
    • effect@3.16.10

0.87.0

Minor Changes

  • #5087 b5bac9a Thanks @tim-smart! - add HttpApiClient.makeWith, for supporting passing in HttpClient with errors and requirements

0.86.0

Minor Changes

  • #5081 5137c70 Thanks @tim-smart! - use Context.Reference for Multipart configuration

Patch Changes

  • #5081 5137c70 Thanks @tim-smart! - allow configuring multipart limits in HttpApiSchema.Multipart

  • Updated dependencies [5137c70, c23d25c]:

    • effect@3.16.9

0.85.2

Patch Changes

  • #5053 914a191 Thanks @tim-smart! - fix retrieval of HttpApiSchema.param annotations

0.85.1

Patch Changes

0.85.0

Minor Changes

  • #5042 93687dd Thanks @tim-smart! - HttpApiBuilder .handleRaw no longer parses the request body

Patch Changes

  • #5042 93687dd Thanks @tim-smart! - allow return HttpServerResponse from HttpApiBuilder .handle

  • #5042 93687dd Thanks @tim-smart! - add HttpApiSchema.MultipartStream

0.84.11

Patch Changes

  • Updated dependencies [1bb0d8a]:
    • effect@3.16.7

0.84.10

Patch Changes

0.84.9

Patch Changes

  • Updated dependencies [bf418ef]:
    • effect@3.16.5

0.84.8

Patch Changes

  • #4996 8b9db77 Thanks @tim-smart! - allow literals in HttpApiSchema.param

0.84.7

Patch Changes

0.84.6

Patch Changes

  • #4975 ceea77a Thanks @tim-smart! - allow wrapping a web Response with HttpServerResponse.raw on some platforms

0.84.5

Patch Changes

  • #4964 ec52c6a Thanks @tim-smart! - ensure HttpApi security middleware cache is not shared

0.84.4

Patch Changes

0.84.3

Patch Changes

  • #4941 ab7684f Thanks @tim-smart! - decode HttpApiClient response from ArrayBuffer

0.84.2

Patch Changes

  • Updated dependencies [0ddf148]:
    • effect@3.16.2

0.84.1

Patch Changes

  • #4936 71174d0 Thanks @mattiamanzati! - Escape JSON Schema $id for empty struct

  • Updated dependencies [71174d0, d615e6e]:

    • effect@3.16.1

0.84.0

Patch Changes

0.83.0

Minor Changes

  • #4932 5522520 Thanks @tim-smart! - refactor PlatformError and make it a schema

Patch Changes

  • Updated dependencies [cc5bb2b]:
    • effect@3.15.5

0.82.8

Patch Changes

  • #4927 0617b9d Thanks @fubhy! - Fix package internal imports

0.82.7

Patch Changes

  • #4921 c20b95a Thanks @tim-smart! - update /platform dependencies

  • #4916 94ada43 Thanks @mattiamanzati! - Fix missing encoding of path parameters in HttpApiClient

  • Updated dependencies [f570554, 78047e8]:

    • effect@3.15.4

0.82.6

Patch Changes

  • #4855 618903b Thanks @gcanti! - Enhance OpenAPI documentation handling by adding safe serialization and HTML escaping functions. This prevents script injection and ensures valid JSON output in the Swagger UI

0.82.5

Patch Changes

  • #4912 7764a07 Thanks @tim-smart! - add HttpClient.withScope, for tying the lifetime of the request to a Scope

  • #4909 30a0d9c Thanks @tim-smart! - add HttpClientRequest.toUrl

  • Updated dependencies [4577f54]:

    • effect@3.15.3

0.82.4

Patch Changes

  • #4896 d45e8a8 Thanks @seniorkonung! - Handle Respondable defects in toResponseOrElseDefect

  • #4890 d13b68e Thanks @KhraksMamtsov! - Url.setPassword supports Redacted<string> values

0.82.3

Patch Changes

  • #4889 a328f4b Thanks @tim-smart! - add HttpBody.formDataRecord

  • Updated dependencies [b8722b8]:

    • effect@3.15.2

0.82.2

Patch Changes

  • #4882 739a3d4 Thanks @tim-smart! - remove content headers for FormData bodies

0.82.1

Patch Changes

0.82.0

Minor Changes

  • #4641 a9b3fb7 Thanks @thewilkybarkid! - Allow removing multiple Headers

Patch Changes

0.81.1

Patch Changes

  • Updated dependencies [24a9ebb]:
    • effect@3.14.22

0.81.0

Minor Changes

  • #4842 672920f Thanks @tim-smart! - allow overriding http span names

    import { FetchHttpClient, HttpClient } from "@effect/platform"
    import { NodeRuntime } from "@effect/platform-node"
    import { Effect } from "effect"
    Effect.gen(function* () {
    const client = (yield* HttpClient.HttpClient).pipe(
    // Customize the span names for this HttpClient
    HttpClient.withSpanNameGenerator(
    (request) => `http.client ${request.method} ${request.url}`
    )
    )
    yield* client.get("https://jsonplaceholder.typicode.com/posts/1")
    }).pipe(Effect.provide(FetchHttpClient.layer), NodeRuntime.runMain)

    And for a server:

    import {
    HttpMiddleware,
    HttpRouter,
    HttpServer,
    HttpServerResponse
    } from "@effect/platform"
    import { NodeHttpServer, NodeRuntime } from "@effect/platform-node"
    import { Layer } from "effect"
    import { createServer } from "http"
    HttpRouter.empty.pipe(
    HttpRouter.get("/", HttpServerResponse.empty()),
    HttpServer.serve(),
    // Customize the span names for this HttpApp
    HttpMiddleware.withSpanNameGenerator((request) => `GET ${request.url}`),
    Layer.provide(NodeHttpServer.layer(createServer, { port: 3000 })),
    Layer.launch,
    NodeRuntime.runMain
    )

0.80.21

Patch Changes

  • Updated dependencies [2f3b7d4]:
    • effect@3.14.21

0.80.20

Patch Changes

  • Updated dependencies [17e2f30]:
    • effect@3.14.20

0.80.19

Patch Changes

  • #4821 e25e7bb Thanks @seniorkonung! - Ensure HttpApp defects are always 500

  • Updated dependencies [056a910, 3273d57]:

    • effect@3.14.19

0.80.18

Patch Changes

  • Updated dependencies [b1164d4]:
    • effect@3.14.18

0.80.17

Patch Changes

0.80.16

Patch Changes

  • #4803 f1c8583 Thanks @tim-smart! - expose uninteruptible option to HttpApiBuilder .handle apis

  • Updated dependencies [ee14444]:

    • effect@3.14.16

0.80.15

Patch Changes

0.80.14

Patch Changes

  • Updated dependencies [6ed8d15]:
    • effect@3.14.14

0.80.13

Patch Changes

0.80.12

Patch Changes

0.80.11

Patch Changes

  • Updated dependencies [e536127]:
    • effect@3.14.11

0.80.10

Patch Changes

  • Updated dependencies [bc7efa3]:
    • effect@3.14.10

0.80.9

Patch Changes

  • Updated dependencies [d78249f]:
    • effect@3.14.9

0.80.8

Patch Changes

  • Updated dependencies [b3a2d32]:
    • effect@3.14.8

0.80.7

Patch Changes

  • Updated dependencies [b542a4b]:
    • effect@3.14.7

0.80.6

Patch Changes

0.80.5

Patch Changes

0.80.4

Patch Changes

  • Updated dependencies [e4ba2c6]:
    • effect@3.14.4

0.80.3

Patch Changes

0.80.2

Patch Changes

0.80.1

Patch Changes

  • Updated dependencies [4a274fe]:
    • effect@3.14.1

0.80.0

Minor Changes

  • #4469 3131f8f Thanks @tim-smart! - refactor of @effect/cluster packages

Patch Changes

0.79.4

Patch Changes

  • #4592 5662363 Thanks @tim-smart! - support nested records in UrlParams module

  • #4615 5f1fd15 Thanks @KhraksMamtsov! - - Relax Url.setPort constraint

    • Use URL | ... for baseUrl in HttpApiClient.make
  • #4614 8bb1460 Thanks @gcanti! - HttpApiEndpoint: add missing head and options constructors, closes #4613.

0.79.3

Patch Changes

0.79.2

Patch Changes

0.79.1

Patch Changes

  • Updated dependencies [527c964]:
    • effect@3.13.10

0.79.0

Minor Changes

  • #4573 88fe129 Thanks @tim-smart! - remove Scope from HttpClient requirements

    Before:

    import { HttpClient } from "@effect/platform"
    import { Effect } from "effect"
    Effect.gen(function* () {
    const client = yield* HttpClient.HttpClient
    const response = yield* client.get("https://api.github.com/users/octocat")
    return yield* response.json
    }).pipe(Effect.scoped)

    After:

    import { HttpClient } from "@effect/platform"
    import { Effect } from "effect"
    Effect.gen(function* () {
    const client = yield* HttpClient.HttpClient
    const response = yield* client.get("https://api.github.com/users/octocat")
    return yield* response.json
    }) // no need to add Effect.scoped

Patch Changes

  • #4583 d630249 Thanks @tim-smart! - support Layer.launch when using WorkerRunner

  • Updated dependencies [2976e52]:

    • effect@3.13.9

0.78.1

Patch Changes

0.78.0

Minor Changes

  • #4562 c5bcf53 Thanks @tim-smart! - expose ParseError in HttpApiClient

0.77.7

Patch Changes

  • #4540 840cc73 Thanks @gcanti! - Add additionalPropertiesStrategy option to OpenApi.fromApi, closes #4531.

    This update introduces the additionalPropertiesStrategy option in OpenApi.fromApi, allowing control over how additional properties are handled in the generated OpenAPI schema.

    • When "strict" (default), additional properties are disallowed ("additionalProperties": false).
    • When "allow", additional properties are allowed ("additionalProperties": true), making APIs more flexible.

    The additionalPropertiesStrategy option has also been added to:

    • JSONSchema.fromAST
    • OpenApiJsonSchema.makeWithDefs

    Example

    import {
    HttpApi,
    HttpApiEndpoint,
    HttpApiGroup,
    OpenApi
    } from "@effect/platform"
    import { Schema } from "effect"
    const api = HttpApi.make("api").add(
    HttpApiGroup.make("group").add(
    HttpApiEndpoint.get("get", "/").addSuccess(
    Schema.Struct({ a: Schema.String })
    )
    )
    )
    const schema = OpenApi.fromApi(api, {
    additionalPropertiesStrategy: "allow"
    })
    console.log(JSON.stringify(schema, null, 2))
    /*
    {
    "openapi": "3.1.0",
    "info": {
    "title": "Api",
    "version": "0.0.1"
    },
    "paths": {
    "/": {
    "get": {
    "tags": [
    "group"
    ],
    "operationId": "group.get",
    "parameters": [],
    "security": [],
    "responses": {
    "200": {
    "description": "Success",
    "content": {
    "application/json": {
    "schema": {
    "type": "object",
    "required": [
    "a"
    ],
    "properties": {
    "a": {
    "type": "string"
    }
    },
    "additionalProperties": true
    }
    }
    }
    },
    "400": {
    "description": "The request did not match the expected schema",
    "content": {
    "application/json": {
    "schema": {
    "$ref": "#/components/schemas/HttpApiDecodeError"
    }
    }
    }
    }
    }
    }
    }
    },
    "components": {
    "schemas": {
    "HttpApiDecodeError": {
    "type": "object",
    "required": [
    "issues",
    "message",
    "_tag"
    ],
    "properties": {
    "issues": {
    "type": "array",
    "items": {
    "$ref": "#/components/schemas/Issue"
    }
    },
    "message": {
    "type": "string"
    },
    "_tag": {
    "type": "string",
    "enum": [
    "HttpApiDecodeError"
    ]
    }
    },
    "additionalProperties": true,
    "description": "The request did not match the expected schema"
    },
    "Issue": {
    "type": "object",
    "required": [
    "_tag",
    "path",
    "message"
    ],
    "properties": {
    "_tag": {
    "type": "string",
    "enum": [
    "Pointer",
    "Unexpected",
    "Missing",
    "Composite",
    "Refinement",
    "Transformation",
    "Type",
    "Forbidden"
    ],
    "description": "The tag identifying the type of parse issue"
    },
    "path": {
    "type": "array",
    "items": {
    "$ref": "#/components/schemas/PropertyKey"
    },
    "description": "The path to the property where the issue occurred"
    },
    "message": {
    "type": "string",
    "description": "A descriptive message explaining the issue"
    }
    },
    "additionalProperties": true,
    "description": "Represents an error encountered while parsing a value to match the schema"
    },
    "PropertyKey": {
    "anyOf": [
    {
    "type": "string"
    },
    {
    "type": "number"
    },
    {
    "type": "object",
    "required": [
    "_tag",
    "key"
    ],
    "properties": {
    "_tag": {
    "type": "string",
    "enum": [
    "symbol"
    ]
    },
    "key": {
    "type": "string"
    }
    },
    "additionalProperties": true,
    "description": "an object to be decoded into a globally shared symbol"
    }
    ]
    }
    },
    "securitySchemes": {}
    },
    "security": [],
    "tags": [
    {
    "name": "group"
    }
    ]
    }
    */
  • #4541 9bf8a74 Thanks @fubhy! - Disallowed excess properties for various function options

  • #4559 f910880 Thanks @tim-smart! - add additional properties options to HttpApiBuilder.middlewareOpenApi

  • #4493 0d01480 Thanks @leonitousconforti! - FetchHttpClient merge headers from request and requestInit

  • Updated dependencies [840cc73, 9bf8a74, 87ba23c]:

    • effect@3.13.7

0.77.6

Patch Changes

  • Updated dependencies [3154ce4]:
    • effect@3.13.6

0.77.5

Patch Changes

0.77.4

Patch Changes

  • #4525 e0746f9 Thanks @anderssjoberg97! - Fix w3c traceparent header parsing

  • Updated dependencies [17d9e89]:

    • effect@3.13.4

0.77.3

Patch Changes

0.77.2

Patch Changes

  • #4456 3e7ce97 Thanks @tim-smart! - ensure key for header security is lower case

  • #4472 31be72a Thanks @gcanti! - Add support for Schema.Enums in HttpApiBuilder.isSingleStringType, closes #4471.

  • Updated dependencies [31be72a]:

    • effect@3.13.2

0.77.1

Patch Changes

  • Updated dependencies [b56a211]:
    • effect@3.13.1

0.77.0

Patch Changes

0.76.1

Patch Changes

  • #4444 c407726 Thanks @gcanti! - HttpApiBuilder: URL parameters are now automatically converted to arrays when needed, closes #4442.

    Example

    import {
    HttpApi,
    HttpApiBuilder,
    HttpApiEndpoint,
    HttpApiGroup,
    HttpMiddleware,
    HttpServer
    } from "@effect/platform"
    import { NodeHttpServer, NodeRuntime } from "@effect/platform-node"
    import { Effect, Layer, Schema } from "effect"
    import { createServer } from "node:http"
    const api = HttpApi.make("api").add(
    HttpApiGroup.make("group").add(
    HttpApiEndpoint.get("get", "/")
    .addSuccess(Schema.String)
    .setUrlParams(
    Schema.Struct({
    param: Schema.NonEmptyArray(Schema.String)
    })
    )
    )
    )
    const usersGroupLive = HttpApiBuilder.group(api, "group", (handlers) =>
    handlers.handle("get", (req) =>
    Effect.succeed(req.urlParams.param.join(", "))
    )
    )
    const MyApiLive = HttpApiBuilder.api(api).pipe(Layer.provide(usersGroupLive))
    const HttpLive = HttpApiBuilder.serve(HttpMiddleware.logger).pipe(
    Layer.provide(MyApiLive),
    HttpServer.withLogAddress,
    Layer.provide(NodeHttpServer.layer(createServer, { port: 3000 }))
    )
    Layer.launch(HttpLive).pipe(NodeRuntime.runMain)

    Previously, if a query parameter was defined as a NonEmptyArray (an array that requires at least one element), providing a single value would cause a parsing error.

    For example, this worked fine:

    Terminal window
    curl "http://localhost:3000/?param=1&param=2"

    But this would fail:

    Terminal window
    curl "http://localhost:3000/?param=1"

    Resulting in an error because "1" was treated as a string instead of an array.

    With this update, single values are automatically wrapped in an array, so they match the expected schema without requiring manual fixes.

  • Updated dependencies [4018eae, 543d36d, f70a65a, ba409f6, 3d2e356]:

    • effect@3.12.12

0.76.0

Minor Changes

  • #4429 2473ad5 Thanks @tim-smart! - run platform workers in a Scope, send errors or termination to a CloseLatch

Patch Changes

0.75.4

Patch Changes

0.75.3

Patch Changes

  • Updated dependencies [1b4a4e9]:
    • effect@3.12.9

0.75.2

Patch Changes

0.75.1

Patch Changes

  • Updated dependencies [8dff1d1]:
    • effect@3.12.7

0.75.0

Minor Changes

  • #4306 5e43ce5 Thanks @tim-smart! - eliminate Scope by default in some layer apis

Patch Changes

0.74.0

Minor Changes

  • #4264 6cb9b76 Thanks @gcanti! - Add support for symbols in the Issue definition within platform/HttpApiError.

Patch Changes

0.73.1

Patch Changes

0.73.0

Minor Changes

  • #4245 c110032 Thanks @gcanti! - Update HttpApi to remove wildcard support for better OpenAPI compatibility.

    The HttpApi* modules previously reused the following type from HttpRouter:

    type PathInput = `/${string}` | "*"

    However, the "*" wildcard value was not handled correctly, as OpenAPI does not support wildcards.

    This has been updated to use a more specific type:

    type PathSegment = `/${string}`

    This change ensures better alignment with OpenAPI specifications and eliminates potential issues related to unsupported wildcard paths.

  • #4237 23ac740 Thanks @gcanti! - Make OpenApiSpec mutable to make handling it more convenient.

Patch Changes

  • #4177 8cd7319 Thanks @KhraksMamtsov! - Url module has been introduced:

    • immutable setters with dual-function api
    • integration with UrlParams
  • Updated dependencies [d7dac48, 1d7fd2b, 1d7fd2b]:

    • effect@3.12.3

0.72.2

Patch Changes

  • #4226 212e784 Thanks @gcanti! - Ensure the encoding kind of success responses is respected in the OpenAPI spec.

    Before

    When generating an OpenAPI spec for a request with a success schema of type `HttpApiSchema.Text()“, the response content type was incorrectly set to “application/json” instead of “text/plain”.

    import {
    HttpApi,
    HttpApiEndpoint,
    HttpApiGroup,
    HttpApiSchema,
    OpenApi
    } from "@effect/platform"
    const api = HttpApi.make("api").add(
    HttpApiGroup.make("group").add(
    HttpApiEndpoint.get("get", "/").addSuccess(HttpApiSchema.Text())
    )
    )
    const spec = OpenApi.fromApi(api)
    console.log(JSON.stringify(spec.paths, null, 2))
    /*
    Output:
    {
    "/": {
    "get": {
    "tags": [
    "group"
    ],
    "operationId": "group.get",
    "parameters": [],
    "security": [],
    "responses": {
    "200": {
    "description": "a string",
    "content": {
    "application/json": {
    "schema": {
    "type": "string"
    }
    }
    }
    },
    "400": {
    "description": "The request did not match the expected schema",
    "content": {
    "application/json": {
    "schema": {
    "$ref": "#/components/schemas/HttpApiDecodeError"
    }
    }
    }
    }
    }
    }
    }
    }
    */

    After

    import {
    HttpApi,
    HttpApiEndpoint,
    HttpApiGroup,
    HttpApiSchema,
    OpenApi
    } from "@effect/platform"
    const api = HttpApi.make("api").add(
    HttpApiGroup.make("group").add(
    HttpApiEndpoint.get("get", "/").addSuccess(HttpApiSchema.Text())
    )
    )
    const spec = OpenApi.fromApi(api)
    console.log(JSON.stringify(spec.paths, null, 2))
    /*
    Output:
    {
    "/": {
    "get": {
    "tags": [
    "group"
    ],
    "operationId": "group.get",
    "parameters": [],
    "security": [],
    "responses": {
    "200": {
    "description": "a string",
    "content": {
    "application/json": {
    "text/plain": {
    "schema": {
    "type": "string"
    }
    }
    }
    },
    "400": {
    "description": "The request did not match the expected schema",
    "content": {
    "application/json": {
    "schema": {
    "$ref": "#/components/schemas/HttpApiDecodeError"
    }
    }
    }
    }
    }
    }
    }
    }
    */
  • #4234 f852cb0 Thanks @gcanti! - Deduplicate errors in OpenApi.fromApi.

    When multiple identical errors were added to the same endpoint, group, or API, they were all included in the generated OpenAPI specification, leading to redundant entries in the anyOf array for error schemas.

    Identical errors are now deduplicated in the OpenAPI specification. This ensures that each error schema is included only once, simplifying the generated spec and improving readability.

    Before

    import {
    HttpApi,
    HttpApiEndpoint,
    HttpApiGroup,
    OpenApi
    } from "@effect/platform"
    import { Schema } from "effect"
    const err = Schema.String.annotations({ identifier: "err" })
    const api = HttpApi.make("api")
    .add(
    HttpApiGroup.make("group1")
    .add(
    HttpApiEndpoint.get("get1", "/1")
    .addSuccess(Schema.String)
    .addError(err)
    .addError(err)
    )
    .addError(err)
    .addError(err)
    )
    .addError(err)
    .addError(err)
    const spec = OpenApi.fromApi(api)
    console.log(JSON.stringify(spec.paths, null, 2))
    /*
    Output:
    {
    "/1": {
    "get": {
    "tags": [
    "group1"
    ],
    "operationId": "group1.get1",
    "parameters": [],
    "security": [],
    "responses": {
    "200": {
    "description": "a string",
    "content": {
    "application/json": {
    "schema": {
    "type": "string"
    }
    }
    }
    },
    "400": {
    "description": "The request did not match the expected schema",
    "content": {
    "application/json": {
    "schema": {
    "$ref": "#/components/schemas/HttpApiDecodeError"
    }
    }
    }
    },
    "500": {
    "description": "a string",
    "content": {
    "application/json": {
    "schema": "schema": {
    "anyOf": [
    {
    "$ref": "#/components/schemas/err"
    },
    {
    "$ref": "#/components/schemas/err"
    },
    {
    "$ref": "#/components/schemas/err"
    }
    ]
    }
    }
    }
    }
    }
    }
    }
    }
    */

    After

    import {
    HttpApi,
    HttpApiEndpoint,
    HttpApiGroup,
    OpenApi
    } from "@effect/platform"
    import { Schema } from "effect"
    const err = Schema.String.annotations({ identifier: "err" })
    const api = HttpApi.make("api")
    .add(
    HttpApiGroup.make("group1")
    .add(
    HttpApiEndpoint.get("get1", "/1")
    .addSuccess(Schema.String)
    .addError(err)
    .addError(err)
    )
    .addError(err)
    .addError(err)
    )
    .addError(err)
    .addError(err)
    const spec = OpenApi.fromApi(api)
    console.log(JSON.stringify(spec.paths, null, 2))
    /*
    Output:
    {
    "/1": {
    "get": {
    "tags": [
    "group1"
    ],
    "operationId": "group1.get1",
    "parameters": [],
    "security": [],
    "responses": {
    "200": {
    "description": "a string",
    "content": {
    "application/json": {
    "schema": {
    "type": "string"
    }
    }
    }
    },
    "400": {
    "description": "The request did not match the expected schema",
    "content": {
    "application/json": {
    "schema": {
    "$ref": "#/components/schemas/HttpApiDecodeError"
    }
    }
    }
    },
    "500": {
    "description": "a string",
    "content": {
    "application/json": {
    "schema": {
    "$ref": "#/components/schemas/err"
    }
    }
    }
    }
    }
    }
    }
    }
    */
  • #4233 7276ae2 Thanks @gcanti! - Ensure the encoding kind of error responses is respected in the OpenAPI spec.

    Before

    When generating an OpenAPI spec for a request with an error schema of type `HttpApiSchema.Text()“, the response content type was incorrectly set to “application/json” instead of “text/plain”.

    import {
    HttpApi,
    HttpApiEndpoint,
    HttpApiGroup,
    HttpApiSchema,
    OpenApi
    } from "@effect/platform"
    const api = HttpApi.make("api").add(
    HttpApiGroup.make("group").add(
    HttpApiEndpoint.get("get", "/").addError(HttpApiSchema.Text())
    )
    )
    const spec = OpenApi.fromApi(api)
    console.log(JSON.stringify(spec.paths, null, 2))
    /*
    Output:
    {
    "/": {
    "get": {
    "tags": [
    "group"
    ],
    "operationId": "group.get",
    "parameters": [],
    "security": [],
    "responses": {
    "204": {
    "description": "Success"
    },
    "400": {
    "description": "The request did not match the expected schema",
    "content": {
    "application/json": {
    "schema": {
    "$ref": "#/components/schemas/HttpApiDecodeError"
    }
    }
    }
    },
    "500": {
    "description": "a string",
    "content": {
    "application/json": {
    "schema": {
    "type": "string"
    }
    }
    }
    }
    }
    }
    }
    }
    */

    After

    import { HttpApi, HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "@effect/platform"
    const api = HttpApi.make("api").add(
    HttpApiGroup.make("group").add(
    HttpApiEndpoint.get("get", "/").addError(HttpApiSchema.Text())
    )
    )
    const spec = OpenApi.fromApi(api)
    console.log(JSON.stringify(spec.paths, null, 2))
    /*
    Output:
    {
    "/": {
    "get": {
    "tags": [
    "group"
    ],
    "operationId": "group.get",
    "parameters": [],
    "security": [],
    "responses": {
    "204": {
    "description": "Success"
    },
    "400": {
    "description": "The request did not match the expected schema",
    "content": {
    "application/json": {
    "schema": {
    "$ref": "#/components/schemas/HttpApiDecodeError"
    }
    }
    }
    },
    "500": {
    "description": "a string",
    "content": {
    "text/plain": {
    "application/json": {
    "schema": {
    "type": "string"
    }
    }
    }
    }
    }
    }
    }
    }
    */
  • #4226 212e784 Thanks @gcanti! - Add missing deprecated key to OpenApi.annotations API.

  • #4226 212e784 Thanks @gcanti! - Fix: Prevent request body from being added to the OpenAPI spec for GET methods in OpenApi.fromApi.

    When creating a GET endpoint with a request payload, the requestBody was incorrectly added to the OpenAPI specification, which is invalid for GET methods.

    Before

    import {
    HttpApi,
    HttpApiEndpoint,
    HttpApiGroup,
    OpenApi
    } from "@effect/platform"
    import { Schema } from "effect"
    const api = HttpApi.make("api").add(
    HttpApiGroup.make("group").add(
    HttpApiEndpoint.get("get", "/")
    .addSuccess(Schema.String)
    .setPayload(
    Schema.Struct({
    a: Schema.String
    })
    )
    )
    )
    const spec = OpenApi.fromApi(api)
    console.log(JSON.stringify(spec.paths, null, 2))
    /*
    Output:
    {
    "/": {
    "get": {
    "tags": [
    "group"
    ],
    "operationId": "group.get",
    "parameters": [
    {
    "name": "a",
    "in": "query",
    "schema": {
    "type": "string"
    },
    "required": true
    }
    ],
    "security": [],
    "responses": {
    "200": {
    "description": "a string",
    "content": {
    "application/json": {
    "schema": {
    "type": "string"
    }
    }
    }
    },
    "400": {
    "description": "The request did not match the expected schema",
    "content": {
    "application/json": {
    "schema": {
    "$ref": "#/components/schemas/HttpApiDecodeError"
    }
    }
    }
    }
    },
    "requestBody": {
    "content": {
    "application/json": {
    "schema": {
    "type": "object",
    "required": [
    "a"
    ],
    "properties": {
    "a": {
    "type": "string"
    }
    },
    "additionalProperties": false
    }
    }
    },
    "required": true
    }
    }
    }
    }
    */

    After

    import {
    HttpApi,
    HttpApiEndpoint,
    HttpApiGroup,
    OpenApi
    } from "@effect/platform"
    import { Schema } from "effect"
    const api = HttpApi.make("api").add(
    HttpApiGroup.make("group").add(
    HttpApiEndpoint.get("get", "/")
    .addSuccess(Schema.String)
    .setPayload(
    Schema.Struct({
    a: Schema.String
    })
    )
    )
    )
    const spec = OpenApi.fromApi(api)
    console.log(JSON.stringify(spec.paths, null, 2))
    /*
    Output:
    {
    "/": {
    "get": {
    "tags": [
    "group"
    ],
    "operationId": "group.get",
    "parameters": [
    {
    "name": "a",
    "in": "query",
    "schema": {
    "type": "string"
    },
    "required": true
    }
    ],
    "security": [],
    "responses": {
    "200": {
    "description": "a string",
    "content": {
    "application/json": {
    "schema": {
    "type": "string"
    }
    }
    }
    },
    "400": {
    "description": "The request did not match the expected schema",
    "content": {
    "application/json": {
    "schema": {
    "$ref": "#/components/schemas/HttpApiDecodeError"
    }
    }
    }
    }
    }
    }
    }
    }
    */
  • #4226 212e784 Thanks @gcanti! - Add "application/x-www-form-urlencoded" to OpenApiSpecContentType type as it is generated by the system when using HttpApiSchema.withEncoding({ kind: "UrlParams" })

    Example

    import {
    HttpApi,
    HttpApiEndpoint,
    HttpApiGroup,
    HttpApiSchema,
    OpenApi
    } from "@effect/platform"
    import { Schema } from "effect"
    const api = HttpApi.make("api").add(
    HttpApiGroup.make("group").add(
    HttpApiEndpoint.post("post", "/")
    .addSuccess(Schema.String)
    .setPayload(
    Schema.Struct({ foo: Schema.String }).pipe(
    HttpApiSchema.withEncoding({ kind: "UrlParams" })
    )
    )
    )
    )
    const spec = OpenApi.fromApi(api)
    console.log(JSON.stringify(spec.paths, null, 2))
    /*
    Output:
    {
    "/": {
    "post": {
    "tags": [
    "group"
    ],
    "operationId": "group.post",
    "parameters": [],
    "security": [],
    "responses": {
    "200": {
    "description": "a string",
    "content": {
    "application/json": {
    "schema": {
    "type": "string"
    }
    }
    }
    },
    "400": {
    "description": "The request did not match the expected schema",
    "content": {
    "application/json": {
    "schema": {
    "$ref": "#/components/schemas/HttpApiDecodeError"
    }
    }
    }
    }
    },
    "requestBody": {
    "content": {
    "application/x-www-form-urlencoded": {
    "schema": {
    "type": "object",
    "required": [
    "foo"
    ],
    "properties": {
    "foo": {
    "type": "string"
    }
    },
    "additionalProperties": false
    }
    }
    },
    "required": true
    }
    }
    }
    }
    */
  • Updated dependencies [734af82, b63c780, c640d77, 0def088]:

    • effect@3.12.2

0.72.1

Patch Changes

0.72.0

Minor Changes

  • #4068 ef64c6f Thanks @tim-smart! - remove generics from HttpClient tag service

    Instead you can now use HttpClient.With<E, R> to specify the error and requirement types.

Patch Changes

0.71.7

Patch Changes

0.71.6

Patch Changes

0.71.5

Patch Changes

  • #4154 05d71f8 Thanks @thewilkybarkid! - Support URL objects in HttpServerResponse.redirect

  • #4157 e66b920 Thanks @tim-smart! - ensure WebSocket’s are always closed with an explicit code

0.71.4

Patch Changes

  • #4152 909181a Thanks @tim-smart! - accept Headers.Input in HttpServerResponse constructors

  • #4152 909181a Thanks @tim-smart! - add HttpServerResponse.redirect api

  • Updated dependencies [1a6b52d]:

    • effect@3.11.8

0.71.3

Patch Changes

  • #4147 6984508 Thanks @tim-smart! - ensure HttpApi union schemas don’t transfer non-api related annotations

  • #4145 883639c Thanks @tim-smart! - ensure HttpApi preserves referential equality of error schemas

0.71.2

Patch Changes

  • #4138 cec0b4d Thanks @gcanti! - JSONSchema: handle the nullable keyword for OpenAPI target, closes #4075.

    Before

    import { OpenApiJsonSchema } from "@effect/platform"
    import { Schema } from "effect"
    const schema = Schema.NullOr(Schema.String)
    console.log(JSON.stringify(OpenApiJsonSchema.make(schema), null, 2))
    /*
    {
    "anyOf": [
    {
    "type": "string"
    },
    {
    "enum": [
    null
    ]
    }
    ]
    }
    */

    After

    import { OpenApiJsonSchema } from "@effect/platform"
    import { Schema } from "effect"
    const schema = Schema.NullOr(Schema.String)
    console.log(JSON.stringify(OpenApiJsonSchema.make(schema), null, 2))
    /*
    {
    "type": "string",
    "nullable": true
    }
    */
  • #4128 8d978c5 Thanks @gcanti! - JSONSchema: add type for homogeneous enum schemas, closes #4127

    Before

    import { JSONSchema, Schema } from "effect"
    const schema = Schema.Literal("a", "b")
    console.log(JSON.stringify(JSONSchema.make(schema), null, 2))
    /*
    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "enum": [
    "a",
    "b"
    ]
    }
    */

    After

    import { JSONSchema, Schema } from "effect"
    const schema = Schema.Literal("a", "b")
    console.log(JSON.stringify(JSONSchema.make(schema), null, 2))
    /*
    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "type": "string",
    "enum": [
    "a",
    "b"
    ]
    }
    */
  • #4138 cec0b4d Thanks @gcanti! - JSONSchema: use { "type": "null" } to represent the null literal

    Before

    import { JSONSchema, Schema } from "effect"
    const schema = Schema.NullOr(Schema.String)
    console.log(JSON.stringify(JSONSchema.make(schema), null, 2))
    /*
    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "anyOf": [
    {
    "type": "string"
    },
    {
    "enum": [
    null
    ]
    }
    ]
    }
    */

    After

    import { JSONSchema, Schema } from "effect"
    const schema = Schema.NullOr(Schema.String)
    console.log(JSON.stringify(JSONSchema.make(schema), null, 2))
    /*
    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "anyOf": [
    {
    "type": "string"
    },
    {
    "type": "null"
    }
    ]
    }
    */
  • Updated dependencies [2408616, cec0b4d, cec0b4d, 8d978c5, cec0b4d, cec0b4d]:

    • effect@3.11.7

0.71.1

Patch Changes

  • #4132 1d3df5b Thanks @tim-smart! - allow passing Context to HttpApp web handlers

    This allows you to pass request-scoped data to your handlers.

    import { Context, Effect } from "effect"
    import { HttpApp, HttpServerResponse } from "@effect/platform"
    class Env extends Context.Reference<Env>()("Env", {
    defaultValue: () => ({ foo: "bar" })
    }) {}
    const handler = HttpApp.toWebHandler(
    Effect.gen(function* () {
    const env = yield* Env
    return yield* HttpServerResponse.json(env)
    })
    )
    const response = await handler(
    new Request("http://localhost:3000/"),
    Env.context({ foo: "baz" })
    )
    assert.deepStrictEqual(await response.json(), {
    foo: "baz"
    })

0.71.0

Minor Changes

  • #4129 c99a0f3 Thanks @tim-smart! - replace HttpApi.empty with HttpApi.make(identifier)

    This ensures if you have multiple HttpApi instances, the HttpApiGroup’s are implemented correctly.

    import { HttpApi } from "@effect/platform"
    // Before
    class Api extends HttpApi.empty.add(...) {}
    // After
    class Api extends HttpApi.make("api").add(...) {}

Patch Changes

  • #4130 11fc401 Thanks @tim-smart! - add predefined empty errors to HttpApiError

  • #4129 c99a0f3 Thanks @tim-smart! - add OpenApi annotation for exluding parts of the api from the spec

  • Updated dependencies [662d1ce, 31c62d8]:

    • effect@3.11.6

0.70.7

Patch Changes

  • #4111 22905cf Thanks @gcanti! - JSONSchema: merge refinement fragments instead of just overwriting them.

    Before

    import { JSONSchema, Schema } from "effect"
    export const schema = Schema.String.pipe(
    Schema.startsWith("a"), // <= overwritten!
    Schema.endsWith("c")
    )
    console.log(JSON.stringify(JSONSchema.make(schema), null, 2))
    /*
    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "type": "string",
    "description": "a string ending with \"c\"",
    "pattern": "^.*c$" // <= overwritten!
    }
    */

    After

    import { JSONSchema, Schema } from "effect"
    export const schema = Schema.String.pipe(
    Schema.startsWith("a"), // <= preserved!
    Schema.endsWith("c")
    )
    console.log(JSON.stringify(JSONSchema.make(schema), null, 2))
    /*
    {
    "type": "string",
    "description": "a string ending with \"c\"",
    "pattern": "^.*c$",
    "allOf": [
    {
    "pattern": "^a" // <= preserved!
    }
    ],
    "$schema": "http://json-schema.org/draft-07/schema#"
    }
    */
  • #4019 9f5a6f7 Thanks @gcanti! - OpenApiJsonSchema: Use the experimental JSONSchema.fromAST API for implementation.

  • Updated dependencies [9f5a6f7, 22905cf, 9f5a6f7, 1e59e4f, 8d914e5, 03bb00f, 9f5a6f7, 14e1149, 9f5a6f7, 9f5a6f7]:

    • effect@3.11.5

0.70.6

Patch Changes

  • #4097 9a5b8e3 Thanks @tim-smart! - handle WebSocket’s that emit ArrayBuffer instead of Uint8Array

0.70.5

Patch Changes

0.70.4

Patch Changes

0.70.3

Patch Changes

  • #4065 7044730 Thanks @KhraksMamtsov! - Ensure the uniqueness of the parameters at the type level

    import { HttpApiEndpoint, HttpApiSchema } from "@effect/platform"
    import { Schema } from "effect"
    HttpApiEndpoint.get(
    "test"
    )`/${HttpApiSchema.param("id", Schema.NumberFromString)}/${
    // @ts-expect-error: Argument of type 'Param<"id", typeof NumberFromString>' is not assignable to parameter of type '"Duplicate param :id"'
    HttpApiSchema.param("id", Schema.NumberFromString)
    }`

0.70.2

Patch Changes

  • #4064 c2249ea Thanks @tim-smart! - HttpApi OpenApi adjustments

    • Allow using transform annotation on endpoints & groups
    • Preserve descriptions for “empty” schemas
  • #4055 1358aa5 Thanks @thewilkybarkid! - Allow creating a route for all methods

  • #4062 1de3fe7 Thanks @tim-smart! - simplify HttpApiClient param regex

  • Updated dependencies [01cee56]:

    • effect@3.11.2

0.70.1

Patch Changes

0.70.0

Minor Changes

  • #3835 672bde5 Thanks @tim-smart! - support array of values in /platform url param schemas

Patch Changes

0.69.32

Patch Changes

0.69.31

Patch Changes

  • #4035 e6d4a37 Thanks @tim-smart! - add template literal api for defining HttpApiEndpoint path schema

0.69.30

Patch Changes

  • #4025 270f199 Thanks @tim-smart! - update OpenApi version to 3.1.0

0.69.29

Patch Changes

  • #4024 24cc35e Thanks @tim-smart! - improve HttpApi handling of payload encoding types

0.69.28

Patch Changes

  • #4017 edd72be Thanks @tim-smart! - try encode defects that match an Error schema in HttpApi

  • #4014 a3e2771 Thanks @tim-smart! - consider TimeoutException a transient error in HttpClient.retryTransient

  • #4007 944025b Thanks @gcanti! - Wrap JSDoc @example tags with a TypeScript fence, closes #4002

  • #4016 a9e00e4 Thanks @tim-smart! - allow using HttpApiSchema.Multipart in a union

  • Updated dependencies [944025b, 54addee]:

    • effect@3.10.19

0.69.27

Patch Changes

  • #4005 beaccae Thanks @tim-smart! - fix HttpApiBuilder.middleware when used multiple times

  • Updated dependencies [af409cf]:

    • effect@3.10.18

0.69.26

Patch Changes

  • #3977 c963886 Thanks @KhraksMamtsov! - HttpApiClient.group & HttpApiClient.endpoint have been added This makes it possible to create HttpApiClient for some part of the HttpApi This eliminates the need to provide all the dependencies for the entire HttpApi - but only those necessary for its specific part to work
  • Updated dependencies [42c4ce6]:
    • effect@3.10.17

0.69.25

Patch Changes

  • #3968 320557a Thanks @KhraksMamtsov! - OpenApi.Transform annotation has been added

    This customization point allows you to transform the generated specification in an arbitrary way

    class Api extends HttpApi.empty
    .annotateContext(OpenApi.annotations({
    title: "API",
    summary: "test api summary",
    transform: (openApiSpec) => ({
    ...openApiSpec,
    tags: [...openApiSpec.tags ?? [], {
    name: "Tag from OpenApi.Transform annotation"
    }]
    })
    }))
  • #3962 7b93dd6 Thanks @KhraksMamtsov! - fix HttpApiGroup.addError signature

  • Updated dependencies [4dca30c, 1d99867, 6dae414, 6b0d737, d8356aa]:

    • effect@3.10.16

0.69.24

Patch Changes

  • #3939 3cc6514 Thanks @KhraksMamtsov! - Added the ability to annotate the HttpApi with additional schemas Which will be taken into account when generating components.schemas section of OpenApi schema

    import { Schema } from "effect"
    import { HttpApi } from "@effect/platform"
    HttpApi.empty.annotate(HttpApi.AdditionalSchemas, [
    Schema.Struct({
    contentType: Schema.String,
    length: Schema.Int
    }).annotations({
    identifier: "ComponentsSchema"
    })
    ])
    /**
    {
    "openapi": "3.0.3",
    ...
    "components": {
    "schemas": {
    "ComponentsSchema": {...},
    ...
    },
    ...
    }
    */

0.69.23

Patch Changes

  • #3944 3aff4d3 Thanks @KhraksMamtsov! - OpenApi.Summary & OpenApi.Deprecated annotations have been added

0.69.22

Patch Changes

0.69.21

Patch Changes

0.69.20

Patch Changes

  • Updated dependencies [995bbdf]:
    • effect@3.10.13

0.69.19

Patch Changes

  • #3908 eb8c52d Thanks @tim-smart! - use plain js data structures for HttpApi properties

0.69.18

Patch Changes

  • #3906 a0584ec Thanks @tim-smart! - ensure Socket send queue is not ended

  • #3904 dd14efe Thanks @tim-smart! - improve platform/Worker shutdown and logging

  • Updated dependencies [dd14efe]:

    • effect@3.10.12

0.69.17

Patch Changes

  • #3898 8240b1c Thanks @mattphillips! - Fixed handling of basic auth header values

  • #3903 5eef499 Thanks @tim-smart! - add HttpApi.addHttpApi method, for merging two HttpApi instances

  • Updated dependencies [5eef499]:

    • effect@3.10.11

0.69.16

Patch Changes

0.69.15

Patch Changes

  • #3885 8a30e1d Thanks @tim-smart! - simplify HttpApiBuilder handler logic

0.69.14

Patch Changes

0.69.13

Patch Changes

0.69.12

Patch Changes

0.69.11

Patch Changes

  • #3856 81ddd45 Thanks @KhraksMamtsov! - Integration with Scalar has been implemented

  • Updated dependencies [ce1c21f]:

    • effect@3.10.6

0.69.10

Patch Changes

0.69.9

Patch Changes

  • #3842 2367708 Thanks @gcanti! - add support for Schema.OptionFromUndefinedOr in JSON Schema generation, closes #3839

    Before

    import { JSONSchema, Schema } from "effect"
    const schema = Schema.Struct({
    a: Schema.OptionFromUndefinedOr(Schema.Number)
    })
    console.log(JSON.stringify(JSONSchema.make(schema), null, 2))
    /*
    throws:
    Error: Missing annotation
    at path: ["a"]
    details: Generating a JSON Schema for this schema requires a "jsonSchema" annotation
    schema (UndefinedKeyword): undefined
    */

    After

    import { JSONSchema, Schema } from "effect"
    const schema = Schema.Struct({
    a: Schema.OptionFromUndefinedOr(Schema.Number)
    })
    console.log(JSON.stringify(JSONSchema.make(schema), null, 2))
    /*
    Output:
    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "type": "object",
    "required": [],
    "properties": {
    "a": {
    "type": "number"
    }
    },
    "additionalProperties": false
    }
    */
  • Updated dependencies [2367708]:

    • effect@3.10.4

0.69.8

Patch Changes

  • #3837 522f7c5 Thanks @tim-smart! - eliminate HttpApiEndpoint context in .handle

0.69.7

Patch Changes

  • #3836 690d6c5 Thanks @tim-smart! - add HttpApiBuilder.handler, for defining a single handler

  • #3831 279fe3a Thanks @tim-smart! - ensure parent annotations take precedence over surrogate annotations

  • Updated dependencies [b9423d8]:

    • effect@3.10.3

0.69.6

Patch Changes

  • #3826 42cd72a Thanks @juliusmarminge! - ensure requests & responses have headers redacted when inspecting

  • Updated dependencies [714e119, c1afd55]:

    • effect@3.10.2

0.69.5

Patch Changes

  • Updated dependencies [9604d6b]:
    • effect@3.10.1

0.69.4

Patch Changes

  • #3816 c86b1d7 Thanks @tim-smart! - allow Request.signal to be missing in .toWebHandler apis

0.69.3

Patch Changes

  • #3814 d5fba63 Thanks @tim-smart! - cache OpenApi schema generation

  • #3813 1eb2c30 Thanks @KhraksMamtsov! - Add support for bearer format OpenApi annotation

  • #3811 02d413e Thanks @KhraksMamtsov! - A bug related to the format of the security schema keys has been fixed. According to the OpenAPI specification, it must match the regular expression` ^[a-zA-Z0-9.-_]+# @effect/platform

0.69.2

Patch Changes

  • #3808 e7afc47 Thanks @tim-smart! - ensure HttpMiddleware is only initialized once

0.69.1

Patch Changes

  • #3802 7564f56 Thanks @tim-smart! - simplify HttpApiMiddleware.TagClass type

  • #3802 7564f56 Thanks @tim-smart! - add HttpServer.layerContext to platform-node/bun

0.69.0

Minor Changes

  • #3764 6d9de6b Thanks @tim-smart! - HttpApi second revision

    • HttpApi, HttpApiGroup & HttpApiEndpoint now use a chainable api instead of a pipeable api.
    • HttpApiMiddleware module has been added, with a updated way of defining security middleware.
    • You can now add multiple success schemas
    • A url search parameter schema has been added
    • Error schemas now support HttpApiSchema encoding apis
    • toWebHandler has been simplified

    For more information, see the README.

  • #3764 5821ce3 Thanks @patroza! - feat: implement Redactable. Used by Headers to not log sensitive information

Patch Changes

0.68.6

Patch Changes

0.68.5

Patch Changes

  • #3784 2036402 Thanks @patroza! - fix HttpMiddleware circular import

0.68.4

Patch Changes

  • #3780 1b1ef29 Thanks @tim-smart! - ensure cors middleware also affects error responses

0.68.3

Patch Changes

  • #3769 8c33087 Thanks @tim-smart! - add support for WebSocket protocols option

  • Updated dependencies [61a99b2]:

    • effect@3.9.2
    • @effect/schema@0.75.4

0.68.2

Patch Changes

  • Updated dependencies [360ec14]:
    • @effect/schema@0.75.3

0.68.1

Patch Changes

  • #3743 b75ac5d Thanks @sukovanej! - Add support for ConfigProvider based on .env files.

    import { PlatformConfigProvider } from "@effect/platform"
    import { NodeContext } from "@effect/platform-node"
    import { Config } from "effect"
    Effect.gen(function* () {
    const config = yield* Config.all({
    api_url: Config.string("API_URL"),
    api_key: Config.string("API_KEY")
    })
    console.log(`Api config: ${config}`)
    }).pipe(
    Effect.provide(
    PlatformConfigProvider.layerDotEnvAdd(".env").pipe(
    Layer.provide(NodeContext.layer)
    )
    )
    )

0.68.0

Minor Changes

  • #3756 90ceeab Thanks @tim-smart! - remove HttpClient.Service type

  • #3756 90ceeab Thanks @tim-smart! - constrain HttpClient success type to HttpClientResponse

  • #3756 90ceeab Thanks @tim-smart! - add HttpClient accessor apis

    These apis allow you to easily send requests without first accessing the HttpClient service.

    Below is an example of using the get accessor api to send a GET request:

    import { FetchHttpClient, HttpClient } from "@effect/platform"
    import { Effect } from "effect"
    const program = HttpClient.get(
    "https://jsonplaceholder.typicode.com/posts/1"
    ).pipe(
    Effect.andThen((response) => response.json),
    Effect.scoped,
    Effect.provide(FetchHttpClient.layer)
    )
    Effect.runPromise(program)
    /*
    Output:
    {
    userId: 1,
    id: 1,
    title: 'sunt aut facere repellat provident occaecati excepturi optio reprehenderit',
    body: 'quia et suscipit\n' +
    'suscipit recusandae consequuntur expedita et cum\n' +
    'reprehenderit molestiae ut ut quas totam\n' +
    'nostrum rerum est autem sunt rem eveniet architecto'
    }
    */

Patch Changes

  • Updated dependencies [f02b354]:
    • @effect/schema@0.75.2

0.67.1

Patch Changes

  • #3740 3b2ad1d Thanks @tim-smart! - revert deno Inspectable changes

  • Updated dependencies [3b2ad1d]:

    • effect@3.9.1
    • @effect/schema@0.75.1

0.67.0

Minor Changes

  • #3620 0ba66f2 Thanks @tim-smart! - add deno support to Inspectable

Patch Changes

0.66.3

Patch Changes

0.66.2

Patch Changes

  • #3667 fd83d0e Thanks @gcanti! - Remove default json schema annotations from string, number and boolean.

    Before

    import { JSONSchema, Schema } from "@effect/schema"
    const schema = Schema.String.annotations({ examples: ["a", "b"] })
    console.log(JSON.stringify(JSONSchema.make(schema), null, 2))
    /*
    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "type": "string",
    "description": "a string",
    "title": "string",
    "examples": [
    "a",
    "b"
    ]
    }
    */

    After

    import { JSONSchema, Schema } from "@effect/schema"
    const schema = Schema.String.annotations({ examples: ["a", "b"] })
    console.log(JSON.stringify(JSONSchema.make(schema), null, 2))
    /*
    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "type": "string",
    "examples": [
    "a",
    "b"
    ]
    }
    */
  • #3672 090e41c Thanks @gcanti! - JSON Schema: handle refinements where the ‘from’ part includes a transformation, closes #3662

    Before

    import { JSONSchema, Schema } from "@effect/schema"
    const schema = Schema.Date
    console.log(JSON.stringify(JSONSchema.make(schema), null, 2))
    /*
    throws
    Error: Missing annotation
    details: Generating a JSON Schema for this schema requires a "jsonSchema" annotation
    schema (Refinement): Date
    */

    After

    import { JSONSchema, Schema } from "@effect/schema"
    const schema = Schema.Date
    console.log(JSON.stringify(JSONSchema.make(schema), null, 2))
    /*
    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "type": "string",
    "description": "a string that will be parsed into a Date"
    }
    */
  • Updated dependencies [734eae6, fd83d0e, 4509656, ad7e1de, 090e41c, 090e41c]:

    • @effect/schema@0.74.1
    • effect@3.8.4

0.66.1

Patch Changes

  • #3664 3812788 Thanks @tim-smart! - add OpenApiJsonSchema module

0.66.0

Patch Changes

  • Updated dependencies [de48aa5]:
    • @effect/schema@0.74.0

0.65.5

Patch Changes

  • #3640 321b201 Thanks @tim-smart! - use HttpClientRequest.originalUrl for search params parser

  • Updated dependencies [bb5ec6b]:

    • effect@3.8.3
    • @effect/schema@0.73.4

0.65.4

Patch Changes

  • Updated dependencies [e6440a7]:
    • @effect/schema@0.73.3

0.65.3

Patch Changes

  • Updated dependencies [f0d8ef1]:
    • effect@3.8.2
    • @effect/schema@0.73.2

0.65.2

Patch Changes

0.65.1

Patch Changes

  • #3614 e44c5f2 Thanks @tim-smart! - accept Redacted in HttpClientRequest.basicAuth/bearerToken

0.65.0

Minor Changes

  • #3541 7041393 Thanks @tim-smart! - refactor /platform HttpClient

    HttpClient.fetch removed

    The HttpClient.fetch client implementation has been removed. Instead, you can access a HttpClient using the corresponding Context.Tag.

    import { FetchHttpClient, HttpClient } from "@effect/platform"
    import { Effect } from "effect"
    Effect.gen(function* () {
    const client = yield* HttpClient.HttpClient
    // make a get request
    yield* client.get("https://jsonplaceholder.typicode.com/todos/1")
    }).pipe(
    Effect.scoped,
    // the fetch client has been moved to the `FetchHttpClient` module
    Effect.provide(FetchHttpClient.layer)
    )

    HttpClient interface now uses methods

    Instead of being a function that returns the response, the HttpClient interface now uses methods to make requests.

    Some shorthand methods have been added to the HttpClient interface to make less complex requests easier.

    import {
    FetchHttpClient,
    HttpClient,
    HttpClientRequest
    } from "@effect/platform"
    import { Effect } from "effect"
    Effect.gen(function* () {
    const client = yield* HttpClient.HttpClient
    // make a get request
    yield* client.get("https://jsonplaceholder.typicode.com/todos/1")
    // make a post request
    yield* client.post("https://jsonplaceholder.typicode.com/todos")
    // execute a request instance
    yield* client.execute(
    HttpClientRequest.get("https://jsonplaceholder.typicode.com/todos/1")
    )
    })

    Scoped HttpClientResponse helpers removed

    The HttpClientResponse helpers that also supplied the Scope have been removed.

    Instead, you can use the HttpClientResponse methods directly, and explicitly add a Effect.scoped to the pipeline.

    import { FetchHttpClient, HttpClient } from "@effect/platform"
    import { Effect } from "effect"
    Effect.gen(function* () {
    const client = yield* HttpClient.HttpClient
    yield* client.get("https://jsonplaceholder.typicode.com/todos/1").pipe(
    Effect.flatMap((response) => response.json),
    Effect.scoped // supply the `Scope`
    )
    })

    Some apis have been renamed

    Including the HttpClientRequest body apis, which is to make them more discoverable.

Patch Changes

0.64.1

Patch Changes

  • #3582 8261c5a Thanks @gcanti! - add missing encoding argument to Command.streamLines

  • Updated dependencies [35a0f81]:

    • effect@3.7.3
    • @effect/schema@0.72.4

0.64.0

Minor Changes

  • #3565 90ac8f6 Thanks @tim-smart! - move Etag implementation to /platform

Patch Changes

  • #3565 90ac8f6 Thanks @tim-smart! - add HttpApiBuilder.toWebHandler api

  • #3567 3791e24 Thanks @tim-smart! - reduce boxing in Socket.toChannel implementation

  • #3567 3791e24 Thanks @tim-smart! - add Socket.toChannelString api

  • Updated dependencies [f6acb71]:

    • @effect/schema@0.72.3

0.63.3

Patch Changes

  • #3550 4a701c4 Thanks @tim-smart! - ensure Socket.toChannel fiber is attached to Scope

0.63.2

Patch Changes

  • Updated dependencies [8a601d7, 353ba19]:
    • effect@3.7.2
    • @effect/schema@0.72.2

0.63.1

Patch Changes

0.63.0

Patch Changes

0.62.5

Patch Changes

  • Updated dependencies [e809286]:
    • effect@3.6.8
    • @effect/schema@0.71.4

0.62.4

Patch Changes

  • #3506 e7a65e3 Thanks @tim-smart! - use Logger.pretty for runMain, and support dual usage

  • Updated dependencies [50ec889]:

    • effect@3.6.7
    • @effect/schema@0.71.3

0.62.3

Patch Changes

  • Updated dependencies [f960bf4, 46a575f]:
    • effect@3.6.6
    • @effect/schema@0.71.2

0.62.2

Patch Changes

  • #3494 413994c Thanks @tim-smart! - add binary support to KeyValueStore

  • Updated dependencies [14a47a8, 0c09841]:

    • effect@3.6.5
    • @effect/schema@0.71.1

0.62.1

Patch Changes

  • #3469 9efe0e5 Thanks @tim-smart! - respond with 404 for NoSuchElementException in HttpServerRespondable

0.62.0

Patch Changes

0.61.8

Patch Changes

  • Updated dependencies [04adcac]:
    • effect@3.6.3
    • @effect/schema@0.70.4

0.61.7

Patch Changes

  • #3437 17245a4 Thanks @tim-smart! - add Cookies.get/getValue apis

  • #3439 630d40e Thanks @sukovanej! - Add HttpRouter.concatAll.

  • #3439 630d40e Thanks @sukovanej! - Fix HttpRouter.concat - add mounts from both routers.

0.61.6

Patch Changes

  • #3436 d829b57 Thanks @tim-smart! - remove host from HttpServerRequest url’s

  • Updated dependencies [99ad841, fd4b2f6]:

    • @effect/schema@0.70.3
    • effect@3.6.2

0.61.5

Patch Changes

  • #3409 056b710 Thanks @sukovanej! - Add HttpClient.layerTest.

0.61.4

Patch Changes

  • #3414 e7cb109 Thanks @tim-smart! - ensure broken HttpMiddleware that doesn’t fail responds

0.61.3

Patch Changes

  • #3408 fb9f786 Thanks @tim-smart! - ensure failure in HttpMiddleware results in a response

  • Updated dependencies [510a34d, 45dbb9f]:

    • effect@3.6.1
    • @effect/schema@0.70.2

0.61.2

Patch Changes

0.61.1

Patch Changes

  • #3384 11223bf Thanks @tim-smart! - use type alias for HttpApp

0.61.0

Patch Changes

0.60.3

Patch Changes

0.60.2

Patch Changes

  • #3339 eb4d014 Thanks @fubhy! - Fixed various search params related function signatures (Array => ReadonlyArray)

  • #3353 fc20f73 Thanks @tim-smart! - wait for worker ready latch before sending initial message

  • Updated dependencies [1ba640c, c8c71bd, a26ce58]:

    • effect@3.5.8
    • @effect/schema@0.69.2

0.60.1

Patch Changes

  • Updated dependencies [f241154]:
    • @effect/schema@0.69.1

0.60.0

Patch Changes

  • Updated dependencies [20807a4]:
    • @effect/schema@0.69.0

0.59.3

Patch Changes

  • #3310 99bddcf Thanks @fubhy! - Added additional pure annotations to improve tree-shakeability

  • Updated dependencies [3afcc93, 99bddcf, 6921c4f]:

    • effect@3.5.7
    • @effect/schema@0.68.27

0.59.2

Patch Changes

0.59.1

Patch Changes

  • #3278 fcecff7 Thanks @tim-smart! - ensure /platform HttpApp.toWebHandler runs Stream’s with the current runtime

    Also add runtime options to HttpServerResponse.toWeb

  • #3281 adbf753 Thanks @tim-smart! - drop path-browserify dependency

  • #3281 adbf753 Thanks @tim-smart! - drop fast-querystring dependency

  • Updated dependencies [a9d7800]:

    • effect@3.5.5
    • @effect/schema@0.68.25

0.59.0

Minor Changes

  • #3260 53c0db0 Thanks @tim-smart! - replace /platform RefailError with use of the “cause” property

  • #3255 ada68b3 Thanks @tim-smart! - refactor & simplify /platform backing workers

    Improves worker performance by 2x

Patch Changes

0.58.27

Patch Changes

0.58.26

Patch Changes

0.58.25

Patch Changes

  • #3223 0623fca Thanks @tim-smart! - improve /platform/WorkerError messages

0.58.24

Patch Changes

  • Updated dependencies [55fdd76]:
    • effect@3.5.1
    • @effect/schema@0.68.21

0.58.23

Patch Changes

0.58.22

Patch Changes

  • #3209 366f2ee Thanks @tim-smart! - simplify /platform http response handling

  • #3209 366f2ee Thanks @tim-smart! - support middleware in HttpApp web handler apis

  • Updated dependencies [7af137c, ee4b3dc, 097d25c]:

    • effect@3.4.9
    • @effect/schema@0.68.19

0.58.21

Patch Changes

0.58.20

Patch Changes

0.58.19

Patch Changes

0.58.18

Patch Changes

  • #3136 7f8900a Thanks @tim-smart! - support undefined in http request schema apis

0.58.17

Patch Changes

0.58.16

Patch Changes

  • Updated dependencies [61e5964]:
    • @effect/schema@0.68.14

0.58.15

Patch Changes

  • #3123 baa90df Thanks @tim-smart! - add HttpClient.followRedirects api

  • Updated dependencies [cb76bcb]:

    • @effect/schema@0.68.13

0.58.14

Patch Changes

  • #3104 52a87c7 Thanks @tim-smart! - remove the stack from HttpServerError.RouteNotFound

  • #3109 6d2280e Thanks @tim-smart! - fix assignability of HttpMiddleware in HttpRouter.use

0.58.13

Patch Changes

  • #3102 dbd53ea Thanks @tim-smart! - filter undefined from UrlParams Input

  • Updated dependencies [a047af9, d990544]:

    • effect@3.4.5
    • @effect/schema@0.68.12

0.58.12

Patch Changes

  • #3094 74e0ad2 Thanks @tim-smart! - add mount apis to HttpRouter.Service

  • #3094 74e0ad2 Thanks @tim-smart! - add HttpRouter.DefaultServices to all HttpRouter.Tag’s

  • Updated dependencies [72638e3, d7dde2b, 9b2fc3b, d71c192]:

    • effect@3.4.4
    • @effect/schema@0.68.11

0.58.11

Patch Changes

  • #3091 a5b95b5 Thanks @tim-smart! - add some common services to HttpRouter.Default

  • #3090 5e29579 Thanks @tim-smart! - add HttpServerRequest.toURL api

    To try retreive the full URL for the request.

0.58.10

Patch Changes

  • #3088 a48ee84 Thanks @tim-smart! - add HttpServerRespondable trait

    This trait allows you to define how a value should be responded to in an HTTP server.

    You can it for both errors and success values.

    import { Schema } from "@effect/schema"
    import {
    HttpRouter,
    HttpServerRespondable,
    HttpServerResponse
    } from "@effect/platform"
    class User extends Schema.Class<User>("User")({
    name: Schema.String
    }) {
    [HttpServerRespondable.symbol]() {
    return HttpServerResponse.schemaJson(User)(this)
    }
    }
    class MyError extends Schema.TaggedError<MyError>()("MyError", {
    message: Schema.String
    }) {
    [HttpServerRespondable.symbol]() {
    return HttpServerResponse.schemaJson(MyError)(this, { status: 403 })
    }
    }
    HttpRouter.empty.pipe(
    // responds with `{ "name": "test" }`
    HttpRouter.get("/user", Effect.succeed(new User({ name: "test" }))),
    // responds with a 403 status, and `{ "_tag": "MyError", "message": "boom" }`
    HttpRouter.get("/fail", new MyError({ message: "boom" }))
    )
  • #3088 a48ee84 Thanks @tim-smart! - swap type parameters for HttpRouter.Tag, so request context comes first

  • #3088 a48ee84 Thanks @tim-smart! - add HttpRouter.Default, a default instance of HttpRouter.Tag

  • #3089 ab3180f Thanks @tim-smart! - add HttpClientResponse.matchStatus* apis

    Which allows you to pattern match on the status code of a response.

    HttpClientRequest.get("/todos/1").pipe(
    HttpClient.fetch,
    HttpClientResponse.matchStatusScoped({
    "2xx": (_response) => Effect.succeed("ok"),
    404: (_response) => Effect.fail("not found"),
    orElse: (_response) => Effect.fail("boom")
    })
    )
  • #3079 bbdd365 Thanks @tim-smart! - update to typescript 5.5

  • Updated dependencies [c342739, 8898e5e, ff78636, c86bd4e, bbdd365, bbdd365]:

    • effect@3.4.3
    • @effect/schema@0.68.10

0.58.9

Patch Changes

  • Updated dependencies [0b47fdf]:
    • @effect/schema@0.68.9

0.58.8

Patch Changes

  • Updated dependencies [192261b, 3da1497]:
    • @effect/schema@0.68.8
    • effect@3.4.2

0.58.7

Patch Changes

  • #3064 027004a Thanks @tim-smart! - add HttpRouter.Tag.unwrap api

0.58.6

Patch Changes

  • #3059 2e8e252 Thanks @tim-smart! - add Layer based api for creating HttpRouter’s

    import {
    HttpMiddleware,
    HttpRouter,
    HttpServer,
    HttpServerResponse
    } from "@effect/platform"
    import { BunHttpServer, BunRuntime } from "@effect/platform-bun"
    import { Effect, Layer } from "effect"
    // create your router Context.Tag
    class UserRouter extends HttpRouter.Tag("UserRouter")<UserRouter>() {}
    // create routes with the `.use` api.
    // There is also `.useScoped`
    const GetUsers = UserRouter.use((router) =>
    Effect.gen(function* () {
    yield* router.get("/", HttpServerResponse.text("got users"))
    })
    )
    const CreateUser = UserRouter.use((router) =>
    Effect.gen(function* () {
    yield* router.post("/", HttpServerResponse.text("created user"))
    })
    )
    const AllRoutes = Layer.mergeAll(GetUsers, CreateUser)
    const ServerLive = BunHttpServer.layer({ port: 3000 })
    // access the router with the `.router` api, to create your server
    const HttpLive = Layer.unwrapEffect(
    Effect.gen(function* () {
    return HttpServer.serve(yield* UserRouter.router, HttpMiddleware.logger)
    })
    ).pipe(
    Layer.provide(UserRouter.Live),
    Layer.provide(AllRoutes),
    Layer.provide(ServerLive)
    )
    BunRuntime.runMain(Layer.launch(HttpLive))
  • Updated dependencies [66a1910]:

    • effect@3.4.1
    • @effect/schema@0.68.7

0.58.5

Patch Changes

  • #3053 37a07a2 Thanks @tim-smart! - coerce primitive types in UrlParams input

0.58.4

Patch Changes

  • #3051 b77fb0a Thanks @tim-smart! - add HttpMiddleware.cors

0.58.3

Patch Changes

  • Updated dependencies [530fa9e]:
    • @effect/schema@0.68.6

0.58.2

Patch Changes

  • Updated dependencies [1d62815]:
    • @effect/schema@0.68.5

0.58.1

Patch Changes

  • #3036 5a248aa Thanks @tim-smart! - add Socket.fromTransformStream

0.58.0

Minor Changes

  • #2938 63dd0c3 Thanks @tim-smart! - restructure platform http to use flattened modules

    Instead of using the previous re-exports, you now use the modules directly.

    Before:

    import { HttpClient } from "@effect/platform"
    HttpClient.request.get("/").pipe(HttpClient.client.fetchOk)

    After:

    import { HttpClient, HttpClientRequest } from "@effect/platform"
    HttpClientRequest.get("/").pipe(HttpClient.fetchOk)

Patch Changes

0.57.8

Patch Changes

  • #3030 3ba7ea1 Thanks @tim-smart! - update find-my-way-ts & multipasta

0.57.7

Patch Changes

  • Updated dependencies [d473800]:
    • @effect/schema@0.68.3

0.57.6

Patch Changes

  • Updated dependencies [eb341b3]:
    • @effect/schema@0.68.2

0.57.5

Patch Changes

  • #3021 b8ea6aa Thanks @tim-smart! - update find-my-way-ts to fix vercel edge support

0.57.4

Patch Changes

  • Updated dependencies [b51e266, 6c89408]:
    • @effect/schema@0.68.1
    • effect@3.3.5

0.57.3

Patch Changes

  • Updated dependencies [f6c7977, a67b8fe]:
    • @effect/schema@0.68.0
    • effect@3.3.4

0.57.2

Patch Changes

0.57.1

Patch Changes

0.57.0

Minor Changes

  • #2966 4d3fbe8 Thanks @tim-smart! - fix KeyValueStore for react native by making constructors lazy

Patch Changes

0.56.0

Minor Changes

  • #2837 2b9ddfc Thanks @tim-smart! - support new Pool options in /platform WorkerPool

  • #2837 188f0a5 Thanks @tim-smart! - parse URL instances when creating client requests

Patch Changes

0.55.7

Patch Changes

  • #2931 a67d602 Thanks @tim-smart! - ensure pre-response handler is checked after running the user-provided http app

  • Updated dependencies [4c6bc7f]:

    • @effect/schema@0.67.20

0.55.6

Patch Changes

  • #2903 799aa20 Thanks @rocwang! - # Make baseUrl() more defensive in @effect/platform

    Sometimes, third party code may patch a missing global location to accommodate for non-browser JavaScript runtimes, e.g. Cloudflare Workers, Deno. Such patch might not yield a fully valid location. This could break baseUrl(), which is called by makeUrl().

    For example, the following code would log Invalid URL: '/api/v1/users' with base 'NaN'.

    import { makeUrl } from "@effect/platform/Http/UrlParams"
    globalThis.location = { href: "" }
    const url = makeUrl("/api/v1/users", [])
    // This would log "Invalid URL: '/api/v1/users' with base 'NaN'",
    // because location.origin + location.pathname return NaN in baseUrl()
    console.log(url.left.message)

    Arguably, this is not an issue of Effect per se, but it’s better to be defensive and handle such cases gracefully. So this change does that by checking if location.orign and location.pathname are available before accessing them.

  • Updated dependencies [8c5d280, 6ba6d26, cd7496b, 3f28bf2, 5817820, 349a036]:

    • effect@3.2.9
    • @effect/schema@0.67.19

0.55.5

Patch Changes

  • Updated dependencies [a0dd1c1]:
    • @effect/schema@0.67.18

0.55.4

Patch Changes

0.55.3

Patch Changes

  • Updated dependencies [5745886, 6801fca]:
    • @effect/schema@0.67.16
    • effect@3.2.7

0.55.2

Patch Changes

  • #2737 2c2280b Thanks @jessekelly881! - added KeyValueStore.layerStorage to wrap instances of the Storage type.

  • Updated dependencies [e2740fc, cc8ac50, 60fe3d5]:

    • @effect/schema@0.67.15
    • effect@3.2.6

0.55.1

Patch Changes

  • Updated dependencies [c5846e9]:
    • @effect/schema@0.67.14

0.55.0

Minor Changes

  • #2835 5133ca9 Thanks @tim-smart! - remove pool resizing in platform workers to enable concurrent access

Patch Changes

0.54.0

Minor Changes

  • #2801 1af94df Thanks @tim-smart! - remove permits from workers, to prevent issues with pool resizing

  • #2801 c07e0ce Thanks @gcanti! - Revise the ordering of type parameters within the SchemaStore interface to enhance consistency

Patch Changes

0.53.14

Patch Changes

  • Updated dependencies [5af633e, 45578e8]:
    • @effect/schema@0.67.11
    • effect@3.2.3

0.53.13

Patch Changes

0.53.12

Patch Changes

  • Updated dependencies [5432fff]:
    • @effect/schema@0.67.9

0.53.11

Patch Changes

  • Updated dependencies [c1e991d]:
    • effect@3.2.1
    • @effect/schema@0.67.8

0.53.10

Patch Changes

0.53.9

Patch Changes

0.53.8

Patch Changes

  • Updated dependencies [9c514de]:
    • @effect/schema@0.67.5

0.53.7

Patch Changes

0.53.6

Patch Changes

0.53.5

Patch Changes

0.53.4

Patch Changes

  • Updated dependencies [e41e911]:
    • effect@3.1.4
    • @effect/schema@0.67.1

0.53.3

Patch Changes

  • Updated dependencies [d7e4997]:
    • @effect/schema@0.67.0

0.53.2

Patch Changes

  • Updated dependencies [1f6dc96]:
    • effect@3.1.3
    • @effect/schema@0.66.16

0.53.1

Patch Changes

  • Updated dependencies [121d6d9]:
    • @effect/schema@0.66.15

0.53.0

Minor Changes

  • #2703 d57fbbb Thanks @tim-smart! - replace isows with WebSocketConstructor service in @effect/platform/Socket

    You now have to provide a WebSocketConstructor implementation to the Socket.makeWebSocket api.

    import * as Socket from "@effect/platform/Socket"
    import * as NodeSocket from "@effect/platform-node/NodeSocket"
    import { Effect } from "effect"
    Socket.makeWebSocket("ws://localhost:8080").pipe(
    Effect.provide(NodeSocket.layerWebSocketConstructor) // use "ws" npm package
    )

0.52.3

Patch Changes

0.52.2

Patch Changes

  • #2679 2e1cdf6 Thanks @tim-smart! - ensure all type ids are annotated with unique symbol

  • Updated dependencies [2e1cdf6]:

    • effect@3.1.2
    • @effect/schema@0.66.14

0.52.1

Patch Changes

  • Updated dependencies [e5e56d1]:
    • effect@3.1.1
    • @effect/schema@0.66.13

0.52.0

Minor Changes

  • #2669 9deab0a Thanks @tim-smart! - move http search params apis to ServerRequest module

    If you want to access the search params for a request, you can now use the Http.request.ParsedSearchParams tag.

    import * as Http from "@effect/platform/HttpServer"
    import { Effect } from "effect"
    Effect.gen(function* () {
    const searchParams = yield* Http.request.ParsedSearchParams
    console.log(searchParams)
    })

    The schema method has also been moved to the ServerRequest module. It is now available as Http.request.schemaSearchParams.

Patch Changes

  • #2672 7719b8a Thanks @tim-smart! - allow http client trace propagation to be controlled

    To disable trace propagation:

    import { HttpClient as Http } from "@effect/platform"
    Http.request
    .get("https://example.com")
    .pipe(Http.client.fetchOk, Http.client.withTracerPropagation(false))

0.51.0

Minor Changes

  • #2543 0ec93cb Thanks @github-actions! - * capitalised Http.multipart.FileSchema and Http.multipart.FilesSchema
    • exported Http.multipart.FileSchema
    • added Http.multipart.SingleFileSchema

Patch Changes

0.50.8

Patch Changes

0.50.7

Patch Changes

  • Updated dependencies [18de56b]:
    • effect@3.0.7
    • @effect/schema@0.66.10

0.50.6

Patch Changes

0.50.5

Patch Changes

  • Updated dependencies [6222404, 868ed2a]:
    • effect@3.0.5
    • @effect/schema@0.66.8

0.50.4

Patch Changes

  • Updated dependencies [dd41c6c, 9a24667]:
    • @effect/schema@0.66.7
    • effect@3.0.4

0.50.3

Patch Changes

0.50.2

Patch Changes

0.50.1

Patch Changes

  • Updated dependencies [773b8e0]:
    • @effect/schema@0.66.4

0.50.0

Minor Changes

Patch Changes

  • #2567 6f38dff Thanks @tim-smart! - add more span attributes to http traces

  • #2565 a3b0e6c Thanks @tim-smart! - add Http.response.void helper, for creating a http request that returns void

  • Updated dependencies [a7b4b84]:

    • effect@3.0.3
    • @effect/schema@0.66.3

0.49.4

Patch Changes

  • #2562 2cecdbd Thanks @fubhy! - Added provenance publishing

  • Updated dependencies [2cecdbd]:

    • effect@3.0.2
    • @effect/schema@0.66.2

0.49.3

Patch Changes

0.49.2

Patch Changes

0.49.1

Patch Changes

  • #2542 87c5687 Thanks @tim-smart! - allow fs.watch backend to be customized

    If you want to use the @parcel/watcher backend, you now need to provide it to your effects.

    import { Layer } from "effect"
    import { FileSystem } from "@effect/platform"
    import { NodeFileSystem } from "@effect/platform-node"
    import * as ParcelWatcher from "@effect/platform-node/NodeFileSystem/ParcelWatcher"
    // create a Layer that uses the ParcelWatcher backend
    NodeFileSystem.layer.pipe(Layer.provide(ParcelWatcher.layer))
  • #2555 8edacca Thanks @tim-smart! - prevent use of Array as import name to solve bundler issues

  • Updated dependencies [3da0cfa, 570e8d8, b2b5d66, 8edacca]:

    • effect@3.0.1
    • @effect/schema@0.66.1

0.49.0

Minor Changes

  • #2207 cf69f46 Thanks @github-actions! - make Http.middleware.withTracerDisabledWhen a Layer api

    And add Http.middleware.withTracerDisabledWhenEffect to operate on Effect’s.

    Usage is now:

    import * as Http from "@effect/platform/HttpServer"
    Http.router.empty.pipe(
    Http.router.get("/health"),
    Http.server.serve(),
    Http.middleware.withTracerDisabledWhen(
    (request) => request.url === "/no-tracing"
    )
    )
  • #2207 aa4a3b5 Thanks @github-actions! - Swap type parameters in /platform data types

    A codemod has been released to make migration easier:

    npx @effect/codemod platform-0.49 src/**/*
  • #2207 6c6087a Thanks @github-actions! - rename auto-scoped ClientResponse apis from *Effect to *Scoped

  • #2207 5a2314b Thanks @github-actions! - replace use of unit terminology with void

    For all the data types.

    Effect.unit // => Effect.void
    Stream.unit // => Stream.void
    // etc
  • #2207 6c6087a Thanks @github-actions! - move fetch options to a FiberRef

    This change makes adjusting options to fetch more composable. You can now do:

    import { pipe } from "effect"
    import * as Http from "@effect/platform/HttpClient"
    pipe(
    Http.request.get("https://example.com"),
    Http.client.fetchOk,
    Http.client.withFetchOptions({ credentials: "include" }),
    Http.response.text
    )
  • #2207 2fb7d9c Thanks @github-actions! - Release Effect 3.0 🎉

Patch Changes

0.48.29

Patch Changes

  • #2517 b79cc59 Thanks @tim-smart! - add uninterruptible option to http routes, for marking a route as uninterruptible

0.48.28

Patch Changes

0.48.27

Patch Changes

0.48.26

Patch Changes

  • #2477 365a486 Thanks @tim-smart! - add PlatformConfigProvider module

    It contains a file tree provider, that can be used to read config values from a file tree.

    For example, if you have a file tree like this:

    config/
    secret
    nested/
    value

    You could do the following:

    import { PlatformConfigProvider } from "@effect/platform"
    import { NodeContext } from "@effect/platform-node"
    import { Config, Effect, Layer } from "effect"
    const ConfigProviderLive = PlatformConfigProvider.layerFileTree({
    rootDirectory: `/config`
    }).pipe(Layer.provide(NodeContext.layer))
    Effect.gen(function* (_) {
    const secret = yield* _(Config.secret("secret"))
    const value = yield* _(Config.string("value"), Config.nested("nested"))
    }).pipe(Effect.provide(ConfigProviderLive))

0.48.25

Patch Changes

0.48.24

Patch Changes

0.48.23

Patch Changes

0.48.22

Patch Changes

0.48.21

Patch Changes

0.48.20

Patch Changes

  • #2413 4789083 Thanks @tim-smart! - make /platform ClientRequest implement Effect

    ClientRequest now implements Effect<ClientResponse, HttpClientError, Client.Default | Scope>

    This makes it easier to quickly create a request and execute it in a single line.

    import * as Http from "@effect/platform/HttpClient"
    Http.request
    .get("https://jsonplaceholder.typicode.com/todos/1")
    .pipe(Http.response.json)
  • #2413 4789083 Thanks @tim-smart! - prevent unhandled errors in undici http client

0.48.19

Patch Changes

0.48.18

Patch Changes

0.48.17

Patch Changes

0.48.16

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 [9392de6, 3307729, 9392de6, 3307729, d17a427]:

    • @effect/schema@0.64.12
    • effect@2.4.12

0.48.15

Patch Changes

0.48.14

Patch Changes

  • Updated dependencies [9bab1f9, 9bbde5b]:
    • effect@2.4.10
    • @effect/schema@0.64.10

0.48.13

Patch Changes

0.48.12

Patch Changes

  • Updated dependencies [e0af20e]:
    • @effect/schema@0.64.8

0.48.11

Patch Changes

0.48.10

Patch Changes

  • #2357 71fd528 Thanks @tim-smart! - make more data types in /platform implement Inspectable

  • Updated dependencies [71fd528]:

    • effect@2.4.9
    • @effect/schema@0.64.7

0.48.9

Patch Changes

0.48.8

Patch Changes

  • #2334 69d27bb Thanks @tim-smart! - add .watch method to /platform FileSystem

    It can be used to listen for file system events. Example:

    import { FileSystem } from "@effect/platform"
    import { NodeFileSystem, NodeRuntime } from "@effect/platform-node"
    import { Console, Effect, Stream } from "effect"
    Effect.gen(function* (_) {
    const fs = yield* _(FileSystem.FileSystem)
    yield* _(fs.watch("./"), Stream.runForEach(Console.log))
    }).pipe(Effect.provide(NodeFileSystem.layer), NodeRuntime.runMain)
  • Updated dependencies [d0f56c6]:

    • @effect/schema@0.64.5

0.48.7

Patch Changes

0.48.6

Patch Changes

  • Updated dependencies [eb93283]:
    • effect@2.4.7
    • @effect/schema@0.64.4

0.48.5

Patch Changes

0.48.4

Patch Changes

  • Updated dependencies [cfef6ec]:
    • @effect/schema@0.64.3

0.48.3

Patch Changes

0.48.2

Patch Changes

0.48.1

Patch Changes

0.48.0

Minor Changes

  • #2287 a1f44cb Thanks @tim-smart! - add option to /platform runMain to disable error reporting

  • #2279 bdff193 Thanks @gcanti! - - src/Worker.ts

    • use CauseEncoded in Worker namespace
    • src/WorkerError.ts
      • use CauseEncoded in Cause

Patch Changes

0.47.1

Patch Changes

0.47.0

Minor Changes

Patch Changes

  • #2267 0f3d99c Thanks @tim-smart! - propogate Socket handler errors to .run Effect

  • #2269 4064ea0 Thanks @jessekelly881! - added PlatformLogger module, for writing logs to a file

    If you wanted to write logfmt logs to a file, you can do the following:

    import { PlatformLogger } from "@effect/platform"
    import { NodeFileSystem, NodeRuntime } from "@effect/platform-node"
    import { Effect, Layer, Logger } from "effect"
    const fileLogger = Logger.logfmtLogger.pipe(PlatformLogger.toFile("log.txt"))
    const LoggerLive = Logger.replaceScoped(
    Logger.defaultLogger,
    fileLogger
    ).pipe(Layer.provide(NodeFileSystem.layer))
    Effect.log("a").pipe(
    Effect.zipRight(Effect.log("b")),
    Effect.zipRight(Effect.log("c")),
    Effect.provide(LoggerLive),
    NodeRuntime.runMain
    )
  • #2261 fa9663c Thanks @tim-smart! - add websocket support to platform http server

    You can use the Http.request.upgrade* apis to access the Socket for the request.

    Here is an example server that handles websockets on the /ws path:

    import { NodeHttpServer, NodeRuntime } from "@effect/platform-node"
    import * as Http from "@effect/platform/HttpServer"
    import { Console, Effect, Layer, Schedule, Stream } from "effect"
    import { createServer } from "node:http"
    const ServerLive = NodeHttpServer.server.layer(() => createServer(), {
    port: 3000
    })
    const HttpLive = Http.router.empty.pipe(
    Http.router.get(
    "/ws",
    Effect.gen(function* (_) {
    yield* _(
    Stream.fromSchedule(Schedule.spaced(1000)),
    Stream.map(JSON.stringify),
    Stream.encodeText,
    Stream.pipeThroughChannel(Http.request.upgradeChannel()),
    Stream.decodeText(),
    Stream.runForEach(Console.log)
    )
    return Http.response.empty()
    })
    ),
    Http.server.serve(Http.middleware.logger),
    Http.server.withLogAddress,
    Layer.provide(ServerLive)
    )
    NodeRuntime.runMain(Layer.launch(HttpLive))
  • Updated dependencies [e03811e, ac41d84, 6137533, f373529, 1bf9f31, e3ff789, 6137533, 507ba40, e466afe, 465be79, f373529, de74eb8, d8e6940]:

    • effect@2.4.2
    • @effect/schema@0.63.3

0.46.3

Patch Changes

  • #2231 7535080 Thanks @tim-smart! - add option to include prefix when mounting an http app to a router

    By default the prefix is removed. For example:

    // Here a request to `/child/hello` will be mapped to `/hello`
    Http.router.mountApp("/child", httpApp)
    // Here a request to `/child/hello` will be mapped to `/child/hello`
    Http.router.mountApp("/child", httpApp, { includePrefix: true })
  • #2232 bd1d7ac Thanks @tim-smart! - use less aggressive type exclusion in http router apis

  • Updated dependencies [a4a0006, 39f583e, f428198, 0a37676, c035972, 6f503b7]:

    • effect@2.4.1
    • @effect/schema@0.63.2

0.46.2

Patch Changes

0.46.1

Patch Changes

0.46.0

Minor Changes

Patch Changes

0.45.6

Patch Changes

0.45.5

Patch Changes

0.45.4

Patch Changes

  • #2174 abcb7d9 Thanks @tim-smart! - add ServerResponse.html/htmlStream api

    It uses the Template module to create html responses

    Example:

    import { Effect } from "effect"
    import * as Http from "@effect/platform/HttpServer"
    Http.response.html`<html>${Effect.succeed(123)}</html>`
  • #2174 abcb7d9 Thanks @tim-smart! - add Template module to platform

    The Template module can be used to create effectful text templates.

    Example:

    import { Effect } from "effect"
    import { Template } from "@effect/platform"
    const t = Template.make`<html>${Effect.succeed(123)}</html>`
    Effect.runSync(t) // returns "<html>123</html>"
  • Updated dependencies [bc8404d, 2c5cbcd, 6565916]:

    • effect@2.3.7
    • @effect/schema@0.62.8

0.45.3

Patch Changes

0.45.2

Patch Changes

0.45.1

Patch Changes

0.45.0

Minor Changes

  • #2119 2b62548 Thanks @tim-smart! - add Scope to Http client

    This change adds a scope to the default http client, ensuring connections are cleaned up if you abort the request at any point.

    Some response helpers have been added to reduce the noise.

    import * as Http from "@effect/platform/HttpClient"
    import { Effect } from "effect"
    // instead of
    Http.request.get("/").pipe(
    Http.client.fetchOk(),
    Effect.flatMap((_) => _.json),
    Effect.scoped
    )
    // you can do
    Http.request.get("/").pipe(Http.client.fetchOk(), Http.response.json)
    // other helpers include
    Http.response.text
    Http.response.stream
    Http.response.arrayBuffer
    Http.response.urlParamsBody
    Http.response.formData
    Http.response.schema * Effect

0.44.7

Patch Changes

0.44.6

Patch Changes

  • Updated dependencies [17bda66]:
    • effect@2.3.4
    • @effect/schema@0.62.5

0.44.5

Patch Changes

0.44.4

Patch Changes

0.44.3

Patch Changes

0.44.2

Patch Changes

0.44.1

Patch Changes

  • Updated dependencies [b5a8215]:
    • effect@2.3.1
    • @effect/schema@0.62.1

0.44.0

Minor Changes

  • #2006 9a2d1c1 Thanks @github-actions! - With this change we now require a string key to be provided for all tags and renames the dear old Tag to GenericTag, so when previously you could do:

    import { Effect, Context } from "effect"
    interface Service {
    readonly _: unique symbol
    }
    const Service = Context.Tag<
    Service,
    {
    number: Effect.Effect<never, never, number>
    }
    >()

    you are now mandated to do:

    import { Effect, Context } from "effect"
    interface Service {
    readonly _: unique symbol
    }
    const Service = Context.GenericTag<
    Service,
    {
    number: Effect.Effect<never, never, number>
    }
    >("Service")

    This makes by default all tags globals and ensures better debuggaility when unexpected errors arise.

    Furthermore we introduce a new way of constructing tags that should be considered the new default:

    import { Effect, Context } from "effect"
    class Service extends Context.Tag("Service")<
    Service,
    {
    number: Effect.Effect<never, never, number>
    }
    >() {}
    const program = Effect.flatMap(Service, ({ number }) => number).pipe(
    Effect.flatMap((_) => Effect.log(`number: ${_}`))
    )

    this will use “Service” as the key and will create automatically an opaque identifier (the class) to be used at the type level, it does something similar to the above in a single shot.

  • #2006 1a77f72 Thanks @github-actions! - change Effect type parameters order from Effect<R, E, A> to Effect<A, E = never, R = never>

  • #2006 af47aa3 Thanks @github-actions! - move where platform worker spawn function is provided

    With this change, the point in which you provide the spawn function moves closer to the edge, where you provide platform specific implementation.

    This seperates even more platform concerns from your business logic. Example:

    import { Worker } from "@effect/platform"
    import { BrowserWorker } from "@effect/platform-browser"
    import { Effect } from "effect"
    Worker.makePool({ ... }).pipe(
    Effect.provide(BrowserWorker.layer(() => new globalThis.Worker(...)))
    )
  • #2006 a34dbdc Thanks @github-actions! - - Schema: change type parameters order from Schema<R, I, A> to Schema<A, I = A, R = never>

    • Serializable: change type parameters order from Serializable<R, I, A> to Serializable<A, I, R>
    • Class: change type parameters order from Class<R, I, A, C, Self, Inherited> to Class<A, I, R, C, Self, Inherited>
    • PropertySignature: change type parameters order from PropertySignature<R, From, FromIsOptional, To, ToIsOptional> to PropertySignature<From, FromIsOptional, To, ToIsOptional, R = never>
  • #2006 b1e2086 Thanks @github-actions! - remove re-exports from platform packages

  • #2006 02c3461 Thanks @github-actions! - With this change we remove the Data.Data type and we make Equal.Equal & Hash.Hash implicit traits.

    The main reason is that Data.Data<A> was structurally equivalent to A & Equal.Equal but extending Equal.Equal doesn’t mean that the equality is implemented by-value, so the type was simply adding noise without gaining any level of safety.

    The module Data remains unchanged at the value level, all the functions previously available are supposed to work in exactly the same manner.

    At the type level instead the functions return Readonly variants, so for example we have:

    import { Data } from "effect"
    const obj = Data.struct({
    a: 0,
    b: 1
    })

    will have the obj typed as:

    declare const obj: {
    readonly a: number
    readonly b: number
    }
  • #2006 6361ee2 Thanks @github-actions! - fix for encoding of Transferable schemas

  • #2006 86f665d Thanks @github-actions! - use Context for collecting tranferables

    This changes the platform Transferable module to use Effect context to collect tranferables when using schemas with workers etc.

    You can now use a tranferable data type anywhere in your schema without having to wrap the outermost schema:

    import { Transferable } from "@effect/platform"
    import { Schema } from "@effect/schema"
    const structWithTransferable = Schema.struct({
    data: Transferable.Uint8Array
    })
  • #2006 9a2d1c1 Thanks @github-actions! - This change enables Effect.serviceConstants and Effect.serviceMembers to access any constant in the service, not only the effects, namely it is now possible to do:

    import { Effect, Context } from "effect"
    class NumberRepo extends Context.TagClass("NumberRepo")<
    NumberRepo,
    {
    readonly numbers: Array<number>
    }
    >() {
    static numbers = Effect.serviceConstants(NumberRepo).numbers
    }

Patch Changes

0.43.11

Patch Changes

  • Updated dependencies [3ddfdbf, 3ddfdbf]:
    • effect@2.2.5
    • @effect/schema@0.61.7

0.43.10

Patch Changes

0.43.9

Patch Changes

0.43.8

Patch Changes

  • #2037 32bf796 Thanks @tim-smart! - remove overloads from ClientRequest.make

    This makes it easier to programatically create client request instances:

    import * as Http from "@effect/platform/HttpClient"
    declare const method: "GET" | "POST"
    declare const url: string
    Http.request.make(method)(url)

0.43.7

Patch Changes

0.43.6

Patch Changes

0.43.5

Patch Changes

0.43.4

Patch Changes

0.43.3

Patch Changes

  • Updated dependencies [9863e2f]:
    • @effect/schema@0.61.3

0.43.2

Patch Changes

  • Updated dependencies [64f710a]:
    • @effect/schema@0.61.2

0.43.1

Patch Changes

0.43.0

Minor Changes

Patch Changes

0.42.7

Patch Changes

0.42.6

Patch Changes

  • Updated dependencies [21b9edd]:
    • effect@2.1.2
    • @effect/schema@0.60.6

0.42.5

Patch Changes

  • Updated dependencies [3bf67cf]:
    • @effect/schema@0.60.5

0.42.4

Patch Changes

0.42.3

Patch Changes

0.42.2

Patch Changes

0.42.1

Patch Changes

  • Updated dependencies [f7f19f6]:
    • effect@2.0.5
    • @effect/schema@0.60.1

0.42.0

Minor Changes

Patch Changes

0.41.0

Minor Changes

Patch Changes

0.40.4

Patch Changes

0.40.3

Patch Changes

0.40.2

Patch Changes

0.40.1

Patch Changes

  • Updated dependencies [16bd87d]:
    • effect@2.0.1
    • @effect/schema@0.57.1

0.40.0

Minor Changes

Patch Changes

0.39.0

Minor Changes

0.38.0

Minor Changes

0.37.8

Patch Changes

0.37.7

Patch Changes

0.37.6

Patch Changes

0.37.5

Patch Changes

0.37.4

Patch Changes

0.37.3

Patch Changes

0.37.2

Patch Changes

0.37.1

Patch Changes

0.37.0

Minor Changes

0.36.0

Minor Changes

Patch Changes

0.35.0

Minor Changes

Patch Changes

0.34.0

Minor Changes

0.33.1

Patch Changes

0.33.0

Minor Changes

Patch Changes

  • #319 425365e Thanks @IMax153! - add Terminal.readLine to read input line-by-line from the terminal

  • #319 425365e Thanks @IMax153! - make Terminal.columns an Effect to account for resizing the terminal

0.32.2

Patch Changes

0.32.1

Patch Changes

0.32.0

Minor Changes

Patch Changes

0.31.2

Patch Changes

0.31.1

Patch Changes

0.31.0

Minor Changes

Patch Changes

0.30.6

Patch Changes

0.30.5

Patch Changes

0.30.4

Patch Changes

0.30.3

Patch Changes

0.30.2

Patch Changes

0.30.1

Patch Changes

0.30.0

Minor Changes

0.29.1

Patch Changes

0.29.0

Minor Changes

0.28.4

Patch Changes

0.28.3

Patch Changes

0.28.2

Patch Changes

0.28.1

Patch Changes

0.28.0

Minor Changes

0.27.4

Patch Changes

0.27.3

Patch Changes

0.27.2

Patch Changes

0.27.1

Patch Changes

0.27.0

Minor Changes

0.26.7

Patch Changes

0.26.6

Patch Changes

0.26.5

Patch Changes

0.26.4

Patch Changes

0.26.3

Patch Changes

  • #227 abb6baa Thanks @patroza! - feat: cache the reading of text/urlParamsBody/formData bodies so they can be reused

0.26.2

Patch Changes

0.26.1

Patch Changes

0.26.0

Minor Changes

0.25.1

Patch Changes

0.25.0

Minor Changes

0.24.0

Minor Changes

0.23.1

Patch Changes

0.23.0

Minor Changes

0.22.1

Patch Changes

0.22.0

Minor Changes

0.21.0

Minor Changes

Patch Changes

0.20.0

Minor Changes

0.19.0

Minor Changes

Patch Changes

0.18.7

Patch Changes

0.18.6

Patch Changes

0.18.5

Patch Changes

0.18.4

Patch Changes

0.18.3

Patch Changes

0.18.2

Patch Changes

0.18.1

Patch Changes

0.18.0

Minor Changes

0.17.1

Patch Changes

0.17.0

Minor Changes

0.16.1

Patch Changes

0.16.0

Minor Changes

Patch Changes

0.15.2

Patch Changes

0.15.1

Patch Changes

0.15.0

Minor Changes

0.14.1

Patch Changes

0.14.0

Minor Changes

0.13.16

Patch Changes

0.13.15

Patch Changes

0.13.14

Patch Changes

0.13.13

Patch Changes

0.13.12

Patch Changes

0.13.11

Patch Changes

0.13.10

Patch Changes

0.13.9

Patch Changes

0.13.8

Patch Changes

0.13.7

Patch Changes

0.13.6

Patch Changes

0.13.5

Patch Changes

0.13.4

Patch Changes

0.13.3

Patch Changes

0.13.2

Patch Changes

0.13.1

Patch Changes

0.13.0

Minor Changes

0.12.1

Patch Changes

0.12.0

Minor Changes

Patch Changes

0.11.5

Patch Changes

0.11.4

Patch Changes

0.11.3

Patch Changes

0.11.2

Patch Changes

0.11.1

Patch Changes

0.11.0

Minor Changes

Patch Changes

0.10.4

Patch Changes

0.10.3

Patch Changes

0.10.2

Patch Changes

0.10.1

Patch Changes

0.10.0

Minor Changes

0.9.0

Minor Changes

0.8.0

Minor Changes

0.7.0

Minor Changes

0.6.0

Minor Changes

0.5.0

Minor Changes

0.4.0

Minor Changes

0.3.0

Minor Changes

0.2.0

Minor Changes

  • #20 756ccbe Thanks @IMax153! - upgrade to @effect/data@0.13.5, @effect/io@0.31.3, and @effect/stream@0.25.1

0.1.0

Minor Changes