You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 16, 2023. It is now read-only.
different resolve orders can have different results.
Some one are using both clamp and toNumber,two source structures can get different results.
The first structure has two files, in witch the coercions feature will be true:
// file index.js constclamp=require('lodash/clamp')clamp(['123','1','2'])// get number `2`require('./b')// file b.jsconsttoNumber=require('lodash/toNumber')toNumber('123')// get number 123
The second structure has three files, in witch the coercions feature will be false:
// file index.js constclamp=require('lodash/clamp')clamp(['123','1','2'])// get string `123`require('./a')// file a.js: we justadd this!require('./b')// file b.jsconsttoNumber=require('lodash/toNumber')toNumber('123')// get string `'123'`!!!
It should be noted that in the second example, the behavior of toNumber is exactly incorrect.
Think further, some code in third-party also could affect your code.
Totally with you here. This package can do more harm than good. The only way I can see it working is if we could analyse the AST to detect these incompatibilities. It's wild to think that this is an official package from lodash.
it's an "official" plugin so people are more likely to install without thinking of potential consequences
essentially this library will work against any developers who ran into lodash issues, and will only make them debug aimlessly for hours (like I did...)
lodash-webpack-plugin could affect third-party packages
Say that you use some third-party package that uses
lodash/map
like this:After you use lodash-webpack-plugin, the third-party package will be broken.
Auto features detectings: harm over benefit
lodash-webpack-plugin removes/replaces some features by default, but it can be overridden after we import some module.
Some one write code like this and it work as expected:
After remove this line:
The
sortBy(...)
would get broken.different resolve orders can have different results.
Some one are using both
clamp
andtoNumber
,two source structures can get different results.The first structure has two files, in witch the
coercions
feature will betrue
:The second structure has three files, in witch the
coercions
feature will befalse
:It should be noted that in the second example, the behavior of
toNumber
is exactly incorrect.Think further, some code in third-party also could affect your code.
Some examples: https://github.com/meowtec/why-you-should-not-use-lodash-webpack-plugin
Please consider to deprecate
lodash-webpack-plugin
The text was updated successfully, but these errors were encountered: