-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Add browserify and build-global script to make UMD version #861
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is something that is very intentionally not included in enzyme. Everything should only be available as node-style CJS; users of other module formats should convert on their own.
I strongly disagree. There's plenty of people out there that use plain JavaScript (script tags) with react and no JSX. It's unfair to treat everyone as skilled in module bundler tools. I strongly believe library authors can take extra care to make sure their library is as consumable as possible so other people can simply plop the library into their project and have it simply work. As you see in #47 (which also applies to browserify), it's not as simple as just "go build this with webpack or browserify" because... it fails in ways that most people probably don't even know how to deal with when using webpack and browserify in standard ways, otherwise #47 wouldn't exist. |
However, enzyme is not a production library - it's a testing library. People still using script tags are unlikely to even be writing tests at all, let alone trying to run them in the browser. It's 2017. Everyone needs to become skilled in module bundler tools - it's how modern web dev is done, full stop. It's not doing anyone any favors to make it easier for them to remain in the stone ages. |
Imagine a brand new programmer learning React, using globals, okay not using JSX for now, then wants to use this awesome "enzyme" test tool to test out a component. That user will be stuck without being able to experience the awesome, unless they now stop what they're doing and go learn build tools (which isn't a bad thing, but maybe not what they wanted to do at that moment, and maybe not what they are capable of yet, you'd be surprised how many people start programming and making awesome things without even knowing how the filesystem or command line works). As library authors, IMHO we should strive to make the end-user experience as easy as possible, as accessible as possible. In this case, shipping a global version would help. |
In companies, probably yes. Someone learning JavaScript with the plethora of online web-based in-browser editors out there? Not necessarily. That's besides the point. I am familiar with build tools, however I really do enjoy being able to open a website like jsfiddle, plopping a Suppose I'd like to test out a test library in jsfiddle, for example. It's relatively easy for a library author to ship a global. The time that it takes to do that gets distributed to one person instead of many many users. |
Suppose I'd like to show my friend, "hey, look how awesome this test tool enzyme is, here open this fiddle", and I was able to do it because of a simple global script tag. It's not always about build systems. |
Also a fair point, and having a nice enzyme template jsfiddle would be super helpful. |
No description provided.