You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Introduced client type-inference utilities for inputs, body inputs,
outputs, body outputs, error maps, and aggregated error unions for oRPC
clients. No runtime changes.
* **Documentation**
* Added a "Utilities" section to client docs with descriptions and code
examples for the new inference helpers.
* **Tests**
* Added type-level tests validating the new inference utilities.
* **Chores**
* Expanded public type surface without breaking existing APIs.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -211,7 +211,7 @@ This is a quick overview of how to use oRPC. For more details, please refer to t
211
211
oRPC is inspired by existing solutions that prioritize type safety and developer experience. Special acknowledgments to:
212
212
213
213
-[tRPC](https://trpc.io): For pioneering the concept of end-to-end type-safe RPC and influencing the development of type-safe APIs.
214
-
-[ts-rest](https://ts-rest.com): For its emphasis on contract-first development and OpenAPI integration, which have greatly inspired oRPCβs feature set.
214
+
-[ts-rest](https://ts-rest.com): For its emphasis on contract-first development and OpenAPI integration, which have greatly inspired oRPC's feature set.
Copy file name to clipboardExpand all lines: apps/content/docs/adapters/browser.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -87,7 +87,7 @@ clientPort.start()
87
87
88
88
## Advanced Relay Pattern
89
89
90
-
In some advanced cases, direct communication between scripts isnβt possible. For example, a content script running in the ["MAIN" world](https://developer.chrome.com/docs/extensions/reference/manifest/content-scripts#world-timings) cannot directly communicate with the background script using `browser.runtime` or `chrome.runtime` APIs.
90
+
In some advanced cases, direct communication between scripts isn't possible. For example, a content script running in the ["MAIN" world](https://developer.chrome.com/docs/extensions/reference/manifest/content-scripts#world-timings) cannot directly communicate with the background script using `browser.runtime` or `chrome.runtime` APIs.
91
91
92
92
To work around this, you can use a **relay pattern** typically an additional content script running in the default **"ISOLATED" (default) world** to relay messages between the two contexts. This **relay pattern** acts as an intermediary, enabling communication where direct access is restricted.
Recursively infers the **body input types** from a client. If an endpoint's input includes `{ body: ... }`, only the `body` portion is extracted. Produces a nested map of body input types.
Recursively infers the **body output types** from a client. If an endpoint's output includes `{ body: ... }`, only the `body` portion is extracted. Produces a nested map of body output types.
Recursively infers the **error types** from a client when using [type-safe error handling](/docs/error-handling#typeβsafe-error-handling). Produces a nested map where each endpoint's error type is preserved.
Recursively infers a **union of all error types** from a client when using [type-safe error handling](/docs/error-handling#typeβsafe-error-handling). Useful when you want to handle all possible errors from any endpoint at once.
Copy file name to clipboardExpand all lines: apps/content/docs/context.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ description: Understanding context in oRPC
5
5
6
6
# Context in oRPC
7
7
8
-
oRPCβs context mechanism provides a type-safe dependency injection pattern. It lets you supply required dependencies either explicitly or dynamically through middleware. There are two types:
8
+
oRPC's context mechanism provides a type-safe dependency injection pattern. It lets you supply required dependencies either explicitly or dynamically through middleware. There are two types:
9
9
10
10
-**Initial Context:** Provided explicitly when invoking a procedure.
11
11
-**Execution Context:** Generated during procedure execution, typically by middleware.
Copy file name to clipboardExpand all lines: apps/content/docs/error-handling.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,7 +48,7 @@ Do not pass sensitive data in the `ORPCError.data` field.
48
48
49
49
## TypeβSafe Error Handling
50
50
51
-
For a fully typeβsafe error management experience, define your error types using the `.errors` method. This lets the client infer the errorβs structure and handle it accordingly. You can use any [Standard Schema](https://github.com/standard-schema/standard-schema?tab=readme-ov-file#what-schema-libraries-implement-the-spec) library to validate error data.
51
+
For a fully typeβsafe error management experience, define your error types using the `.errors` method. This lets the client infer the error's structure and handle it accordingly. You can use any [Standard Schema](https://github.com/standard-schema/standard-schema?tab=readme-ov-file#what-schema-libraries-implement-the-spec) library to validate error data.
[Pinia Colada](https://pinia-colada.esm.dev/) is the data fetching layer for Pinia and Vue. oRPCβs integration with Pinia Colada is lightweight and straightforward - thereβs no extra overhead.
8
+
[Pinia Colada](https://pinia-colada.esm.dev/) is the data fetching layer for Pinia and Vue. oRPC's integration with Pinia Colada is lightweight and straightforward - there's no extra overhead.
9
9
10
10
::: warning
11
11
This documentation assumes you are already familiar with [Pinia Colada](https://pinia-colada.esm.dev/). If you need a refresher, please review the official Pinia Colada documentation before proceeding.
[Tanstack Query](https://tanstack.com/query/latest) is a robust solution for asynchronous state management. oRPCβs integration with Tanstack Query is lightweight and straightforward - thereβs no extra overhead.
8
+
[Tanstack Query](https://tanstack.com/query/latest) is a robust solution for asynchronous state management. oRPC's integration with Tanstack Query is lightweight and straightforward - there's no extra overhead.
0 commit comments