flatiron / revalidator

A cross-browser / node.js validator powered by JSON Schema
http://github.com/flatiron/revalidator
Apache License 2.0
589 stars 82 forks source link

Support for AMD by using UMD or similar #21

Open alexlawrence opened 12 years ago

alexlawrence commented 12 years ago

Could you maybe add support for AMD by using the Universal Module Definition which supports CommonJS/NodeJS, AMD and good old globals?

Read about it here: https://github.com/umdjs/umd Example implementation: https://github.com/umdjs/umd/blob/master/returnExportsGlobal.js

Thank you Regards

jfhbrook commented 12 years ago

Wow, that looks gnarly. Browsers :(

I'd be open to a pull request that added support for browser-side amd, as long as it was also compatible with browserify.

alexlawrence commented 12 years ago

It´s not that bad. Just remove all the comments (which no one reads anyways) and it´s only a few lines of code ;)

Okay, I will have a look at it. And try browserify.

Cheers

konsumer commented 9 years ago

I did the browserify stuff properly (UMD-style) and added a demo in that last PR.

konsumer commented 9 years ago

It might make sense to add an empty gh-pages branch and put clientside.html in there as index.html, and the dist folder, then people can use gh-pages like a CDN, and you have a nice live demo, like so.