Automattic / wp-api-console

WordPress (.com and .org) API Console written in React/Redux
GNU General Public License v2.0
70 stars 20 forks source link

Remove lodash as a project dependency #91

Closed dmsnell closed 2 years ago

dmsnell commented 2 years ago

✅ ~Do not merge until after #89 merges~

Our use of the babel-lodash-plugin has made it hard to update our build tool versions. It has also tied us to that plugin lest we dramatically increase our build size.

In this patch we're replacing all uses of lodash functions with alternatives, simplified copies of the lodash functions, or with direct expressions equivalent to the lodash variants.

Build size shrinks from 164 KB gzip'd to 157 KB gzip'd.

Testing

This needs ample testing over the changed files.

Note: It appears as though I'm unable to build using node16. node12 seems to work. not sure what we'll have to do to make sure this doesn't all break.

dmsnell commented 2 years ago

I tested this on the affected files where I could and couldn't find any regressions.