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
- **Documentation**
- Enhanced clarity in documentation with visually distinct informational
blocks and direct links for additional details.
- **Refactor**
- Improved middleware and procedure API type constraints for increased
consistency and robustness.
- **Tests**
- Expanded test coverage to validate context handling and error
expectations, reinforcing overall system reliability.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Copy file name to clipboardExpand all lines: apps/content/docs/procedure.md
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,9 @@ const example = os
31
31
.actionable() // Server Action compatibility
32
32
```
33
33
34
-
> The `.handler` method is the only required step. All other chains are optional.
34
+
:::info
35
+
The `.handler` method is the only required step. All other chains are optional.
36
+
:::
35
37
36
38
## Input/Output Validation
37
39
@@ -56,7 +58,7 @@ const example = os
56
58
57
59
## Using Middleware
58
60
59
-
The `.use` method allows you to pass middleware, which must call `next` to continue execution.
61
+
The `.use` method allows you to pass [middleware](/docs/middleware), which must call `next` to continue execution.
60
62
61
63
```ts
62
64
const aMiddleware =os.middleware(async ({ context, next }) =>next())
@@ -67,7 +69,9 @@ const example = os
67
69
.handler(async ({ context }) => { /* logic */ })
68
70
```
69
71
70
-
To learn more, see the [Middleware](/docs/middleware) documentation.
72
+
::: info
73
+
[Middleware](/docs/middleware) can be applied if the [current context](/docs/context#combining-initial-and-execution-context) meets the [middleware dependent context](/docs/middleware#dependent-context) requirements and does not conflict with the [current context](/docs/context#combining-initial-and-execution-context).
middleware<UOutContextextendsContext,TInput,TOutput=any>(// = any here is important to make middleware can be used in any output by default
122
+
middleware<UOutContextextendsIntersectPick<TCurrentContext,UOutContext>,TInput,TOutput=any>(// = any here is important to make middleware can be used in any output by default
0 commit comments