Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Browser support #70

Open
chrahunt opened this issue May 15, 2015 · 12 comments
Open

Browser support #70

chrahunt opened this issue May 15, 2015 · 12 comments

Comments

@chrahunt
Copy link
Collaborator

Are there any plans to include browser support in this project? IMJV performs far better than the current JSON Schema validators that also work in the browser (Z-Schema and tv4). Using browserify in combination with

window.imjv = require('./index.js')

worked fine for me, and validating my objects takes 30ms compared to upwards of 3.5s using Z-Schema. I'd hate to think that others are skipping this library and its performance benefits because there isn't a pre-built version for web browsers.

@mafintosh
Copy link
Owner

Assuming its easy to maintain I'm 👍

@chrahunt
Copy link
Collaborator Author

Any preference for global variable name? Maybe IMJValidator?

@mafintosh
Copy link
Owner

I trust your judgement :)

@sathishk
Copy link

+1

I think it is not just speed. compared to other libraries (tv4, jsen), is-my-json-valid is good with complex validations. Ref: bugventure/jsen#38

This schema works as expected in is-my-json-valid.

Browser support will be really helpful to get this to plain HTML applications also.

@mafintosh
Copy link
Owner

If anyone wants to do a PR for this I'd merge it

@Basdub
Copy link

Basdub commented Jul 29, 2015

Is it a complicated task to make it available to the browser? just asking, I have no idea ;)

Is it coming?

@mafintosh
Copy link
Owner

@Basdub you can use in the browser today with browserify. like i mentioned above its pretty easy to do static builds. we just need someone to add a script to package.json that will do that for us so we don't have to do it manually every time we publish a new version

@Basdub
Copy link

Basdub commented Jul 29, 2015

Yep get that. You'll laugh but I'm not Node.js ready/setup yet. @chrahunt , could you provide your script to add to package.json?

Thanks

@Basdub
Copy link

Basdub commented Jul 29, 2015

Or, @chrahunt, could I get your browserified version of it? Thanks

@mafintosh
Copy link
Owner

@Basdub https://wzrd.in/standalone/is-my-json-valid@latest (window.isMyJsonValid(...) afterwards)

@igl
Copy link

igl commented Aug 24, 2015

Having it work in Browserify & Webpack is already fine for me, but you might want to checkout UMD for this: https://github.com/umdjs/umd

kvnneff added a commit to kvnneff/is-my-json-valid that referenced this issue Sep 2, 2015
@bugventure
Copy link

@sathishk The JSEN issue you've referred to actually represents a badly defined schema, not really a limitation of JSEN.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants