Conversation
🦋 Changeset detectedLatest commit: 1159d40 The changes in this PR will be included in the next version bump. This PR includes no changesetsWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types 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 |
a27d8de to
02a3f06
Compare
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughMigrates the codebase to Effect v4: replaces Effect.Service/Tag and FiberRefs patterns with ServiceMap.Service and a ServiceContextBridge, updates effect execution and error mapping, converts services/tests/examples to ServiceMap + Layer, and bumps package versions and CI triggers for the effect-v4 pre-release. Changes
Sequence Diagram(s)sequenceDiagram
actor Client
participant EffectBuilder
participant ServiceContextBridge
participant ManagedRuntime
participant Database
Client->>EffectBuilder: invoke RPC handler
EffectBuilder->>ServiceContextBridge: getCurrentServices()
ServiceContextBridge-->>EffectBuilder: captured services or undefined
EffectBuilder->>ManagedRuntime: merge runtime.services() with captured services
ManagedRuntime->>ManagedRuntime: run effect (runPromiseExitWith / runPromiseExit)
ManagedRuntime->>Database: call Layer-provided DatabaseService
Database-->>ManagedRuntime: return query/insert result
ManagedRuntime-->>EffectBuilder: effect Exit (success/failure)
EffectBuilder->>EffectBuilder: map Exit.cause → ORPCError (toORPCErrorFromCause) on failure
EffectBuilder->>Client: return result or mapped ORPCError
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
13ffad5 to
8896026
Compare
There was a problem hiding this comment.
Actionable comments posted: 5
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
packages/effect-orpc/package.json (1)
57-63:⚠️ Potential issue | 🟠 MajorBound the
effectpeer range to<5.
>=4.0.0-beta.27allows future5.xreleases when published. Since the package explicitly targets Effect v4 (version1.0.0-v4.0, commit "prerelease for effect-v4") and devDependencies uses^4.0.0-beta.27to lock to v4, the peer range should match. Add an upper bound to prevent package managers from satisfying the peer with an unsupported major version.Suggested fix
"peerDependencies": { "@orpc/client": ">=1.13.0", "@orpc/contract": ">=1.13.0", "@orpc/server": ">=1.13.0", "@orpc/shared": ">=1.13.0", - "effect": ">=4.0.0-beta.27", + "effect": ">=4.0.0-beta.27 <5", "typescript": "^5" }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/effect-orpc/package.json` around lines 57 - 63, Update the peerDependencies range for the effect package so it forbids Effect v5; specifically change the "effect" entry currently set to ">=4.0.0-beta.27" to a bounded range that matches devDependencies and the package intent (e.g. ">=4.0.0-beta.27 <5") so consumers cannot satisfy the peer with an incompatible major version; edit the "peerDependencies" block in package.json where "effect" is declared to apply this upper bound.README.md (1)
317-321:⚠️ Potential issue | 🟡 MinorUpdate terminology to reflect the migration.
Line 321 mentions "FiberRef state" but the code has migrated to
ServiceMap-based context. The earlier section (line 105) correctly mentions "ServiceMap.Reference-backed values". Consider updating this section to use consistent terminology:📝 Suggested wording update
-`FiberRef` state from outer middleware. +service context from outer middleware.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@README.md` around lines 317 - 321, Update the wording in the "Request-Scoped Fiber Context" section to replace references to "FiberRef state" with the current terminology "ServiceMap.Reference-backed values" (or simply "ServiceMap-based context"), so the README consistently refers to ServiceMap.Reference-backed values throughout; specifically change the sentence mentioning "FiberRef state" to mention "ServiceMap.Reference-backed values" and ensure any nearby examples/phrasing align with earlier text that references ServiceMap.Reference.
🧹 Nitpick comments (2)
.changeset/fluffy-times-shave.md (1)
5-5: Add one concrete migration note here.This body will become the release note/changelog entry, and right now it only repeats the title. For a major bump, include at least one actionable breaking-change detail so consumers know what to update first.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.changeset/fluffy-times-shave.md at line 5, Replace the placeholder body in .changeset/fluffy-times-shave.md with a concrete migration note for "migrate to effect-v4 (effect-smol)" that lists at least one actionable breaking change and how to address it (e.g., package rename, renamed/removed functions, changes to effect runtime setup or import paths); mention the exact symbol(s) to update in downstream code (for example old-package->new-package or function names that changed) and a short example migration step like which imports to replace and how to initialize the new runtime so consumers can apply the change immediately.packages/effect-orpc/src/node.ts (1)
19-25: Consider renamingwithFiberContextto reflect new semantics.The function now captures
ServiceMapviaEffect.services<R>()rather thanFiberRefs. The internal types (ServiceContextBridge,servicesStorage) have been updated, but the public function name still references "FiberContext". For API clarity, consider renaming towithServiceContextor similar.♻️ Suggested rename
-export function withFiberContext<T, R = never>( +export function withServiceContext<T, R = never>( fn: () => Promise<T>, ): Effect.Effect<T, never, R> { return Effect.flatMap(Effect.services<R>(), (services) => Effect.promise(() => servicesStorage.run(services, fn)), ); } + +/** `@deprecated` Use withServiceContext instead */ +export const withFiberContext = withServiceContext;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/effect-orpc/src/node.ts` around lines 19 - 25, The exported function withFiberContext now captures a ServiceMap via Effect.services<R>() and uses ServiceContextBridge/servicesStorage, so rename the public API and internal references to reflect services (e.g., withServiceContext) to avoid the "Fiber" misnomer; update the function name (withFiberContext → withServiceContext), any re-exports, type annotations, and all usages/imports across the codebase, and ensure the exported signature and JSDoc/comments reference Effect.services, ServiceContextBridge, and servicesStorage consistently.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.changeset/pre.json:
- Around line 1-10: Run the project's formatter (oxfmt) on the changeset
pre-release JSON to normalize formatting and fix CI; specifically run the
formatter that fixes .changeset/pre.json, save the updated file, and commit the
changes so the keys "mode", "tag", "initialVersions", and "changesets" remain
intact and pass format:check.
- Around line 4-6: Update the prerelease metadata so Changesets computes the
correct prerelease state: open the JSON object key initialVersions.effect-orpc
in .changeset/pre.json and change its value from "0.1.1" to the latest pre-v4
release "0.1.2" to match the CHANGELOG entry.
In `@examples/hono-request-context/services/cache.ts`:
- Around line 27-29: The SQL builds a query by interpolating the variable key
into the string (in the db.query call), which can encourage SQL injection;
change the call to use a parameterized query instead (use
DatabaseService.query/db.query parameter binding rather than string
concatenation), passing the SQL with a placeholder and supplying key as a
separate parameter, and remove the template literal concatenation around key so
the query is executed with proper binding.
In `@packages/effect-orpc/src/types/index.ts`:
- Around line 135-139: Replace the non-existent Effect.gen.Return usage with
Effect.fn.Return for the generator return type in the ORPC handler signature:
update the return type currently written as Effect.gen.Return<THandlerOutput,
EffectErrorMapToUnion<TEffectErrorMap> | ORPCError<ORPCErrorCode, unknown>,
TRequirementsProvided> to use Effect.fn.Return with the same type parameters so
the generator body type for Effect.fnUntraced is correct; locate the signature
that references THandlerOutput, EffectErrorMapToUnion<TEffectErrorMap> |
ORPCError<ORPCErrorCode, unknown>, and TRequirementsProvided and swap gen.Return
for fn.Return.
In `@README.md`:
- Around line 97-131: This README contains a duplicate "Request-Scoped Context"
section that repeats the "Request-Scoped Fiber Context" content; remove the
redundant section and consolidate both into a single canonical section titled
"Request-Scoped Fiber Context" (or choose one title) keeping the example that
references withFiberContext and the effect-orpc/node entrypoint, preserving the
note about not needing the /node entrypoint when context propagation isn't
required, and update any internal links or table-of-contents references so they
point to the single retained section.
---
Outside diff comments:
In `@packages/effect-orpc/package.json`:
- Around line 57-63: Update the peerDependencies range for the effect package so
it forbids Effect v5; specifically change the "effect" entry currently set to
">=4.0.0-beta.27" to a bounded range that matches devDependencies and the
package intent (e.g. ">=4.0.0-beta.27 <5") so consumers cannot satisfy the peer
with an incompatible major version; edit the "peerDependencies" block in
package.json where "effect" is declared to apply this upper bound.
In `@README.md`:
- Around line 317-321: Update the wording in the "Request-Scoped Fiber Context"
section to replace references to "FiberRef state" with the current terminology
"ServiceMap.Reference-backed values" (or simply "ServiceMap-based context"), so
the README consistently refers to ServiceMap.Reference-backed values throughout;
specifically change the sentence mentioning "FiberRef state" to mention
"ServiceMap.Reference-backed values" and ensure any nearby examples/phrasing
align with earlier text that references ServiceMap.Reference.
---
Nitpick comments:
In @.changeset/fluffy-times-shave.md:
- Line 5: Replace the placeholder body in .changeset/fluffy-times-shave.md with
a concrete migration note for "migrate to effect-v4 (effect-smol)" that lists at
least one actionable breaking change and how to address it (e.g., package
rename, renamed/removed functions, changes to effect runtime setup or import
paths); mention the exact symbol(s) to update in downstream code (for example
old-package->new-package or function names that changed) and a short example
migration step like which imports to replace and how to initialize the new
runtime so consumers can apply the change immediately.
In `@packages/effect-orpc/src/node.ts`:
- Around line 19-25: The exported function withFiberContext now captures a
ServiceMap via Effect.services<R>() and uses
ServiceContextBridge/servicesStorage, so rename the public API and internal
references to reflect services (e.g., withServiceContext) to avoid the "Fiber"
misnomer; update the function name (withFiberContext → withServiceContext), any
re-exports, type annotations, and all usages/imports across the codebase, and
ensure the exported signature and JSDoc/comments reference Effect.services,
ServiceContextBridge, and servicesStorage consistently.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 56e55bb5-a550-4419-bb71-c9d47a16a00a
⛔ Files ignored due to path filters (1)
bun.lockis excluded by!**/*.lock
📒 Files selected for processing (23)
.changeset/fluffy-times-shave.md.changeset/pre.json.github/workflows/publish.ymlREADME.mdexamples/README.mdexamples/hono-request-context/README.mdexamples/hono-request-context/index.tsexamples/hono-request-context/package.jsonexamples/hono-request-context/runtime.tsexamples/hono-request-context/services/cache.tsexamples/hono-request-context/services/database.tsexamples/hono-request-context/services/order.tspackages/effect-orpc/CHANGELOG.mdpackages/effect-orpc/package.jsonpackages/effect-orpc/src/effect-builder.tspackages/effect-orpc/src/effect-enhance-router.tspackages/effect-orpc/src/fiber-context-bridge.tspackages/effect-orpc/src/node.tspackages/effect-orpc/src/service-context-bridge.tspackages/effect-orpc/src/tagged-error.tspackages/effect-orpc/src/tests/effect-builder.test.tspackages/effect-orpc/src/tests/tagged-error.test.tspackages/effect-orpc/src/types/index.ts
💤 Files with no reviewable changes (1)
- packages/effect-orpc/src/fiber-context-bridge.ts
e0e28ce to
8a0a1b8
Compare
There was a problem hiding this comment.
Actionable comments posted: 5
♻️ Duplicate comments (1)
packages/effect-orpc/src/types/index.ts (1)
135-139:⚠️ Potential issue | 🔴 CriticalStill using the wrong Effect v4 generator return alias.
The Effect v4 API docs expose
ReturnunderEffect.fn, notEffect.gen. This exported handler type should useEffect.fn.Return<...>here rather thanEffect.gen.Return<...>. (effect-ts.github.io)Suggested fix
-) => Effect.gen.Return< +) => Effect.fn.Return<🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/effect-orpc/src/types/index.ts` around lines 135 - 139, The exported handler type is using the wrong Effect v4 generator alias; replace Effect.gen.Return with Effect.fn.Return in the handler return type so the signature becomes (... ) => Effect.fn.Return<THandlerOutput, EffectErrorMapToUnion<TEffectErrorMap> | ORPCError<ORPCErrorCode, unknown>, TRequirementsProvided>; update the type at the declaration referencing this handler (the function type that currently ends with Effect.gen.Return) to use Effect.fn.Return and ensure any imports/usage align with Effect v4's Effect.fn API.
🧹 Nitpick comments (3)
packages/effect-orpc/src/node.ts (1)
19-24: Consider renamingwithFiberContextto reflect new semantics.The function now propagates
ServiceMaprather thanFiberRefs, but retains the namewithFiberContext. This could be confusing for users. Consider renaming towithServiceContextor adding a JSDoc explaining the semantic change.💡 Optional rename suggestion
-export function withFiberContext<T, R = never>( +export function withServiceContext<T, R = never>( fn: () => Promise<T>, ): Effect.Effect<T, never, R> { return Effect.flatMap(Effect.services<R>(), (services) => servicesStorage.run(services, fn), ); } + +/** `@deprecated` Use withServiceContext instead */ +export const withFiberContext = withServiceContext;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/effect-orpc/src/node.ts` around lines 19 - 24, Rename or document the function to reflect that it propagates a ServiceMap rather than FiberRefs: either rename withFiberContext to withServiceContext (and update all references/exports/usages accordingly) or add a clear JSDoc above withFiberContext describing that it runs the provided fn with the services from servicesStorage (a ServiceMap) rather than fiber-local refs; ensure the JSDoc mentions servicesStorage and ServiceMap so callers understand the new semantics.examples/hono-request-context/services/order.ts (1)
55-57: Derive the logged order count instead of hard-coding3.This annotation will drift the next time
HARDCODED_ORDERSchanges and can make the logs misleading. Use the collection size so the telemetry stays accurate.Possible tweak
yield* Effect.logInfo("Listing all orders").pipe( - Effect.annotateLogs({ count: 3 }), + Effect.annotateLogs({ + count: Object.keys(HARDCODED_ORDERS).length, + }), );🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@examples/hono-request-context/services/order.ts` around lines 55 - 57, Replace the hard-coded annotation value with the actual number of orders: compute the collection size (e.g., using HARDCODED_ORDERS.length or the variable that holds the orders result) and pass that value into Effect.annotateLogs instead of 3; update the logging call that uses Effect.logInfo(...).pipe(Effect.annotateLogs(...)) so the annotation derives from the orders collection size (reference HARDCODED_ORDERS and the Effect.annotateLogs call to locate the change).packages/effect-orpc/src/tests/effect-builder.test.ts (1)
166-298: Please keep the new coverage on Bun's test runner.These ServiceMap cases are useful, but adding them to this Vitest-based
*.test.tssuite pushes the migration further away from the repo standard. Please port the added coverage to Bun's test APIs before expanding this suite again.As per coding guidelines,
**/*.test.{ts,tsx,js,jsx}: Usebun testinstead ofjestorvitestfor running tests.Also applies to: 405-445, 605-640
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/effect-orpc/src/tests/effect-builder.test.ts` around lines 166 - 298, The new tests in effect-builder.test.ts use Vitest APIs and should be ported to Bun's test runner: extract the added ServiceMap cases (the tests exercising builder.effect/applied["~effect"].handler, withFiberContext, makeEffectORPC, ManagedRuntime, RequestId and the Counter Service class) into a Bun-compatible test file using Bun.test/Bun.assert style (or the repo's existing Bun test helpers), remove Vitest-specific imports/assertions, and ensure the tests still provide RequestId via Effect.provideService and dispose ManagedRuntime instances; keep the same assertions and behavior but replace Vitest APIs so the coverage remains runnable under bun test.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@examples/hono-request-context/package.json`:
- Around line 9-19: Update the dependency specifiers for the Effect beta
packages to exact versions to avoid prerelease drift: replace the caret ranges
for "@effect/opentelemetry" and "effect" (currently "^4.0.0-beta.27") with exact
pinned versions "4.0.0-beta.27" so installs cannot pull a newer beta; ensure you
update the entries for "@effect/opentelemetry" and "effect" in package.json
accordingly and run a reinstall to verify lockfile consistency.
In `@examples/hono-request-context/services/cache.ts`:
- Around line 1-50: The file has formatting issues causing the pipeline to fail;
run the project's formatter (oxfmt) on this file and commit the corrected
formatting. Specifically, format examples/hono-request-context/services/cache.ts
(affecting the CacheService class and its make generator, and the get/set
methods) by running oxfmt (or the repo's formatting script) to auto-fix
whitespace/line breaks and then re-run the pipeline; ensure the
CacheService.layer, make, get, and set symbols remain unchanged except for
formatting-only edits.
In `@packages/effect-orpc/src/effect-builder.ts`:
- Around line 663-672: The call to the non-existent Effect.runPromiseExitWith
should be replaced: detect when parentServices is present and either (a) provide
the merged services into the effect via Effect.provide(ServiceMap.merge(await
runtime.services(), parentServices)) on tracedEffect before running with
runtime.runPromiseExit, or (b) construct a custom runtime with merged services
and call Runtime.runPromiseExit(customRuntime)(tracedEffect, { signal:
opts.signal }); update the branch that currently uses Effect.runPromiseExitWith
to use one of these two approaches (refer to parentServices, ServiceMap.merge,
tracedEffect, runtime.runPromiseExit and Runtime.runPromiseExit) so the code
compiles against Effect v4 API.
- Around line 101-134: The function toORPCErrorFromCause incorrectly treats
Cause as having a reasons array; update it to use Effect v4's Cause API (e.g.,
use Cause.failureOption(), Cause.squash(), or Cause.match()) to extract the
underlying failure/die/interrupt instead of accessing cause.reasons[0]; then
apply the existing guards (Cause.isFailReason, Cause.isDieReason) or pattern
branches on the matched result to construct and return the proper ORPCError
(preserve existing branches for Fail → check isORPCTaggedError/instanceof
ORPCError, Die → include defect, and Interrupt → create an Interrupted error).
In `@packages/effect-orpc/src/node.ts`:
- Around line 19-24: The code calls a nonexistent Effect.services<R>() inside
withFiberContext; replace this with a supported Effect v4 pattern: either fetch
the specific services you need via Effect.all(...) or the documented helpers
(Effect.serviceOption / Effect.serviceOptional) or implement a small custom
services() helper for this bridge, then pass those retrieved services into
servicesStorage.run(..., fn); update references to Effect.services in
withFiberContext to use the chosen approach and ensure servicesStorage.run still
receives the same service map shape.
---
Duplicate comments:
In `@packages/effect-orpc/src/types/index.ts`:
- Around line 135-139: The exported handler type is using the wrong Effect v4
generator alias; replace Effect.gen.Return with Effect.fn.Return in the handler
return type so the signature becomes (... ) => Effect.fn.Return<THandlerOutput,
EffectErrorMapToUnion<TEffectErrorMap> | ORPCError<ORPCErrorCode, unknown>,
TRequirementsProvided>; update the type at the declaration referencing this
handler (the function type that currently ends with Effect.gen.Return) to use
Effect.fn.Return and ensure any imports/usage align with Effect v4's Effect.fn
API.
---
Nitpick comments:
In `@examples/hono-request-context/services/order.ts`:
- Around line 55-57: Replace the hard-coded annotation value with the actual
number of orders: compute the collection size (e.g., using
HARDCODED_ORDERS.length or the variable that holds the orders result) and pass
that value into Effect.annotateLogs instead of 3; update the logging call that
uses Effect.logInfo(...).pipe(Effect.annotateLogs(...)) so the annotation
derives from the orders collection size (reference HARDCODED_ORDERS and the
Effect.annotateLogs call to locate the change).
In `@packages/effect-orpc/src/node.ts`:
- Around line 19-24: Rename or document the function to reflect that it
propagates a ServiceMap rather than FiberRefs: either rename withFiberContext to
withServiceContext (and update all references/exports/usages accordingly) or add
a clear JSDoc above withFiberContext describing that it runs the provided fn
with the services from servicesStorage (a ServiceMap) rather than fiber-local
refs; ensure the JSDoc mentions servicesStorage and ServiceMap so callers
understand the new semantics.
In `@packages/effect-orpc/src/tests/effect-builder.test.ts`:
- Around line 166-298: The new tests in effect-builder.test.ts use Vitest APIs
and should be ported to Bun's test runner: extract the added ServiceMap cases
(the tests exercising builder.effect/applied["~effect"].handler,
withFiberContext, makeEffectORPC, ManagedRuntime, RequestId and the Counter
Service class) into a Bun-compatible test file using Bun.test/Bun.assert style
(or the repo's existing Bun test helpers), remove Vitest-specific
imports/assertions, and ensure the tests still provide RequestId via
Effect.provideService and dispose ManagedRuntime instances; keep the same
assertions and behavior but replace Vitest APIs so the coverage remains runnable
under bun test.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 0a668fc2-da26-4af9-8fab-275bb32911ae
⛔ Files ignored due to path filters (1)
bun.lockis excluded by!**/*.lock
📒 Files selected for processing (23)
.changeset/fluffy-times-shave.md.changeset/pre.json.github/workflows/publish.ymlREADME.mdexamples/README.mdexamples/hono-request-context/README.mdexamples/hono-request-context/index.tsexamples/hono-request-context/package.jsonexamples/hono-request-context/runtime.tsexamples/hono-request-context/services/cache.tsexamples/hono-request-context/services/database.tsexamples/hono-request-context/services/order.tspackages/effect-orpc/CHANGELOG.mdpackages/effect-orpc/package.jsonpackages/effect-orpc/src/effect-builder.tspackages/effect-orpc/src/effect-enhance-router.tspackages/effect-orpc/src/fiber-context-bridge.tspackages/effect-orpc/src/node.tspackages/effect-orpc/src/service-context-bridge.tspackages/effect-orpc/src/tagged-error.tspackages/effect-orpc/src/tests/effect-builder.test.tspackages/effect-orpc/src/tests/tagged-error.test.tspackages/effect-orpc/src/types/index.ts
💤 Files with no reviewable changes (1)
- packages/effect-orpc/src/fiber-context-bridge.ts
✅ Files skipped from review due to trivial changes (2)
- examples/hono-request-context/README.md
- packages/effect-orpc/CHANGELOG.md
🚧 Files skipped from review as they are similar to previous changes (6)
- examples/README.md
- .changeset/pre.json
- packages/effect-orpc/src/tagged-error.ts
- packages/effect-orpc/src/tests/tagged-error.test.ts
- .github/workflows/publish.yml
- examples/hono-request-context/runtime.ts
There was a problem hiding this comment.
Actionable comments posted: 4
♻️ Duplicate comments (2)
packages/effect-orpc/src/effect-builder.ts (2)
101-134:⚠️ Potential issue | 🔴 Critical
cause.reasonsdoes not exist in Effect v4 Cause API.The
toORPCErrorFromCausefunction accessescause.reasons[0], but in Effect v4,Causeis a tree-like structure and does not expose areasonsarray. UseCause.match()for exhaustive pattern matching instead.🐛 Proposed fix using Cause.match
function toORPCErrorFromCause( cause: Cause.Cause<unknown>, ): ORPCError<string, unknown> { - const reason = cause.reasons[0]; - - if (reason === undefined) { - return new ORPCError("INTERNAL_SERVER_ERROR"); - } - - if (Cause.isDieReason(reason)) { - return new ORPCError("INTERNAL_SERVER_ERROR", { - cause: reason.defect, - }); - } - - if (Cause.isFailReason(reason)) { - const error = reason.error; - - if (isORPCTaggedError(error)) { - return error.toORPCError(); - } - if (error instanceof ORPCError) { - return error; - } - - return new ORPCError("INTERNAL_SERVER_ERROR", { - cause: error, - }); - } - - return new ORPCError("INTERNAL_SERVER_ERROR", { - cause: new Error(`${reason.fiberId} Interrupted`), - }); + return Cause.match(cause, { + onEmpty: () => new ORPCError("INTERNAL_SERVER_ERROR"), + onFail: (error) => { + if (isORPCTaggedError(error)) { + return error.toORPCError(); + } + if (error instanceof ORPCError) { + return error; + } + return new ORPCError("INTERNAL_SERVER_ERROR", { cause: error }); + }, + onDie: (defect) => + new ORPCError("INTERNAL_SERVER_ERROR", { cause: defect }), + onInterrupt: (fiberId) => + new ORPCError("INTERNAL_SERVER_ERROR", { + cause: new Error(`${String(fiberId)} Interrupted`), + }), + onSequential: (left, right) => left, + onParallel: (left, right) => left, + }); }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/effect-orpc/src/effect-builder.ts` around lines 101 - 134, The function toORPCErrorFromCause incorrectly accesses cause.reasons; replace that logic with Cause.match to exhaustively handle Cause cases: use Cause.match(cause, { empty: () => new ORPCError("INTERNAL_SERVER_ERROR"), die: (defect) => new ORPCError("INTERNAL_SERVER_ERROR", { cause: defect }), fail: (error) => { if (isORPCTaggedError(error)) return error.toORPCError(); if (error instanceof ORPCError) return error; return new ORPCError("INTERNAL_SERVER_ERROR", { cause: error }); }, interrupt: (fiberId) => new ORPCError("INTERNAL_SERVER_ERROR", { cause: new Error(`${fiberId} Interrupted`) }) }); ensure you reference toORPCErrorFromCause, Cause.match, isORPCTaggedError, and ORPCError when making the change.
663-672:⚠️ Potential issue | 🔴 Critical
Effect.runPromiseExitWithdoes not exist in Effect v4 API and will cause a runtime error.The method
Effect.runPromiseExitWithis not part of the Effect v4 public API. To provide merged services before running the effect, wrap the mergedServiceMapwithLayer.succeedContext()and useEffect.provide():Correct fix using Layer.succeedContext
const parentServices = getCurrentServices(); const exit = parentServices - ? await Effect.runPromiseExitWith( - ServiceMap.merge(await runtime.services(), parentServices), - )(tracedEffect, { - signal: opts.signal, - }) + ? await runtime.runPromiseExit( + Effect.provide( + tracedEffect, + Layer.succeedContext( + ServiceMap.merge(await runtime.services(), parentServices), + ), + ), + { signal: opts.signal }, + ) : await runtime.runPromiseExit(tracedEffect, { signal: opts.signal, });
Layer.succeedContext()converts the mergedServiceMapinto aLayerthat can be provided to the effect.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/effect-orpc/src/effect-builder.ts` around lines 663 - 672, The code incorrectly calls Effect.runPromiseExitWith (which doesn't exist); instead when parentServices is present, convert the merged ServiceMap (ServiceMap.merge(await runtime.services(), parentServices)) into a Layer via Layer.succeedContext() and provide it to the tracedEffect using Effect.provide (or Effect.provideSomeLayer) before running the effect with the runtime; keep the existing fallback that uses runtime.runPromiseExit(tracedEffect, { signal: opts.signal }) when parentServices is falsy, and ensure you still pass opts.signal to the final run call.
🧹 Nitpick comments (2)
examples/hono-request-context/package.json (1)
10-14: OpenTelemetry package versions are correctly aligned from the same coordinated release cycle; consider updating to the latest stable versions.The exporter version
0.211.0and SDK packages at2.5.0were released on the same day (2026-01-21), confirming they are from the same coordinated release cycle as intended. However, newer stable versions are available:0.213.0(exporter) and2.6.0(SDK packages), both released on 2026-03-03. While the current versions are compatible, consider updating to the latest stable releases for the latest features and patches.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@examples/hono-request-context/package.json` around lines 10 - 14, Update the OpenTelemetry dependency versions in package.json so the exporter and SDK packages use the latest coordinated stable releases; change "@opentelemetry/exporter-trace-otlp-http" from "^0.211.0" to "^0.213.0" and update "@opentelemetry/sdk-metrics", "@opentelemetry/sdk-trace-base", "@opentelemetry/sdk-trace-node", and "@opentelemetry/sdk-trace-web" from "^2.5.0" to "^2.6.0" to align with the newer stable release cycle.examples/hono-request-context/services/order.ts (1)
50-51: Inconsistent log annotation key.
getOrderuses"service"as the annotation key (line 50), whilelistOrdersuses"app-service"(line 78). Consider using a consistent annotation key across both methods for uniform log filtering.♻️ Suggested fix for consistency
}).pipe( - Effect.annotateLogs("app-service", "OrderService"), + Effect.annotateLogs("service", "OrderService"), Effect.withSpan("OrderService.listOrders"), ),Also applies to: 78-79
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@examples/hono-request-context/services/order.ts` around lines 50 - 51, The log annotation key is inconsistent between OrderService.getOrder and OrderService.listOrders: update the Effect.annotateLogs call in either getOrder or listOrders so both use the same key (e.g., change "service" to "app-service" or vice versa) to ensure uniform log filtering; locate the annotateLogs usage in the OrderService methods (Effect.annotateLogs("service", "OrderService") and Effect.annotateLogs("app-service", "OrderService")) and make them identical.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@examples/hono-request-context/runtime.ts`:
- Around line 17-23: Replace the invalid Effect v4 calls Logger.layer and
Logger.consolePretty by using the pre-built logger Layer (e.g., Logger.pretty)
when constructing LoggerLive; update the AppLive merge to use that LoggerLive
and keep merging NodeSdkLive and OrderService.layer as before—specifically
change the LoggerLive definition (currently using
Logger.layer([Logger.consolePretty()])) to use Logger.pretty (or attach extra
loggers via Logger.add) so Layer.mergeAll(AppLive, LoggerLive, NodeSdkLive,
OrderService.layer) uses a valid Layer instance.
In `@packages/effect-orpc/CHANGELOG.md`:
- Line 15: The release entry uses an inconsistent version tag "1.0.0-v4.0";
update that tag to match the pattern used by later entries by renaming
"1.0.0-v4.0" to "1.0.0-effect-v4.0" in the CHANGELOG entry so it is consistent
with "1.0.0-effect-v4.1" and "1.0.0-effect-v4.2".
In `@packages/effect-orpc/src/effect-builder.ts`:
- Line 23: Update the import of IntersectPick to use the canonical package:
replace any import of IntersectPick from "@orpc/server" with an import from
"@orpc/shared" (e.g., change the import statement in effect-builder.ts and
types/variants.ts to import type { IntersectPick } from "@orpc/shared") so all
modules consistently source IntersectPick from the shared package.
In `@packages/effect-orpc/src/node.ts`:
- Around line 19-24: withFiberContext currently calls the removed
Effect.services<R>() API; replace this with the v4 service/tag pattern by
introducing (or importing) a Context.Tag/Effect.Service for the "services"
object and retrieving it via the v4 API before running servicesStorage.run.
Concretely: define a Tag (e.g., ServicesTag = Context.Tag<Services>() or export
an Effect.Service for the services type), then change the implementation to
Effect.flatMap(Effect.service(ServicesTag), (services) => Effect.promise(() =>
servicesStorage.run(services, fn))). Ensure the function signature and types
align with the new Tag/Service type and keep the calls to servicesStorage.run
and Effect.promise/Effect.flatMap intact.
---
Duplicate comments:
In `@packages/effect-orpc/src/effect-builder.ts`:
- Around line 101-134: The function toORPCErrorFromCause incorrectly accesses
cause.reasons; replace that logic with Cause.match to exhaustively handle Cause
cases: use Cause.match(cause, { empty: () => new
ORPCError("INTERNAL_SERVER_ERROR"), die: (defect) => new
ORPCError("INTERNAL_SERVER_ERROR", { cause: defect }), fail: (error) => { if
(isORPCTaggedError(error)) return error.toORPCError(); if (error instanceof
ORPCError) return error; return new ORPCError("INTERNAL_SERVER_ERROR", { cause:
error }); }, interrupt: (fiberId) => new ORPCError("INTERNAL_SERVER_ERROR", {
cause: new Error(`${fiberId} Interrupted`) }) }); ensure you reference
toORPCErrorFromCause, Cause.match, isORPCTaggedError, and ORPCError when making
the change.
- Around line 663-672: The code incorrectly calls Effect.runPromiseExitWith
(which doesn't exist); instead when parentServices is present, convert the
merged ServiceMap (ServiceMap.merge(await runtime.services(), parentServices))
into a Layer via Layer.succeedContext() and provide it to the tracedEffect using
Effect.provide (or Effect.provideSomeLayer) before running the effect with the
runtime; keep the existing fallback that uses
runtime.runPromiseExit(tracedEffect, { signal: opts.signal }) when
parentServices is falsy, and ensure you still pass opts.signal to the final run
call.
---
Nitpick comments:
In `@examples/hono-request-context/package.json`:
- Around line 10-14: Update the OpenTelemetry dependency versions in
package.json so the exporter and SDK packages use the latest coordinated stable
releases; change "@opentelemetry/exporter-trace-otlp-http" from "^0.211.0" to
"^0.213.0" and update "@opentelemetry/sdk-metrics",
"@opentelemetry/sdk-trace-base", "@opentelemetry/sdk-trace-node", and
"@opentelemetry/sdk-trace-web" from "^2.5.0" to "^2.6.0" to align with the newer
stable release cycle.
In `@examples/hono-request-context/services/order.ts`:
- Around line 50-51: The log annotation key is inconsistent between
OrderService.getOrder and OrderService.listOrders: update the
Effect.annotateLogs call in either getOrder or listOrders so both use the same
key (e.g., change "service" to "app-service" or vice versa) to ensure uniform
log filtering; locate the annotateLogs usage in the OrderService methods
(Effect.annotateLogs("service", "OrderService") and
Effect.annotateLogs("app-service", "OrderService")) and make them identical.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 7ac82094-af3b-49eb-b6e6-fbdd012617b4
⛔ Files ignored due to path filters (1)
bun.lockis excluded by!**/*.lock
📒 Files selected for processing (24)
.changeset/fluffy-times-shave.md.changeset/pre.json.changeset/silly-doodles-cover.md.github/workflows/publish.ymlREADME.mdexamples/README.mdexamples/hono-request-context/README.mdexamples/hono-request-context/index.tsexamples/hono-request-context/package.jsonexamples/hono-request-context/runtime.tsexamples/hono-request-context/services/cache.tsexamples/hono-request-context/services/database.tsexamples/hono-request-context/services/order.tspackages/effect-orpc/CHANGELOG.mdpackages/effect-orpc/package.jsonpackages/effect-orpc/src/effect-builder.tspackages/effect-orpc/src/effect-enhance-router.tspackages/effect-orpc/src/fiber-context-bridge.tspackages/effect-orpc/src/node.tspackages/effect-orpc/src/service-context-bridge.tspackages/effect-orpc/src/tagged-error.tspackages/effect-orpc/src/tests/effect-builder.test.tspackages/effect-orpc/src/tests/tagged-error.test.tspackages/effect-orpc/src/types/index.ts
💤 Files with no reviewable changes (1)
- packages/effect-orpc/src/fiber-context-bridge.ts
✅ Files skipped from review due to trivial changes (2)
- .changeset/silly-doodles-cover.md
- .changeset/fluffy-times-shave.md
🚧 Files skipped from review as they are similar to previous changes (5)
- packages/effect-orpc/src/tagged-error.ts
- packages/effect-orpc/src/tests/tagged-error.test.ts
- .github/workflows/publish.yml
- packages/effect-orpc/src/service-context-bridge.ts
- .changeset/pre.json
4d8224c to
56a3bbd
Compare
|
@utopyin Do you plan on landing this PR? If not, would you mind if I took a crack at it? Are you looking to maintain backwards compatibility moving forward? |
|
hi @bweis! This PR is already being deployed on a beta tag at 1.0.0-effect-4.* Please feel free to contribute to this branch, I'll do my best to review quickly. |
git-subtree-dir: repos/effect git-subtree-split: cd7ab65
# Conflicts: # README.md # bun.lock # examples/hono/runtime.ts # packages/effect-orpc/CHANGELOG.md # packages/effect-orpc/package.json # packages/effect-orpc/src/effect-builder.ts # packages/effect-orpc/src/effect-procedure.ts # packages/effect-orpc/src/effect-runtime.ts # packages/effect-orpc/src/fiber-context-bridge.ts # packages/effect-orpc/src/node.ts # packages/effect-orpc/src/tests/effect-builder.test.ts # packages/effect-orpc/src/types/index.ts # packages/effect-orpc/src/types/variants.ts # repos/effect/.changeset/config.json # repos/effect/.envrc # repos/effect/.github/workflows/check.yml # repos/effect/.github/workflows/release.yml # repos/effect/.github/workflows/snapshot.yml # repos/effect/.gitignore # repos/effect/.vscode/settings.json # repos/effect/AGENTS.md # repos/effect/README.md # repos/effect/flake.lock # repos/effect/flake.nix # repos/effect/package.json # repos/effect/packages/ai/anthropic/CHANGELOG.md # repos/effect/packages/ai/anthropic/docgen.json # repos/effect/packages/ai/anthropic/package.json # repos/effect/packages/ai/anthropic/src/AnthropicClient.ts # repos/effect/packages/ai/anthropic/src/AnthropicConfig.ts # repos/effect/packages/ai/anthropic/src/AnthropicLanguageModel.ts # repos/effect/packages/ai/anthropic/src/AnthropicTool.ts # repos/effect/packages/ai/anthropic/src/Generated.ts # repos/effect/packages/ai/anthropic/src/index.ts # repos/effect/packages/ai/anthropic/src/internal/utilities.ts # repos/effect/packages/ai/anthropic/tsconfig.json # repos/effect/packages/ai/anthropic/vitest.config.ts # repos/effect/packages/ai/openai/CHANGELOG.md # repos/effect/packages/ai/openai/docgen.json # repos/effect/packages/ai/openai/package.json # repos/effect/packages/ai/openai/src/Generated.ts # repos/effect/packages/ai/openai/src/OpenAiClient.ts # repos/effect/packages/ai/openai/src/OpenAiConfig.ts # repos/effect/packages/ai/openai/src/OpenAiEmbeddingModel.ts # repos/effect/packages/ai/openai/src/OpenAiLanguageModel.ts # repos/effect/packages/ai/openai/src/OpenAiTelemetry.ts # repos/effect/packages/ai/openai/src/OpenAiTool.ts # repos/effect/packages/ai/openai/src/index.ts # repos/effect/packages/ai/openai/src/internal/utilities.ts # repos/effect/packages/ai/openai/tsconfig.json # repos/effect/packages/ai/openai/vitest.config.ts # repos/effect/packages/ai/openrouter/CHANGELOG.md # repos/effect/packages/ai/openrouter/docgen.json # repos/effect/packages/ai/openrouter/package.json # repos/effect/packages/ai/openrouter/src/Generated.ts # repos/effect/packages/ai/openrouter/src/OpenRouterClient.ts # repos/effect/packages/ai/openrouter/src/OpenRouterConfig.ts # repos/effect/packages/ai/openrouter/src/OpenRouterLanguageModel.ts # repos/effect/packages/ai/openrouter/src/index.ts # repos/effect/packages/ai/openrouter/src/internal/utilities.ts # repos/effect/packages/ai/openrouter/tsconfig.json # repos/effect/packages/ai/openrouter/vitest.config.ts # repos/effect/packages/effect/CHANGELOG.md # repos/effect/packages/effect/docgen.json # repos/effect/packages/effect/package.json # repos/effect/packages/effect/src/Array.ts # repos/effect/packages/effect/src/BigDecimal.ts # repos/effect/packages/effect/src/BigInt.ts # repos/effect/packages/effect/src/Boolean.ts # repos/effect/packages/effect/src/Brand.ts # repos/effect/packages/effect/src/Cache.ts # repos/effect/packages/effect/src/Cause.ts # repos/effect/packages/effect/src/Channel.ts # repos/effect/packages/effect/src/Chunk.ts # repos/effect/packages/effect/src/Clock.ts # repos/effect/packages/effect/src/Config.ts # repos/effect/packages/effect/src/ConfigProvider.ts # repos/effect/packages/effect/src/Console.ts # repos/effect/packages/effect/src/Context.ts # repos/effect/packages/effect/src/Cron.ts # repos/effect/packages/effect/src/Data.ts # repos/effect/packages/effect/src/DateTime.ts # repos/effect/packages/effect/src/Deferred.ts # repos/effect/packages/effect/src/Differ.ts # repos/effect/packages/effect/src/Duration.ts # repos/effect/packages/effect/src/Effect.ts # repos/effect/packages/effect/src/Effectable.ts # repos/effect/packages/effect/src/Encoding.ts # repos/effect/packages/effect/src/Equal.ts # repos/effect/packages/effect/src/Equivalence.ts # repos/effect/packages/effect/src/ExecutionPlan.ts # repos/effect/packages/effect/src/Exit.ts # repos/effect/packages/effect/src/Fiber.ts # repos/effect/packages/effect/src/FiberHandle.ts # repos/effect/packages/effect/src/FiberMap.ts # repos/effect/packages/effect/src/FiberSet.ts # repos/effect/packages/effect/src/Function.ts # repos/effect/packages/effect/src/Graph.ts # repos/effect/packages/effect/src/HKT.ts # repos/effect/packages/effect/src/Hash.ts # repos/effect/packages/effect/src/HashMap.ts # repos/effect/packages/effect/src/HashRing.ts # repos/effect/packages/effect/src/HashSet.ts # repos/effect/packages/effect/src/Inspectable.ts # repos/effect/packages/effect/src/Iterable.ts # repos/effect/packages/effect/src/Layer.ts # repos/effect/packages/effect/src/LayerMap.ts # repos/effect/packages/effect/src/LogLevel.ts # repos/effect/packages/effect/src/Logger.ts # repos/effect/packages/effect/src/ManagedRuntime.ts # repos/effect/packages/effect/src/Match.ts # repos/effect/packages/effect/src/Metric.ts # repos/effect/packages/effect/src/MutableHashMap.ts # repos/effect/packages/effect/src/MutableHashSet.ts # repos/effect/packages/effect/src/MutableList.ts # repos/effect/packages/effect/src/MutableRef.ts # repos/effect/packages/effect/src/NonEmptyIterable.ts # repos/effect/packages/effect/src/Number.ts # repos/effect/packages/effect/src/Option.ts # repos/effect/packages/effect/src/Order.ts # repos/effect/packages/effect/src/Ordering.ts # repos/effect/packages/effect/src/PartitionedSemaphore.ts # repos/effect/packages/effect/src/Pipeable.ts # repos/effect/packages/effect/src/Pool.ts # repos/effect/packages/effect/src/Predicate.ts # repos/effect/packages/effect/src/PrimaryKey.ts # repos/effect/packages/effect/src/PubSub.ts # repos/effect/packages/effect/src/Queue.ts # repos/effect/packages/effect/src/Random.ts # repos/effect/packages/effect/src/RcMap.ts # repos/effect/packages/effect/src/RcRef.ts # repos/effect/packages/effect/src/Record.ts # repos/effect/packages/effect/src/Redacted.ts # repos/effect/packages/effect/src/Ref.ts # repos/effect/packages/effect/src/RegExp.ts # repos/effect/packages/effect/src/Request.ts # repos/effect/packages/effect/src/RequestResolver.ts # repos/effect/packages/effect/src/Resource.ts # repos/effect/packages/effect/src/Runtime.ts # repos/effect/packages/effect/src/Schedule.ts # repos/effect/packages/effect/src/Scheduler.ts # repos/effect/packages/effect/src/Schema.ts # repos/effect/packages/effect/src/SchemaAST.ts # repos/effect/packages/effect/src/Scope.ts # repos/effect/packages/effect/src/ScopedCache.ts # repos/effect/packages/effect/src/ScopedRef.ts # repos/effect/packages/effect/src/Sink.ts # repos/effect/packages/effect/src/Stream.ts # repos/effect/packages/effect/src/String.ts # repos/effect/packages/effect/src/Struct.ts # repos/effect/packages/effect/src/SubscriptionRef.ts # repos/effect/packages/effect/src/Symbol.ts # repos/effect/packages/effect/src/SynchronizedRef.ts # repos/effect/packages/effect/src/Take.ts # repos/effect/packages/effect/src/Tracer.ts # repos/effect/packages/effect/src/Trie.ts # repos/effect/packages/effect/src/Tuple.ts # repos/effect/packages/effect/src/Types.ts # repos/effect/packages/effect/src/Unify.ts # repos/effect/packages/effect/src/Utils.ts # repos/effect/packages/effect/src/index.ts # repos/effect/packages/effect/src/internal/array.ts # repos/effect/packages/effect/src/internal/concurrency.ts # repos/effect/packages/effect/src/internal/core.ts # repos/effect/packages/effect/src/internal/dateTime.ts # repos/effect/packages/effect/src/internal/doNotation.ts # repos/effect/packages/effect/src/internal/errors.ts # repos/effect/packages/effect/src/internal/executionPlan.ts # repos/effect/packages/effect/src/internal/hashMap.ts # repos/effect/packages/effect/src/internal/hashSet.ts # repos/effect/packages/effect/src/internal/layer.ts # repos/effect/packages/effect/src/internal/matcher.ts # repos/effect/packages/effect/src/internal/metric.ts # repos/effect/packages/effect/src/internal/option.ts # repos/effect/packages/effect/src/internal/random.ts # repos/effect/packages/effect/src/internal/rcRef.ts # repos/effect/packages/effect/src/internal/redacted.ts # repos/effect/packages/effect/src/internal/request.ts # repos/effect/packages/effect/src/internal/schedule.ts # repos/effect/packages/effect/src/internal/stream.ts # repos/effect/packages/effect/src/internal/tracer.ts # repos/effect/packages/effect/src/internal/trie.ts # repos/effect/packages/effect/src/internal/version.ts # repos/effect/packages/effect/test/Array.test.ts # repos/effect/packages/effect/test/BigDecimal.test.ts # repos/effect/packages/effect/test/BigInt.test.ts # repos/effect/packages/effect/test/Boolean.test.ts # repos/effect/packages/effect/test/Brand.test.ts # repos/effect/packages/effect/test/Cache.test.ts # repos/effect/packages/effect/test/Cause.test.ts # repos/effect/packages/effect/test/Chunk.test.ts # repos/effect/packages/effect/test/Config.test.ts # repos/effect/packages/effect/test/ConfigProvider.test.ts # repos/effect/packages/effect/test/Cron.test.ts # repos/effect/packages/effect/test/Data.test.ts # repos/effect/packages/effect/test/DateTime.test.ts # repos/effect/packages/effect/test/Deferred.test.ts # repos/effect/packages/effect/test/Duration.test.ts # repos/effect/packages/effect/test/Equal.test.ts # repos/effect/packages/effect/test/Equivalence.test.ts # repos/effect/packages/effect/test/ExecutionPlan.test.ts # repos/effect/packages/effect/test/Exit.test.ts # repos/effect/packages/effect/test/Fiber.test.ts # repos/effect/packages/effect/test/FiberHandle.test.ts # repos/effect/packages/effect/test/FiberMap.test.ts # repos/effect/packages/effect/test/FiberSet.test.ts # repos/effect/packages/effect/test/Function.test.ts # repos/effect/packages/effect/test/Graph.test.ts # repos/effect/packages/effect/test/HashMap.test.ts # repos/effect/packages/effect/test/HashSet.test.ts # repos/effect/packages/effect/test/Iterable.test.ts # repos/effect/packages/effect/test/Layer.test.ts # repos/effect/packages/effect/test/LogLevel.test.ts # repos/effect/packages/effect/test/Logger.test.ts # repos/effect/packages/effect/test/ManagedRuntime.test.ts # repos/effect/packages/effect/test/Match.test.ts # repos/effect/packages/effect/test/Metric.test.ts # repos/effect/packages/effect/test/MutableHashMap.test.ts # repos/effect/packages/effect/test/MutableHashSet.test.ts # repos/effect/packages/effect/test/MutableList.test.ts # repos/effect/packages/effect/test/Number.test.ts # repos/effect/packages/effect/test/Option.test.ts # repos/effect/packages/effect/test/Order.test.ts # repos/effect/packages/effect/test/Ordering.test.ts # repos/effect/packages/effect/test/PartitionedSemaphore.test.ts # repos/effect/packages/effect/test/Pool.test.ts # repos/effect/packages/effect/test/Predicate.test.ts # repos/effect/packages/effect/test/PubSub.test.ts # repos/effect/packages/effect/test/Queue.test.ts # repos/effect/packages/effect/test/Random.test.ts # repos/effect/packages/effect/test/RcMap.test.ts # repos/effect/packages/effect/test/RcRef.test.ts # repos/effect/packages/effect/test/Record.test.ts # repos/effect/packages/effect/test/Redacted.test.ts # repos/effect/packages/effect/test/Ref.test.ts # repos/effect/packages/effect/test/Resource.test.ts # repos/effect/packages/effect/test/Schedule.test.ts # repos/effect/packages/effect/test/Scope.test.ts # repos/effect/packages/effect/test/ScopedCache.test.ts # repos/effect/packages/effect/test/ScopedRef.test.ts # repos/effect/packages/effect/test/String.test.ts # repos/effect/packages/effect/test/Struct.test.ts # repos/effect/packages/effect/test/SubscriptionRef.test.ts # repos/effect/packages/effect/test/Symbol.test.ts # repos/effect/packages/effect/test/SynchronizedRef.test.ts # repos/effect/packages/effect/test/TestClock.test.ts # repos/effect/packages/effect/test/Tracer.test.ts # repos/effect/packages/effect/test/Trie.test.ts # repos/effect/packages/effect/test/Tuple.test.ts # repos/effect/packages/effect/test/utils/counter.ts # repos/effect/packages/effect/tsconfig.json # repos/effect/packages/effect/vitest.config.ts # repos/effect/packages/opentelemetry/CHANGELOG.md # repos/effect/packages/opentelemetry/LICENSE # repos/effect/packages/opentelemetry/docgen.json # repos/effect/packages/opentelemetry/package.json # repos/effect/packages/opentelemetry/src/Logger.ts # repos/effect/packages/opentelemetry/src/Metrics.ts # repos/effect/packages/opentelemetry/src/NodeSdk.ts # repos/effect/packages/opentelemetry/src/Resource.ts # repos/effect/packages/opentelemetry/src/Tracer.ts # repos/effect/packages/opentelemetry/src/WebSdk.ts # repos/effect/packages/opentelemetry/src/index.ts # repos/effect/packages/opentelemetry/src/internal/metrics.ts # repos/effect/packages/opentelemetry/test/Logger.test.ts # repos/effect/packages/opentelemetry/test/Metrics.test.ts # repos/effect/packages/opentelemetry/test/Tracer.test.ts # repos/effect/packages/opentelemetry/tsconfig.json # repos/effect/packages/opentelemetry/vitest.config.ts # repos/effect/packages/platform-browser/CHANGELOG.md # repos/effect/packages/platform-browser/README.md # repos/effect/packages/platform-browser/docgen.json # repos/effect/packages/platform-browser/package.json # repos/effect/packages/platform-browser/src/BrowserHttpClient.ts # repos/effect/packages/platform-browser/src/BrowserKeyValueStore.ts # repos/effect/packages/platform-browser/src/BrowserRuntime.ts # repos/effect/packages/platform-browser/src/BrowserSocket.ts # repos/effect/packages/platform-browser/src/BrowserStream.ts # repos/effect/packages/platform-browser/src/BrowserWorker.ts # repos/effect/packages/platform-browser/src/BrowserWorkerRunner.ts # repos/effect/packages/platform-browser/src/Clipboard.ts # repos/effect/packages/platform-browser/src/Geolocation.ts # repos/effect/packages/platform-browser/src/Permissions.ts # repos/effect/packages/platform-browser/src/index.ts # repos/effect/packages/platform-browser/test/BrowserHttpClient.test.ts # repos/effect/packages/platform-browser/test/Permissions.test.ts # repos/effect/packages/platform-browser/test/RpcWorker.test.ts # repos/effect/packages/platform-browser/test/fixtures/rpc-schemas.ts # repos/effect/packages/platform-browser/test/fixtures/rpc-schemas.ts~HEAD # repos/effect/packages/platform-browser/test/fixtures/rpc-worker.ts # repos/effect/packages/platform-browser/tsconfig.json # repos/effect/packages/platform-browser/vitest.config.ts # repos/effect/packages/platform-bun/CHANGELOG.md # repos/effect/packages/platform-bun/docgen.json # repos/effect/packages/platform-bun/package.json # repos/effect/packages/platform-bun/src/BunClusterHttp.ts # repos/effect/packages/platform-bun/src/BunClusterSocket.ts # repos/effect/packages/platform-bun/src/BunFileSystem.ts # repos/effect/packages/platform-bun/src/BunHttpPlatform.ts # repos/effect/packages/platform-bun/src/BunHttpServer.ts # repos/effect/packages/platform-bun/src/BunHttpServerRequest.ts # repos/effect/packages/platform-bun/src/BunMultipart.ts # repos/effect/packages/platform-bun/src/BunPath.ts # repos/effect/packages/platform-bun/src/BunRuntime.ts # repos/effect/packages/platform-bun/src/BunSink.ts # repos/effect/packages/platform-bun/src/BunSocket.ts # repos/effect/packages/platform-bun/src/BunSocketServer.ts # repos/effect/packages/platform-bun/src/BunStream.ts # repos/effect/packages/platform-bun/src/BunTerminal.ts # repos/effect/packages/platform-bun/src/BunWorker.ts # repos/effect/packages/platform-bun/src/BunWorkerRunner.ts # repos/effect/packages/platform-bun/src/index.ts # repos/effect/packages/platform-bun/tsconfig.json # repos/effect/packages/platform-node-shared/CHANGELOG.md # repos/effect/packages/platform-node-shared/README.md # repos/effect/packages/platform-node-shared/docgen.json # repos/effect/packages/platform-node-shared/package.json # repos/effect/packages/platform-node-shared/src/NodeClusterSocket.ts # repos/effect/packages/platform-node-shared/src/NodeFileSystem.ts # repos/effect/packages/platform-node-shared/src/NodePath.ts # repos/effect/packages/platform-node-shared/src/NodeRuntime.ts # repos/effect/packages/platform-node-shared/src/NodeSink.ts # repos/effect/packages/platform-node-shared/src/NodeSocket.ts # repos/effect/packages/platform-node-shared/src/NodeSocketServer.ts # repos/effect/packages/platform-node-shared/src/NodeStream.ts # repos/effect/packages/platform-node-shared/src/NodeTerminal.ts # repos/effect/packages/platform-node-shared/tsconfig.json # repos/effect/packages/platform-node-shared/vitest.config.ts # repos/effect/packages/platform-node/CHANGELOG.md # repos/effect/packages/platform-node/docgen.json # repos/effect/packages/platform-node/package.json # repos/effect/packages/platform-node/src/NodeClusterHttp.ts # repos/effect/packages/platform-node/src/NodeClusterSocket.ts # repos/effect/packages/platform-node/src/NodeFileSystem.ts # repos/effect/packages/platform-node/src/NodeHttpClient.ts # repos/effect/packages/platform-node/src/NodeHttpPlatform.ts # repos/effect/packages/platform-node/src/NodeHttpServer.ts # repos/effect/packages/platform-node/src/NodeHttpServerRequest.ts # repos/effect/packages/platform-node/src/NodeMultipart.ts # repos/effect/packages/platform-node/src/NodePath.ts # repos/effect/packages/platform-node/src/NodeRuntime.ts # repos/effect/packages/platform-node/src/NodeSink.ts # repos/effect/packages/platform-node/src/NodeSocket.ts # repos/effect/packages/platform-node/src/NodeSocketServer.ts # repos/effect/packages/platform-node/src/NodeStream.ts # repos/effect/packages/platform-node/src/NodeTerminal.ts # repos/effect/packages/platform-node/src/NodeWorker.ts # repos/effect/packages/platform-node/src/NodeWorkerRunner.ts # repos/effect/packages/platform-node/src/Undici.ts # repos/effect/packages/platform-node/src/index.ts # repos/effect/packages/platform-node/test/HttpApi.test.ts # repos/effect/packages/platform-node/test/RpcServer.test.ts # repos/effect/packages/platform-node/test/fixtures/rpc-schemas.ts # repos/effect/packages/platform-node/tsconfig.json # repos/effect/packages/platform-node/vitest.config.ts # repos/effect/packages/vitest/CHANGELOG.md # repos/effect/packages/vitest/README.md # repos/effect/packages/vitest/docgen.json # repos/effect/packages/vitest/package.json # repos/effect/packages/vitest/src/index.ts # repos/effect/packages/vitest/src/internal/internal.ts # repos/effect/packages/vitest/src/utils.ts # repos/effect/packages/vitest/test/index.test.ts # repos/effect/packages/vitest/tsconfig.json # repos/effect/packages/vitest/vitest.config.ts # repos/effect/patches/@changesets__assemble-release-plan.patch # repos/effect/pnpm-lock.yaml # repos/effect/pnpm-workspace.yaml # repos/effect/scratchpad/package.json # repos/effect/scratchpad/tsconfig.json # repos/effect/scripts/circular.mjs # repos/effect/scripts/clean.mjs # repos/effect/scripts/codemod.mjs # repos/effect/scripts/docs.mjs # repos/effect/scripts/package-scalar.mjs # repos/effect/scripts/package-swagger.mjs # repos/effect/scripts/version.mjs # repos/effect/scripts/version.template.txt # repos/effect/scripts/worktree-setup.sh # repos/effect/tsconfig.base.json # repos/effect/tsconfig.json # repos/effect/vitest.setup.ts # repos/effect/vitest.shared.ts
# Conflicts: # packages/effect-orpc/src/effect-enhance-router.ts # packages/effect-orpc/src/effect-runtime.ts # packages/effect-orpc/src/types/index.ts
# Conflicts: # examples/hono/runtime.ts
|
Install the package built from this commit: bun add effect-orpc@https://pkg.utopy.sh/effect-orpc/5374841 |
|
possible to bump to .98 or .97? |
3a1128c76 Update readme with archive notice (#2620) 3e4abbcb0 Version Packages (beta) (#2577) 0082f4f74 Fix JSON Schema tuple allOf intersections (#2605) 72ac58588 Add HttpApiError for status 422 (#2613)A b24d248c8 Fix durable race result replay (#2612) 884905232 Ensure `PersistedQueue` decoding failures are processing attempts (#2611) c15e16ad1 fix(PersistedQueue): Fix Redis-backed PersistedQueue script handling (#2500) 87bea7e16 Handle large millis passed to sleep (#2583) 2b7ce2b51 Fix SQL-backed persisted queues to refresh locks for actively acquired elements. (#2609) 5f142a213 Preserve autocomplete for known OpenAI-compatible config (#2608) 5b2a0bcee ensure WithTransaction wraps entire rpc handler (#2607) 6e08428d9 Fix Schema tuple post-rest indexing (#2604) 388dcf953 Fix Schema union candidate dispatch ordering (#2603) 01d00a3ab Prevent prototype pollution in Schema bracket-path decoding (#2602) 3c62b7b6d Compile HttpApi SSE client decoders once (#2600) a0372736a Preserve HttpApi __proto__ identifiers (#2598) 0f9c07841 Reject duplicate OpenAPI operations and operation identifiers, and reject incompatible security schemes that reuse a name (#2595) 5e8c1b82b Reject unknown and duplicate HttpApi handler registrations with descriptive errors (#2594) 214c45808 Apply `transformClient` when building an individual HttpApi endpoint client (#2592) a807cd170 Keep HttpApi composition immutable (#2591) 4ae0c5ffc CLI cleanups (#2590) 8bd458975 fix(schema): reject non-record objects in isJson (#2588) 989603b60 Expose SchemaError module, closes #2586 (#2587) 5946da380 Reuse HttpApi response schemas (#2585) fd8a356f0 Normalize HttpApi payload media types (#2584) ce38dc33b Harden HttpApi documentation HTML rendering (#2582) eec85ddba Fix HttpApi client error decoding (#2581) 19c222cac Fix HttpApi authorization decoding (#2580) c2a5edc3a Improve unstable `HttpApi` type-level performance (#2476) 97fdaa9c1 Fix Atom.kvs async writes (#2578) 0c2ed5ee0 Normalize empty assistant message content to an empty string (#2576) f643dbb26 Pin to NPM 11 to fix provenance bug in cli (#2572) 8e6f66adf Version Packages (beta) (#2571) 97a4138f9 fix(ai-anthropic): preserve the string branch of the open `Model` enum (#2568) 3f0ccc047 Document interdependent HTTP API middleware (#2569) 2711e39af move schema ai-docs d6184fd6c Version Packages (beta) (#2565) 57fe79316 change rpc ids to string | number (#2566) 1503f45cb update dependencies (#2563) 5434f2e88 Version Packages (beta) (#2548) 97f29df45 use Sets to track atom relationships (#2562) 0c2f78f69 Schedule simplification (#2561) 266cb90bb Treat empty config strings as missing (#2560) bdca35449 Fix Memory_20250818 missing requiresHandler flag (#2531) fbefa850f fix activity retry policy (#2559) 912f095a3 Consolidate Schedule limiting APIs (#2554) a6718f9e0 More closely adhere to vixie semantics for cron expressions (#2556) 18a49e178 Fix `Schedule.cron` when the test clock is adjusted to infinity (#2557) fb50f14fc Add Schedule.min api (#2558) bef51540a Add Schedule.max api (#2551) 18e0564bd Remove some Schedule APIs (#2553) a482442ab feat: add `Schema.DateFromMillis` (#2542) 0b4a32f42 Allow cron fields like `5/15` to expand from the starting value through the field maximum. (#2547) 82951e58d Version Packages (beta) (#2525) ff30b6e7c Cache clients by entity reference (#2546) a0a3490bb Isolate cluster entity handler context from the fiber that first wakes it (#2545) 51f6d197b Replace better-sqlite3 with node:sqlite in sql-sqlite-node (#2487) aa80c4775 add LayerRef module (#2541) c2ae4fce2 Schema: add `Schema.Decoder` and `Schema.Encoder`, and accept simpler schema types in APIs that only decode, only encode, or only need the basic schema shape, closes #2536 (#2539) 1caab3cc3 feat(effect): Add glob to file system (#2523) 95a0e9bb6 fork memo map on nested builds (#2538) 6d2c614fa optimize bun stream reading (#2537) 4b6856f91 Improve schema passthrough strict: false mode example (#2532) f11ce73af Fix HttpApi runtime shape (#2524) 455ecc9ac Add Predicate ai-docs introduction (#2522) 117ee96ba Add Schema introduction to AI docs (#2521) 13df1ebb1 rearrange schedule ai docs c74babd0a Version Packages (beta) (#2506) 2bc541501 Fix StructuralProto equality (#2519) ba7e77e04 Move UrlParams.makeUrl to Url.make (#2518) 5713ee7ed accept UrlParams.Input in some UrlParams apis (#2505) ceaffb8e5 render nested error causes in Tracer exception events (#2511) 00652fe95 Preserve content schema identifiers when emitting JSON Schema for `Schema.fromJsonString`, closes #2495 (#2512) e11cccc7d ensure handler errors don't cause httpapi security middleware to fallback (#2507) 6c5816746 fix(httpapi): return 400 for malformed JSON request body (#2492) a445fe526 Version Packages (beta) (#2502) affdc1390 Fix excess property handling in schema-backed class constructors, closes #2499 (#2501) 04cda0309 Version Packages (beta) (#2486) b135b2517 Fix `Schedule.andThenResult` to emit `self` outputs as `Failure` and `other` outputs as `Success`, closes #2497 (#2498) aaa21a369 Fix string case conversion for numeric word segments (#2488) 3475ee6c2 fix RequestResolver interruption (#2485) 011ce634f Version Packages (beta) (#2484) d237fdf72 Fix `Config.schema` so missing array values are treated as missing data (#2483) 13581e983 Version Packages (beta) (#2481) 7777e1540 Add custom errors to Effect.fromOption (#2479) 5376197ca render causes in OtlpTracer exception events (#2480) b7d46ab7e Align Schema.Void with typescript behaviour (#2475) 46b3836f2 Version Packages (beta) (#2473) fe1b2d53b Fix sqlite-do Durable Object transactions (#2217) 641295595 Additional connection options for MssqlClientConfig (#2397) 6cbbdf3a0 Fail with typed SqlError when sqlite-bun statement preparation throws (#2399) 7b8a54939 fix(ai-anthropic): emit null (not undefined) for caller toolId in non-streaming responses (#2450) 911f1b847 Rate limit adaptive (#2472) 8beeeea52 Scope unknown request tag failures to the request instead of the connection (#2457) c306fcfeb Add isOpen method to Latch to query latch position (#2428) a2e306a0d Version Packages (beta) (#2467) 12fcf35b9 Emit Schema.ConstraintDecoder in generated SSE clients (#2469) 5a0c1a4fa Expose source schema on schema wrappers (#2468) 1eea2ea37 Use URL.canParse for URL schema decoding (#2466) a2f0f1735 Refactor schedule cookbook (#2465) 595bb5e42 Version Packages (beta) (#2447) 7dbec240d Strip response metadata from HTTP server span failures (#2454) 46b3e7994 do not use performance.timeOrigin and calculate origins lazily (#2464) 28b419639 Match NodeHttpServer layerConfig services (#2463) 0b5795a0a Add SQL valuesUnprepared (#2462) 108a9335f Fail RpcClient HTTP requests with a defect when the response closes early (#2461) 4a005d019 Preserve external span sampling in OpenTelemetry (#2451) 3e3a859ec Fix `Cron.next` skipping days when overflowing (#2455) 8800449a2 Add unused internal export lint rule (#2460) d9171b6cd Clarify Redacted schema migration, closes #2456 (#2458) 489dfd430 Fix bundle resolver for package export subpaths (#2453) 6d0fda0d0 Remove the `keepDeclarations` option from `Schema.toCodecStringTree` (#2452) d8c00a171 Fix Schema handling of encoded-side checks for container ASTs (#2449) 7e1f455fa Improve Schema type-level performance (#2442) 85b631701 Expose CLI environment to schemas (#2446) a2fd7ef80 Version Packages (beta) (#2426) c1dfd6066 fix: support frozen intrinsics when adjusting Error.stackTraceLimit (#2444) 074e43610 Allow schema class `.extend` to accept a `Struct` and preserve checks from the extension schema, closes #2419 (#2439) 328d97cc5 change default operation in redis from LPUSH TO RPUSH (#2436) 7ce7344c4 Use semantic matching for TemplateLiteral parsing and index signature keys (#2434) 8441836e6 Derive template literal arbitraries from encoded parts, closes #2414 (#2431) 2ba316bd1 Port Random.choice from effect v3 (#2425) d11b2b5f2 Version Packages (beta) (#2408) 57d387f92 Fix workflow defect serialization (#2424) 0f8ac7959 RpcGroup.toHandlers is definition first (#2423) 717d1c8b1 feat: openrouter audio input parts (#2379) 87f52ba16 Port Effect.transposeOption from v3 (#2420) 9cf3a25c6 Fix `Effect.try` thunk usage and `Effect.tryPromise` mapper and signal handling defects, closes #2406 (#2415) bacca4141 fix: align ProcessInput.Input runtime field name with type definition (#2403) 8def7674b deduplicate SqlResolver.findById requests (#2417) 95545bdc3 Update generated AI documentation (#2412) b8ee07ffd Import unconstrained JSON Schema as Json (#2374) 7d59d34f4 Add DateTime ai docs (#2411) 25b448270 Fix config path composition and directory-backed lookup behavior, closes #2378 (#2383) b93bc6c9c Fix Stream.runForEachWhile chunk continuation (#2409) 867c0d70a Normalize error behavior for Schema and SchemaParser boundary APIs, closes #2405 (#2407) ded0f5971 Normalize using-prefixed JSDoc example titles (#2402) 74c0e4d62 Normalize JSDoc example titles (#2401) fee939df5 Ensure jsdocs signatures are parseable (#2400) d7eb77366 Add jsdocs function signature extraction (#2396) git-subtree-dir: repos/effect git-subtree-split: 3a1128c7684e04d34d9f541f77adaac38a513056
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
@Cyberistic you should be good to go, |
|
@Cyberistic curious why you needed the package to target this version though? Since all breaking changes introduced by the latest versions did not affect this library, targeting >=4.0.0-beta.83 in |
This reverts commit 962f3ed.
tysm |
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Chores
Tests