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
Deprecate forEach* and map* methods #6367
Conversation
5d8086d
to
77d68f0
Compare
lib/Chunk.js
Outdated
configurable: false, | ||
value: util.deprecate(function(fn) { | ||
this._modules.forEach(fn); | ||
}, "Chunk.forEachModule: Use chunk.modulesIterable.forEach(fn) instead") |
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.
Use for(const module of chunk.modulesIterable) instead
An iterable has no forEach method. Here a Set is returned but you can't rely on that. The official return type is Iterable.
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’ll update the wording.
lib/Module.js
Outdated
configurable: false, | ||
value: util.deprecate(function(fn) { | ||
this._chunks.forEach(fn); | ||
}, "Module.forEachChunk: Use module.chunksIterable.forEach(fn) instead") |
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.
same
77d68f0
to
77bb4c0
Compare
@ooflorent Thanks for your update. I labeled the Pull Request so reviewers will review it again. @sokra Please review the new changes. |
Outdated uglify plugin or stuck test? |
@TheLarkInn CI fails at least one to 3 times on node 6 (😡 ) with timeouts or UglifyJS glitches. CI is not stable for node 6 on |
Thank you for your pull request! The most important CI builds succeeded, we’ll review the pull request soon. |
Thanks |
What kind of change does this PR introduce?
refactoring
Did you add tests for your changes?
no
If relevant, link to documentation update:
TODO
Summary
forEach*
andmap*
methods are not needed and add complexity to webpack. Since these modules could be replaced byArray.from()
, there are safe to deprecate.Does this PR introduce a breaking change?
no