-
-
Notifications
You must be signed in to change notification settings - Fork 13
Description
Is there an existing issue or pull request for this?
- I have searched the existing issues and pull requests
Feature description
This package uses a few utilities from lodash and lists it in the dependencies.
This means all users of the library will have to download the entire lodash library, which can be improved!
Desired solution
I would recommend bundling the library by moving it to the devDeps, this would allow tsup to treeshake the ununsed code and make sure only used functions are included in the published library.
You can also replace lodash entirely by using smaller alternatives to the two functions you use (get and uniqWith). I would still recommend bundling whatever you use, since the utility functions in question are very small and usually turns out less than 1kb in size after bundling them 😄
The easiest replacement is es-toolkit which implements compatible functions compatible with lodash, but faster and smaller.
Alternatives considered
There's also dlv for get, but it only supports foo.0.bar syntax and not foo[0].bar like in your documentation
And uniqWith is a fairly simple function that could be manually written for the project
Additional context
I can open a PR for this if you're up for it!
There's also some other changes I am open to help with if you want:
tsupis no longer actively maintained in favor oftsdownrimrafis generally not necessary anymore, either letting bundlers clean dirs by themselves or usingpremoveinsteadfast-deep-equalcould be replaced withdequalas it's ever so slightly faster and better, but the differences are not very large.