tgriesser / checkit

simple, flexible validations for node and the browser
MIT License
223 stars 53 forks source link

Ability to configure promise library and utility library #28

Open michaelBenin opened 9 years ago

michaelBenin commented 9 years ago

This package now adds 24kb to my project after gzip.

Is this is too large for a validation library?

It would be nice if we had the ability to configure the _ utility and promise library utilized.

michaelBenin commented 9 years ago

BTW did some research using aliasify in my global transform, only one incompatibility found:

if (!_.isPlainObject(validation)) {

Testing the transform to swap out the promise lib for bluebird as well.

This convo relates to the promise part but not the utility part:

https://twitter.com/michaelbenin/status/584013146836246529

michaelBenin commented 9 years ago

When and bluebird are listed under dependencies, which are both promise libraries.

rhys-vdw commented 9 years ago

@michaelBenin Very late response here. Yep, you're right. Both when and bluebird are required. when should definitely be removed!

A PR to remove when would be welcome.

greghart commented 9 years ago

Looks like they were both added in https://github.com/tgriesser/checkit/commit/9688e5a7036c188b1d6749aa1a1dd667f5dc9032 which sets up separate build paths for client and server, so you get when and bluebird respectively on client or server (note it utilizes browserify/webpack browser key in package.json so the build tools use the right path). So I don't think removing when should be necessary at this point, though we may want to build dist with the client path (0.6.0 added ~24KB over 0.5.1).

Agreed though that either allowing configuration (or assume a global and require a polyfill) would be ideal