I find it very misleading to not classify that Joi is for NodeJS only. I've implemented bunch of validation with Joi but only to realize that I cannot use it because IE11 is missing some ES6 features in hoek module.
Can you please refer me to some other similar library that is supported in browser as well?
Frankly I find it bit overkill to use whole hoek here just for a couple of utility methods that can be obtained elsewhere. By removing this dependency there are suddenly no issues with using joi in browser and that would be real joy.
Use joi-browser.
@Marsup Sorry, but why this isn't mentioned in docs here? I am sure you getting bunch of issues like this. Single message in readme would really help, don't you think?
Because that's just one way to do it, you might have a different build process, I don't want to assume anything about how you package your app.
How is that assumption of anything? Clearly joi package cannot be used in browser as it is and you don't provide browser builds. It's more about being nice to consumers to clearly state, that for use in a browser you need to use some kind of bundler and inform about existence of joi-browser.
It's your fight in the end, but I am surely not a last person who gets confused about this.
@Marsup I think he's just suggesting a short blurb in the README, such as:
If you need a version of
joicompatible with the browser, take a look atjoi-browser
Oh I know what he meant, and there's no single way to do that, you'll have to figure it out based on your own stack at some point.
@Marsup I don't follow. What's wrong about using joi-browser in general? It creates UMD bundle. There is no dependency on any kind of stack. I am really confounded why you are forcing people to find out about it hard way, but I guess you just enjoy closing this kind of issues, right?
First, I can do without the snarky comments, thanks.
Second, I ship browser code, I ship it with ES2015 code because I can, this is my target, I still need a build step to deal with hoek, but I don't need nor desire the fallback to ES5, thus I don't need joi-browser. There's almost nothing wrong with it, it's just for legacy browsers and more fat than it needs to be. Added some text anyway...
Thank you for the commit, much appreciated not just by me but surely also by future consumers.
I apparently need joi-browser because I just don't want to mess up my webpack config with exception for bundling hoek. It just feels dirty and hard to reason about. I've read discussions about it and I don't agree, but I am not going talk about it here
Most helpful comment
Oh I know what he meant, and there's no single way to do that, you'll have to figure it out based on your own stack at some point.