Conversation
WalkthroughRename runtime/middleware parameter from Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant ExpressMiddleware as Middleware
participant Endpoint
participant ResultHandler
rect rgba(200,230,200,0.06)
Note over Client,ResultHandler: v26 flow — aggregated `ctx` flows through middlewares → endpoint → result handler
end
Client->>ExpressMiddleware: request (provider runs)
ExpressMiddleware-->>ExpressMiddleware: handler returns partial ctx
ExpressMiddleware->>Endpoint: invoke handler({ input, ctx, logger })
Endpoint-->>Endpoint: merge/augment ctx, run business logic
Endpoint->>ResultHandler: handle result with ctx
ResultHandler->>Client: send response
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Areas requiring extra attention:
Possibly related PRs
Suggested labels
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
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 |
It can now be replaced with `${method} /` syntax
## todo
- [x] rename tests
- [x] fate of `Routable`
- [x] migration
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- Breaking Changes
- Removed DependsOnMethod from the public API.
- Routing now uses flat, path-scoped objects with explicit "METHOD /"
keys (e.g., "get /").
- Deprecation is applied per Endpoint; Endpoint now provides nest().
- New Features
- Added an automatic migration rule to convert DependsOnMethod usages to
the new routing syntax.
- Documentation
- README and CHANGELOG updated with new routing examples and deprecation
guidance.
- Examples
- Updated example routing to the new flat object mapping.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
I realized that context is more clear naming for that entity, which is also the same in hono and trpc. It should also reduce the potential confusion with "config options" and `OPTIONS` request method. However, it might not be possible to rename in without breaking changes, since it's present in public interfaces. ## todo - [x] diagram - [x] migration - [x] changelog <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - Breaking Changes - Standardized context naming: replace options with ctx across handlers, middleware, and factory APIs. Renamed addOptions to addContext. This affects handler signatures and how context is accessed. - Documentation - Updated README and examples to reflect ctx-based usage and patterns. - Tooling/Migration - Added automated migration rules to rename options→ctx and addOptions→addContext. - Tests - Updated test suites to align with ctx terminology and behavior. - Chores - CHANGELOG updated to document the API rename and guidance. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
It unblocks further fixes to subdependencies. <img width="357" height="102" alt="Screenshot 2025-11-25 at 19 12 22" src="https://github.com/user-attachments/assets/40db7967-35d7-4fef-98f4-35b8fa6aa69d" />
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
SECURITY.md (1)
7-7: Update release date once v26 is officially released.Line 7 lists the release date as "12.2025" (December 2025), which is in the future. This appears to be a placeholder target date. Once the actual release is published, update this field to reflect the final release date.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (2)
SECURITY.md(1 hunks)pnpm-workspace.yaml(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- pnpm-workspace.yaml
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: RobinTail
Repo: RobinTail/express-zod-api PR: 0
File: :0-0
Timestamp: 2025-10-02T17:42:48.840Z
Learning: In express-zod-api v25 (ESM-only), the `.example()` method error occurs when user code runs as CommonJS. Express Zod API patches Zod's ESM bundle with `.example()`, but CommonJS code requires a separate CJS bundle instance that lacks this patch. Users must run their code as ESM by: (1) setting `"type": "module"` in package.json, (2) using `.mts` or `.mjs` file extensions, or (3) using tools like `tsx` or `vite-node` that provide their own ESM-compatible compilation.
Learnt from: RobinTail
Repo: RobinTail/express-zod-api PR: 2904
File: express-zod-api/src/routing.ts:74-79
Timestamp: 2025-08-25T17:43:34.491Z
Learning: In express-zod-api, OPTIONS (CORS preflight) requests intentionally go through the same middleware and parser chain as other HTTP methods. This was specifically implemented to fix Issue #514 where middlewares were not running for OPTIONS requests. The framework seeds "options" with the same [parsers, endpoint] pair as other methods to ensure consistent middleware execution for CORS preflight requests.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
- GitHub Check: Analyze (javascript)
- GitHub Check: build (22.x)
- GitHub Check: build (20.19.0)
- GitHub Check: build (20.x)
- GitHub Check: build (24.0.0)
- GitHub Check: build (24.x)
- GitHub Check: build (22.12.0)
- GitHub Check: build (24.x)
- GitHub Check: build (22.12.0)
- GitHub Check: build (20.x)
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
CHANGELOG.md (2)
15-20: Clarify default behavior ofmethodLikeRouteBehavior: "method".Line 19 states the key is treated as "an HTTP method of its parent path" when using the
"method"option (default). The explanation could be more explicit about the precedence and what happens if a key is both a valid HTTP method name and could be a path segment. Consider adding:
- Example of how
get:is interpreted as GET method vs. nested path- Clarification that
.nest()can still be used alongside inline methods for additional nestingThis matches the learnings about simplified routing but the explanation at lines 18-20 is fairly condensed.
27-27: Add example forIntegration::constructor()config requirement.Line 27 states "The
Integration::constructor()argument object now requiresconfigproperty, similar toDocumentation;" but provides no code example showing the change pattern. Previous v22 and v25 changelogs include before/after examples (see lines 932-945 for v22 example).Add a brief migration example showing:
- new Integration({ routing, /* ... */ }) + new Integration({ routing, config, /* ... */ })
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (1)
CHANGELOG.md(1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: RobinTail
Repo: RobinTail/express-zod-api PR: 0
File: :0-0
Timestamp: 2025-10-02T17:42:48.840Z
Learning: In express-zod-api v25 (ESM-only), the `.example()` method error occurs when user code runs as CommonJS. Express Zod API patches Zod's ESM bundle with `.example()`, but CommonJS code requires a separate CJS bundle instance that lacks this patch. Users must run their code as ESM by: (1) setting `"type": "module"` in package.json, (2) using `.mts` or `.mjs` file extensions, or (3) using tools like `tsx` or `vite-node` that provide their own ESM-compatible compilation.
Learnt from: RobinTail
Repo: RobinTail/express-zod-api PR: 2904
File: express-zod-api/src/routing.ts:74-79
Timestamp: 2025-08-25T17:43:34.491Z
Learning: In express-zod-api, OPTIONS (CORS preflight) requests intentionally go through the same middleware and parser chain as other HTTP methods. This was specifically implemented to fix Issue #514 where middlewares were not running for OPTIONS requests. The framework seeds "options" with the same [parsers, endpoint] pair as other methods to ensure consistent middleware execution for CORS preflight requests.
Learnt from: RobinTail
Repo: RobinTail/express-zod-api PR: 2546
File: express-zod-api/src/documentation-helpers.ts:508-512
Timestamp: 2025-05-28T07:58:09.853Z
Learning: In express-zod-api, when working with Zod's JSON schema override callbacks, using `delete` to mutate `ctx.jsonSchema` is the recommended approach per Zod's official documentation, even if it triggers performance linting warnings. This is preferable to creating copies with `undefined` values, especially for snapshot testing.
Learnt from: RobinTail
Repo: RobinTail/express-zod-api PR: 2736
File: express-zod-api/tsup.config.ts:12-26
Timestamp: 2025-06-14T16:42:52.972Z
Learning: In express-zod-api tsup configurations, the direct mutation of `options.supported` in the `esbuildOptions` callback is intentional behavior and should not be flagged as a side effect issue.
📚 Learning: 2025-05-27T19:27:13.492Z
Learnt from: RobinTail
Repo: RobinTail/express-zod-api PR: 2546
File: express-zod-api/tests/form-schema.spec.ts:31-31
Timestamp: 2025-05-27T19:27:13.492Z
Learning: Zod version 3.25.0 and later expose the Zod v4 API through the special import paths "zod/v4" and "zod/v4/core", allowing v4 features like .loose() to be used even when the package.json dependency shows a 3.x version.
Applied to files:
CHANGELOG.md
📚 Learning: 2025-08-05T14:43:24.702Z
Learnt from: RobinTail
Repo: RobinTail/express-zod-api PR: 2869
File: zod-plugin/package.json:42-44
Timestamp: 2025-08-05T14:43:24.702Z
Learning: Zod version 4 has been officially released and is stable. As of August 2025, the latest published version is 4.0.14 (published July 30, 2025). Zod v4 is available on npm and can be used in peer dependencies with version constraints like "^4.0.0".
Applied to files:
CHANGELOG.md
📚 Learning: 2025-10-02T17:42:48.840Z
Learnt from: RobinTail
Repo: RobinTail/express-zod-api PR: 0
File: :0-0
Timestamp: 2025-10-02T17:42:48.840Z
Learning: In express-zod-api v25 (ESM-only), the `.example()` method error occurs when user code runs as CommonJS. Express Zod API patches Zod's ESM bundle with `.example()`, but CommonJS code requires a separate CJS bundle instance that lacks this patch. Users must run their code as ESM by: (1) setting `"type": "module"` in package.json, (2) using `.mts` or `.mjs` file extensions, or (3) using tools like `tsx` or `vite-node` that provide their own ESM-compatible compilation.
Applied to files:
CHANGELOG.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: report
- GitHub Check: report
🔇 Additional comments (3)
CHANGELOG.md (3)
21-27: Provide complete migration scope foroptions→ctxrename.The list on lines 22-25 identifies four handler/method locations where
optionsbecomesctx:
Middleware::handler()ResultHandler::handler()EndpointsFactory::build()handler argumenttestMiddleware()Confirm this list is exhaustive. Consider whether this impacts:
EventStreamFactory::build()handler (mentioned in v21.5.0 at line 1070)- Any test utilities or helper functions with options parameters
The brevity is acceptable for a changelog, but ensure no locations are missed.
29-39: Patch example line 35 appears incomplete.The before/after patch example shows:
- Removal of
DependsOnMethodwrapper- Replacement of
.nest()with a nested object assignment- Line 35 in "after" shows
create: makeUserEndpointat same nesting level asgetVerify this is the intended final syntax. If
makeUserEndpointshould be nested deeper or accessed differently (e.g., via nested path keys), clarify in the example. The indentation in the patch suggests they are siblings under/v1/users, which should be explicit if that is the case.
7-14: No action required. Zod version 4.1.13 has been released (November 24, 2025) and is properly referenced. PR #5452 in the Zod repository correctly addresses the dual package hazard forglobalRegistryin CJS/ESM bundles, matching the changelog's description. The version constraint and fix reference are accurate.
Lia Smith was a 21 years young transgender woman.
She attended Middlebury College in Middlebury, Vermont, majoring in computer science and statistics. She was a member of the college's chess club, bridge club, LGBTQ+ club, and Japanese club. She was a diver on the Middlebury Panthers women's swimming and diving team.
In February 2025 Middlebury College had removed Lia Smith diving profile from their website, following President Donald Trump's executive order, which attempts to ban transgender women and girls from competing in women's sports.
On October 18, 2025 Lia Smith committed suicide.
The tragedy of Lia Smith highlights that the push for exclusion of transgender women from public women's spaces and sports is not an issue of theoretical fairness, but one with devastating consequences for the dignity, safety, and lives of trans individuals. Smith, who was an openly transgender student athlete, described the immense difficulty and feeling of being unwelcome in locker rooms, emphasizing the lack of a clear, safe space for her. Her plea that transgender people are "not trying to get into women's spaces to be perverts... we're just being ourselves" underscores that inclusion is a matter of allowing trans women to exist and access necessary public facilities with basic dignity, rather than an invasion of privacy or a threat. Denying access to these spaces does not eliminate their need for them, but instead subjects them to alienation and heightened psychological distress.
Furthermore, Lia's experience as a diver, where she was reportedly targeted by anti-trans websites and ultimately left her team citing difficulties, demonstrates the severe emotional and social toll of exclusion in sports. Critics of anti-trans policies explicitly linked her death by suicide to the hostile climate and constant public scrutiny and harassment directed at trans athletes. Allowing trans women to participate in women's sports and access women's facilities is therefore a vital component of protecting the mental health and physical safety of transgender people. When a society creates systems that reject a person’s identity and deny them opportunities for community, activity, and belonging—all essential parts of a functioning life—it creates an environment of intense hostility and vulnerability. Inclusion, in contrast, affirms the full humanity of trans women and is a necessary measure against the systemic discrimination that contributed to her anguish.
DependsOnMethod#2938optionstoctx#2934zodversion requirements #3086http-errors@^2.0.1#3094reqandres#3102Summary by CodeRabbit
New Features
Bug Fixes
Breaking Changes
Docs
Tests
✏️ Tip: You can customize this high-level summary in your review settings.