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

Classify joi as NodeJS only tool? #944

Closed
danielkcz opened this issue Jul 13, 2016 · 9 comments
Closed

Classify joi as NodeJS only tool? #944

danielkcz opened this issue Jul 13, 2016 · 9 comments
Assignees
Labels
non issue Issue is not a problem or requires changes

Comments

@danielkcz
Copy link

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.

@Marsup
Copy link
Collaborator

Marsup commented Jul 13, 2016

Use joi-browser.

@Marsup Marsup closed this as completed Jul 13, 2016
@Marsup Marsup added the non issue Issue is not a problem or requires changes label Jul 13, 2016
@Marsup Marsup self-assigned this Jul 13, 2016
@danielkcz
Copy link
Author

@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?

@Marsup
Copy link
Collaborator

Marsup commented Jul 13, 2016

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.

@danielkcz
Copy link
Author

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.

@danielb2
Copy link
Contributor

danielb2 commented Jul 13, 2016

@Marsup I think he's just suggesting a short blurb in the README, such as:

If you need a version of joi compatible with the browser, take a look at joi-browser

@Marsup
Copy link
Collaborator

Marsup commented Jul 13, 2016

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.

@danielkcz
Copy link
Author

danielkcz commented Jul 13, 2016

@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?

@Marsup
Copy link
Collaborator

Marsup commented Jul 13, 2016

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...

@danielkcz
Copy link
Author

danielkcz commented Jul 13, 2016

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

@lock lock bot locked as resolved and limited conversation to collaborators Jan 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
non issue Issue is not a problem or requires changes
Projects
None yet
Development

No branches or pull requests

3 participants