-
-
Notifications
You must be signed in to change notification settings - Fork 35
Improving v25 migration #2843
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improving v25 migration #2843
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
RobinTail
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
### Dedication  **Sara Millerey González** was a 32 years young trans woman from Bello, Antioquia, Colombia. She was killed in April 2025. Millerey was raped, tortured, and thrown into a ravine by a group of men. Denounced as a hate crime by press and Antioquia's mayor, the Colombian National Working Group on Violence Based on Victims' Sexual Orientation or Gender Identity is collaborating with the Attorney's General's Office on identifying remaining suspects. Transgender women suffer too frequently from transphobic violence and cruelty, being the less protected social group. I'd like to raise an awareness of this problem. Humans should be creators — not killers. But most importantly, I want every transgender girl to have an opportunity to create applications quickly and, in general, learn to write code easily in order to receive job offers and leave dangerously transphobic territories for more favorable and civilized ones, and live happily there. Protect transgender women. ### Breaking - `zod` version is `^4.0.0`; - Compatibility with `zod@^3` is dropped; - You SHOULD now `import { z } from "zod"` without the `/v4` suffix; - Node.js version is `^20.19.0 || ^22.12.0 || ^24.0.0`; - The framework distribution is now ESM-only (finally); - All the Node.js versions listed above support `require(ESM)` syntax; - Changes to the `Middleware` class: - When the `input` schema is not defined, the `input` argument of the `handler` method is now `unknown`; - Plugin changes to metadata: - `example` removed; - object-based `examples` removed (only array remains); - use either `.example()` or `.meta({})` with `examples` being an array. - Public `getExamples()` helper removed: - use `.meta()?.examples` or `globalRegistry.get()?.examples` instead. ### Content - #2622 - #2711 - #2740 - #2742 - #2777 - #2809 - #2814 - #2815 - #2842 - #2843 - #2844 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Summary by CodeRabbit * **New Features** * Dropped support for Zod v3; now requires Zod v4 and updates all imports to use `"zod"` directly. * Framework is now distributed as ESM-only and supports Node.js ^20.19.0, ^22.12.0, or ^24.0.0. * Introduced a unified empty schema utility for input/output defaults. * Added Vitest configuration with experimental eventsource flag for testing. * **Breaking Changes** * Removed the public `getExamples()` helper; access examples via `.meta()?.examples` or the global registry. * Middleware and factory input schemas now default to `undefined` when omitted, not an empty object schema. * Dropped support for object-based `examples` in schema metadata; use `.example()` or array-based `examples` instead. * Removed deprecated enum and literal depicters from documentation helpers. * Updated import paths from `"zod/v4"` to `"zod"` throughout codebase and examples. * Adjusted migration rules to reflect import and metadata changes only. * **Bug Fixes** * Improved handling of empty schemas and type inference for middleware and endpoint factories. * **Chores** * Updated documentation and changelogs for new Zod import paths and version requirements. * Updated build, test, and lint configurations for ESM-only output and new dependency versions. * Adjusted GitHub workflows to monitor new branches and updated Node.js versions. * Removed legacy migration rules and simplified migration logic focusing on import and metadata changes. * Removed legacy dependencies like `undici` and adjusted package metadata. * Simplified ESLint and tsup configurations for ESM-only builds. * Updated startup logo dedication message. * **Tests** * Refactored and updated tests to align with new schema defaults and Zod v4 usage. * Simplified migration tests and rules to focus on import path changes. * Added tests for new empty schema utilities. * **Style** * Updated dedication message in the startup logo. * **Revert** * Removed legacy and deprecated migration logic and configuration overrides. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Due to #2842