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 release breaks a few minor things and more importantly introduces extensibility to allow you to write your own rules (synchronous for now).
Upgrade time: low to none
Complexity: low
Risk: low
Breaking changes
Local options
label, raw and error in options are not supported anymore, you will have to use the already existing methods to change those behaviors.
This is the side effect of a performance improvement aiming at keeping options concerning a single schema local to it, options are meant to be inherited in the whole hierarchy of schemas, I consider those features don't have any meaningful use being inherited.
The upside of this change is that you will have much better performance when using labels.
0 and 1 (as numbers or as strings) are now also accepted as inputs for booleans when convert is true.
Date
Using date().format() used to throw errors with code date.base, now it's date.format.
Internals
Joi now uses one more ES6 feature, that is classes. This should not impact any of you using node, but might for those of you that transpile Joi to run it into browsers.
New features
Joi.extend()
This is the new API to extend Joi, or rather make new custom versions of Joi. This would be pretty pointless to copy the documentation so I'll let you read it in place.
Contributors
The contributors to this release are @tjsail33 and myself.
Special thanks to the few who gave me feedback during the RFC and beta phase of the extend feature.
The text was updated successfully, but these errors were encountered:
Summary
This release breaks a few minor things and more importantly introduces extensibility to allow you to write your own rules (synchronous for now).
Breaking changes
Local options
label
,raw
anderror
in options are not supported anymore, you will have to use the already existing methods to change those behaviors.This is the side effect of a performance improvement aiming at keeping options concerning a single schema local to it, options are meant to be inherited in the whole hierarchy of schemas, I consider those features don't have any meaningful use being inherited.
The upside of this change is that you will have much better performance when using labels.
In brief, this means that :
Boolean
0 and 1 (as numbers or as strings) are now also accepted as inputs for booleans when convert is true.
Date
Using
date().format()
used to throw errors with codedate.base
, now it'sdate.format
.Internals
Joi now uses one more ES6 feature, that is classes. This should not impact any of you using node, but might for those of you that transpile Joi to run it into browsers.
New features
Joi.extend()
This is the new API to extend Joi, or rather make new custom versions of Joi. This would be pretty pointless to copy the documentation so I'll let you read it in place.
Contributors
The contributors to this release are @tjsail33 and myself.
Special thanks to the few who gave me feedback during the RFC and beta phase of the extend feature.
The text was updated successfully, but these errors were encountered: