openknowledge-archive / datapackage-validate-js

[DEPRECATED] Replacement: https://github.com/frictionlessdata/datapackage-js
5 stars 6 forks source link

Allow passing schema as a second param. Tested. Closes #6. #7

Closed gvidon closed 9 years ago

gvidon commented 9 years ago
pwalsh commented 9 years ago

@gvidon I'm happy with this. I'm not going to merge though, as @rgrp is maintainer, so we need to hear from him. So, please use your fork in DataPackagist for the moment.

pwalsh commented 9 years ago

@rgrp @gvidon

Two points:

  1. Do we really need to keep the validateUrl method? I think not.
  2. I had a brief discussion with @rgrp on this because the API now uses Promises. This is why I initially hesitated to merge, as to date, other APIs in related packages used callbacks, in line with the default Node.js style. In DataPackagist, and other new libs that result from it like GoodTables JS and DataPackage Registry we use Promises, and I note that in Node.js land, Promises are quite widely in use now, with the Bluebird promises library, and the Promises A+ spec which is part of ES6.

So, I'm suggesting we merge and publish, but probably get rid of validateUrl first.

rufuspollock commented 9 years ago

@pwalsh happy with whatever is your call here. As noted in our discussion I have used Promises quite a bit (e.g. Recline) but IME I always find them more conceptually confusing than simple callback code. I get they avoid callback soup but I'm dubious of that value vs simplicity (and you can always promisify a callback setup - though it is somewhat painful). All that said this is very much your call.

The main issue is we need consistency across the libraries.

pwalsh commented 9 years ago

Ok so let's stick with promises, but let's use bluebird, which has nodeify and promisifyAll functions for full interop with callback code.

@gvidon:

  1. Here (and elsewhere, I'll help with that) let's swap out the promises polyfill for bluebird.
  2. Let's remove validateUrl in favour of a single validate API

@rgrp can you add me as a collaborator on npmjs.com so I can publish when ready (not urgent)

gvidon commented 9 years ago