-
Notifications
You must be signed in to change notification settings - Fork 47.5k
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
envify in peerDependencies complicates use with node #1482
Comments
I think we can move it to dependencies, though it's a little silly in either case to require people who might not be using browserify to install it. @petehunt Any objections? |
It doesn't seem like it's being used in the code that makes it on to npm. I searched with ag and all occurrences seem to be inside of BTW I'm glad to know about envify, it has made me aware of security issues with credentials being stored in environment variables. |
It's used as a browserify transform when building a bundle so needs to be required then. It's not used before npm so doesn't belong in devDependencies. |
Yep, just searched the source (as opposed to what npm installs) and it's in |
No, that's for the non-npm (browser) builds. envify is referenced in the browserify https://github.com/facebook/react/blob/master/npm-react/package.json |
I see. It appears the envify transform might be a no-op (more info below). Perhaps both the dependency and the transform should be removed, but envify should keep being used by grunt. I created a file
I ran I then removed the transform in I ran It appears this is because the JavaScript in the npm package doesn't reference |
I see |
Fixes facebook#1482. It doesn't seem like this is actually doing anything and it's causing problems for people, so remove it.
I fiddled with it and found that it only works if process.env.NODE_ENV is set. I set process.env.NODE_ENV to 'development' and got a different result. However, I think that it's better to leave envify up to the developer making a bundle with browserify, rather than including the transform. One good place to do this is after the concatenation but before the minification. This is what [uglifyify](https://github.com/hughsk/uglifyify#motivationusage suggests in its README). So I think the change you made is a good permanent solution to this issue. |
The package uses
peerDependencies
in package.json for envify. Why not usedependencies
instead? The adoption ofpeerDependencies
is low and it's being debated whether it should be kept in node.browserify-cdn is a tool which requirebin uses. requirebin is a nifty tool for building modular examples and sharing them. I would like to use it with react, but browserify-cdn doesn't work well with peerDependencies. It would be extra work to make it work with them, and anyone building a similar tool might have to do the extra work as well. Because of this I would very much like node packages that are designed to be used client-side to not rely on peerDependencies.
The text was updated successfully, but these errors were encountered: