Skip to content

feat(rpc): Add parseOptions#2197

Open
patroza wants to merge 2 commits into
Effect-TS:mainfrom
patroza:rpc/add-parse-options
Open

feat(rpc): Add parseOptions#2197
patroza wants to merge 2 commits into
Effect-TS:mainfrom
patroza:rpc/add-parse-options

Conversation

@patroza
Copy link
Copy Markdown
Contributor

@patroza patroza commented May 16, 2026

#2124 RPC schema parsing in v4 was not configurable at the RPC boundary, forcing schema-level annotations for behaviors like concurrency. This change adds first-class parse concurrency support to both client and server so schema parsing concurrency can be controlled per RPC instance.

  • API surface

    • Added parseOptions?: Pick<AST.ParseOptions, "concurrency"> to:
      • RpcClient.make(...)
      • RpcServer.make(...)
      • server forwarding APIs (layer, layerHttp, toHttpEffect, toHttpEffectWebsocket)
  • Client-side wiring

    • Threaded concurrency parse options through client schema operations used during request/response processing:
      • payload encoding
      • stream chunk decoding
      • exit decoding
    • Refactored schema cache creation to be parse-options aware per client instance.
    • Normalized runtime parseOptions before schema usage so only { concurrency } is forwarded, even if extra properties are provided at runtime.
  • Server-side wiring

    • Threaded concurrency parse options through server schema operations used during request/response processing:
      • request payload decoding
      • stream chunk encoding
      • exit encoding
      • defect encoding
    • Normalized runtime parseOptions before schema usage so only { concurrency } is forwarded, even if extra properties are provided at runtime.
  • Tests

    • Updated RPC parse-options tests to validate concurrency-only configuration on both client and server paths.
    • Added coverage that passes extra runtime parse options (for example onExcessProperty) and verifies only concurrency is effectively applied.
  • Release note

    • Added a changeset describing RPC parse concurrency capability.

Example usage:

const client = yield* RpcClient.make(group, {
  parseOptions: {
    concurrency: "unbounded"
  }
})

const server = yield* RpcServer.make(group, {
  parseOptions: {
    concurrency: 16
  }
})

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 16, 2026

🦋 Changeset detected

Latest commit: 5929134

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 27 packages
Name Type
effect Patch
@effect/opentelemetry Patch
@effect/platform-browser Patch
@effect/platform-bun Patch
@effect/platform-node-shared Patch
@effect/platform-node Patch
@effect/vitest Patch
@effect/ai-anthropic Patch
@effect/ai-openai-compat Patch
@effect/ai-openai Patch
@effect/ai-openrouter Patch
@effect/atom-react Patch
@effect/atom-solid Patch
@effect/atom-vue Patch
@effect/sql-clickhouse Patch
@effect/sql-d1 Patch
@effect/sql-libsql Patch
@effect/sql-mssql Patch
@effect/sql-mysql2 Patch
@effect/sql-pg Patch
@effect/sql-pglite Patch
@effect/sql-sqlite-bun Patch
@effect/sql-sqlite-do Patch
@effect/sql-sqlite-node Patch
@effect/sql-sqlite-react-native Patch
@effect/sql-sqlite-wasm Patch
@effect/openapi-generator Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@mikearnaldi mikearnaldi requested a review from tim-smart May 16, 2026 07:34
@patroza patroza force-pushed the rpc/add-parse-options branch from 1a80774 to 76f6a5c Compare May 16, 2026 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant