-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
Use lodash v4. #1339
Use lodash v4. #1339
Conversation
{ | ||
apply: function apply(compiler) { | ||
compiler.parser.plugin('expression global', function expressionGlobalPlugin() { | ||
this.state.module.addVariable('global', "(function() { return this; }()) || Function('return this')()") |
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.
I'm curious how much going to great lengths like Lodash does is buying us. Should we settle for this, or should we do a more sophisticated check like #611 (comment)?
Also, are we breaking anyone with this? Are there environments where Object.getPrototypeOf
(as we had before) would “just work” but Function('return this')()"
would fail? I'm thinking stuff like Firefox extensions etc.
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.
You stated that double compiling is an edge case. One that webpack clearly doesn't support. This is going above and beyond to support double compiling in the primary browser case. If they are double compiling and using their code in extensions then yes it could be an issue.
Lodash's UMD is erm... robust because folks do some crazy interesting stuff and we have to support it. I don't know any other project who has as robust a UMD as lodash. I think your UMD is fine.
Thanks for following through with this! |
Np. The next Lodash release will remove the |
@jdalton when will that version be released, can it be a 4.1.1 that is released soon? |
Moved discussion to #1346. |
After merging reduxjs#1339 this project does have a dependency. I think it is better to remove the "and has no dependencies" from the README.md. Maybe it would be better to explain why lodash is added as a dependency.
Attempt 2 of #611.