Effect v4 Beta: June Updates
June brought another round of updates to the Effect v4 beta.
This month’s work included new rate limiting capabilities, Schema improvements, SQL and CLI updates, plus a series of fixes across OpenTelemetry, HTTP, RPC, and core.
Here’s everything that landed in effect-smol during June.
Added RateLimiter.adaptive, a new rate limiter strategy that dynamically adjusts limits based on upstream response signals. It complements the existing fixed and token-bucket strategies, making it easier to handle APIs that communicate backpressure through their responses rather than requiring a statically configured limit.
June brought a broad round of Schema performance work, correctness fixes, and small API additions.
Performance. Improved Schema type-level performance, reducing compile-time overhead for large schema definitions.
Correctness fixes. Fixed handling of encoded-side checks for container ASTs. Fixed Schema.Void to align with TypeScript behavior. Fixed Config.schema so missing array values are treated as missing data rather than an empty array.
API additions. Removed the keepDeclarations option from Schema.toCodecStringTree. Exposed source schema on schema wrappers for introspection. Emitted Schema.ConstraintDecoder in generated SSE clients. Switched to URL.canParse for URL schema decoding. Added Latch.isOpen to query latch state.
Added custom errors to Effect.fromOption, allowing callers to supply a typed error value instead of always receiving NoSuchElementException. This makes fromOption more composable in pipelines where the error channel is already typed.
Fixed frozen intrinsics when adjusting Error.stackTraceLimit.
Several improvements to trace quality and signal-to-noise ratio:
- Rendered causes in OTLP tracer exception events, providing richer diagnostic data in trace spans
- Preserved external span sampling, ensuring spans originating outside Effect respect their original sampling decisions
- Stripped response metadata from HTTP server span failures to reduce noise in traces
New APIs. Added SQL.valuesUnprepared for raw value interpolation in queries. Added additional connection options to MssqlClientConfig.
Bug fixes. Fixed sqlite-do Durable Object transactions. Fixed sqlite-bun to fail with a typed SqlError when statement preparation throws, rather than an untyped exception. Scoped unknown request tag failures to the request instead of the connection.
Failed RpcClient HTTP requests with a defect when the response closes early. Fixed the bundle resolver for package export subpaths. Matched NodeHttpServer.layerConfig services.
Fixed ai-anthropic to emit null instead of undefined for the caller toolId field in non-streaming responses, aligning with expected JSON serialization behavior.
Fixed Cron.next skipping days when overflowing month boundaries — a correctness bug that could cause scheduled tasks to miss their next execution when a cron expression landed on the last days of a month.
Exposed the CLI environment to schemas, enabling context-aware schema validation inside CLI commands. This allows schemas to access environment services when validating CLI input, consistent with how context-aware defaults work elsewhere in the library.
Stopped using performance.timeOrigin and switched to lazy origin calculation. This avoids issues in environments where the Performance API is restricted or unavailable, improving compatibility across runtimes.
Refactored the Schedule cookbook. Clarified Redacted schema migration docs. Added an unused internal export lint rule.
If you missed the earlier updates, the February–May recap covers all the major changes since the v4 beta launch.
For week-by-week updates, follow the This Week in Effect series.
To try the Effect v4 beta:
npm install effect@betapnpm add effect@betayarn add effect@betabun add effect@betaHappy Effecting. 🚀