webpack-contrib / webpack-bundle-analyzer

Webpack plugin and CLI utility that represents bundle content as convenient interactive zoomable treemap
MIT License
12.53k stars 479 forks source link

Replace all `lodash.*` packages #612

Closed SukkaW closed 10 months ago

SukkaW commented 10 months ago

The PR replaces all lodash.* packages.


Comparison

Running npm i --omit=dev --omit=optional against webpack-contrib/webpack-bundle-analyzer:master:

image

Running npm i --omit=dev --omit=optional against sukkaw/webpack-bundle-analyzer:repalce-lodash-usage:

image

The installation size becomes even smaller!

stof commented 10 months ago

For throttle and debounce, I'm using https://www.npmjs.com/package/@github/mini-throttle personally. It is small, efficient and maintained.

SukkaW commented 10 months ago

For throttle and debounce, I'm using https://www.npmjs.com/package/@github/mini-throttle personally. It is small, efficient and maintained.

I was thinking about using perfect-debounce from the unjs community (https://www.npmjs.com/package/perfect-debounce). However, webpack-bundle-analyzer still targets Node.js 10.13.0+ and I was afraid of breaking it. So I chose the debounce package instead. Once the Node.js 10 support has been dropped, we can switch to a more modern package.

stof commented 10 months ago

Do you also want to replace the packages used as dev dependencies ?

valscion commented 10 months ago

Do you also want to replace the packages used as dev dependencies ?

Hmm, I don't know about that. If we do decide to go that route, let's at least split that work to its own PR to make this diff smaller.

valscion commented 8 months ago

Released in v4.10.0! ☺️