tmpfs / async-validate

Asynchronous type validation for node and the browser
Other
314 stars 45 forks source link

ANN: Peer review 0.12.x #30

Closed tmpfs closed 8 years ago

tmpfs commented 8 years ago

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 to 0.7.x:

Other changes:

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 open test/index.html); so now is the time to request new features or find bugs/incompatibilities whilst I consider cutting a v1.

Thanks for any help.

/cc @MarcosRava @oredi @filipedeschamps

tmpfs commented 8 years ago

Also, FYI a build of the core lib without any plugins is currently ~18KB before minification and compression.

tmpfs commented 8 years ago

The 0.7.8 version includes support for transient variables, see the docs:

https://github.com/freeformsystems/async-validate#variables

ghost commented 8 years ago

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 :)

tmpfs commented 8 years ago

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}
tmpfs commented 8 years ago

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.

tmpfs commented 8 years ago

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.

tmpfs commented 8 years ago

Added placeholder property support in 0.9.8, see eafae99211fccb406a88fe69bc2606fc789b85cb and:

https://github.com/freeformsystems/async-validate#placeholder

tmpfs commented 8 years ago

Support for multiple types (type as an array) added in 0.9.12, see #46.

tmpfs commented 8 years ago

Latest breaking change in 0.10.1 represented by #47.

I think this is the last one.

tmpfs commented 8 years ago

Nope, not the last breaking change, see #50 yet to be implemented.

tmpfs commented 8 years ago

Latest breaking change mentioned above landed in 0.11.2, see #50.

tmpfs commented 8 years ago

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.

tmpfs commented 8 years ago

Replaced by #55.