Closed tmpfs closed 8 years ago
Also, FYI a build of the core lib without any plugins is currently ~18KB before minification and compression.
The 0.7.8
version includes support for transient variables, see the docs:
Looks like a huge refactoring a lot of changes to the API. It might take sometime to get up to speed but I will need to explore the new version.
Might need sometime though with my other open source contributions and main rice bowl word piling up :)
Just published 0.8.x
with the breaking change that previously you could use a pattern
regexp without specifying a type:
{pattern:/[a-z]+/i}
Now you must specify the string type:
{type: 'string', pattern:/[a-z]+/i}
The last breaking change I have on my list right now is in 0.9.x
.
Renamed the validator
field to test
for the rule function, see the assigned rule documentation and 18365462223df261000a9033d2552ce131848180.
Added support for passing state
information between rules, see:
https://github.com/freeformsystems/async-validate#state https://github.com/freeformsystems/async-validate/blob/master/doc/example/state.js
Available in 0.9.2
.
Added placeholder
property support in 0.9.8
, see eafae99211fccb406a88fe69bc2606fc789b85cb and:
https://github.com/freeformsystems/async-validate#placeholder
Support for multiple types (type
as an array) added in 0.9.12
, see #46.
Latest breaking change in 0.10.1
represented by #47.
I think this is the last one.
Nope, not the last breaking change, see #50 yet to be implemented.
Latest breaking change mentioned above landed in 0.11.2
, see #50.
The 0.12.0
version requires that type
is specified when not an inline or assigned rule and an error is thrown if it is not a string or function.
This should not affect anyone hopefully as the ability to validate on the source object and the temporary type inference logic that has been removed was only added recently.
Replaced by #55.
Prompted by issue #20 raised by @oredi I decided to a do a full review of this package for the following reasons:
So the past few days have seen a lot of breaking changes as it moved from
0.1.x
to0.7.x
:function(cb)
keys
processing optionclone()
useSchema.clone()
insteadenum
tolist
to avoidenum
keywordOther changes:
async
dependency, wrote minimal async iterator (browser)util.format
created and usedformat-util
(browser)bail
optionnull
type validationadditional
field (see #18)message
as function (see messages)message
as object and extract message using error reason id (see #8)method
type (function) supports the range propertieslen
,min
andmax
(arity)values
(see #2)The readme has been rewritten to be up to date and reflect the changes, if any of you have time to review this work and feedback it would be much appreciated.
Whilst many aspects of the internal workings have been rewritten and changes will be required to dependent code (custom rule validation functions) and to reflect the new plugin system, I don't think any changes to existing schema rules should be necessary except the
enum
breaking change noted above.I am relatively happy with the new API and can't think of any changes at this point, the code also now has 100% coverage and may be tested in the browser (
npm run spec
and opentest/index.html
); so now is the time to request new features or find bugs/incompatibilities whilst I consider cutting av1
.Thanks for any help.
/cc @MarcosRava @oredi @filipedeschamps