Never miss a release that matters
AI-powered summaries of every GitHub release.
AI Summaries
Changelogs condensed into clear, actionable insights.
Always Free
Track up to 5 packages at no cost, forever.
Weekly Digest
A curated summary of every release, delivered weekly.
TL;DR
Yup has reached version 1.0, signifying a stable release after years of development and providing a more reliable validation (data correctness) experience.
Breaking
- Removed
mixed()type. (Use.type('mixed')instead.) - Removed
nullable()anddefined()methods. (Use.nullable()and.required()respectively.)
New
- Added support for specifying a custom message for each segment of a composite key. (Improves error clarity)
- Implemented
test()schema method for custom validation logic. (Allows flexible validation rules)
Fixes Worth Knowing
- Fixed an issue where
refschemas weren’t correctly resolving in certain nested scenarios. (Improves complex form validation)
Before You Upgrade
- Update any code using
mixed(),nullable(), ordefined()to use the new equivalents as described in the Breaking Changes section.
TL;DR
Yup’s schema casting is changing in v1, and a migration path is now available to handle previously accepted patterns like nullable required fields.
Breaking
- Optionality Assertion: Yup v1 strictly enforces optionality during
cast, disallowing patterns likestring().nullable().required(). Use the newassert: 'ignore-optionality'option incastfor incremental upgrades. partialandlazyschemas: The order of operations forpartialandlazyschemas has been adjusted for consistency, potentially impacting conditional schema behavior.
New
- Lazy Schema Improvements: Types and fixes have been implemented for
lazyschemas (dynamic schemas) anddeepPartial(partially defined objects).
Fixes Worth Knowing
- Fixed a bug where
partialschemas weren’t correctly handling optionality withlazyschemas. - Corrected typos in documentation and code comments.
Before You Upgrade
- Review your schemas for
string().nullable().required()patterns and utilize theassert: 'ignore-optionality'option incastduring migration.
TL;DR
Yup now strictly enforces type casting, throwing errors instead of silently coercing invalid values to defaults, improving data validation reliability.
Breaking
- Type casting now throws errors for invalid types (data validation).
castoptionassert: falseis required to retain previous silent coercion behavior.
Before You Upgrade
If you rely on Yup’s previous silent type coercion, explicitly set assert: false in your cast options to maintain existing behavior.