-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
fix: remove lodash-es #2938
base: main
Are you sure you want to change the base?
fix: remove lodash-es #2938
Conversation
🦋 Changeset detectedLatest commit: bf9d8f5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/formium/formik/1oufpw9nf |
Size Change: 0 B Total Size: 39.7 kB ℹ️ View Unchanged
|
Maybe better completely get rid from lodash? |
Btw does it play with tsdx? |
To test the impact of a change like this we should test the impact of file size on the following for both a CJS (where applicable) and ESM project:
My theory is that we go ahead and use
I think if we combine those two changes, and instruct users to use the webpack lodash plugin, that may be the silver bullet solution to solving this issue in userland for v3. But we'll want to test and make sure webpack lodash plugin can correctly alias Basically, we should provide the standard and give devs the opportunity to optimize their project, instead of pre-optimizing on behalf of some, and ultimately hurting performance for others. Evidence that lodash is more popular than lodash-es: https://www.npmtrends.com/lodash-vs-lodash-es |
(we also may get rid of lodash completely depending on the API of v3) |
@johnrom I was just trying formik in a webpack project and was seeing both lodash being included in the final bundle. Not much impact on bundle size, as were named imported but no sense of having duplicate codes. |
@maddhruv that is one of the many different package configurations I listed, all of which will have different effects. if your project used I still agree with this change, though as mentioned above I think we should go above and beyond to limit the scope of our imports since |
TSDX intelligently bundles lodash and treeshakes properly. https://tsdx.io/optimization#using-lodash However, I would like to get rid of lodash altogether. I haven't yet found an equivalent of |
@jaredpalmer I mean will tsdx continue to work when lodash-es is removed? |
Haven't tried, my guess is it will not. |
AFAIK implementation is still your original one from back when formik handled its own build. |
lodash-es hasn't had a release since 4.17.15 and so is subject to a bunch of vulnerabilities v.s. lodash 4.17.20 which has none of them. See https://snyk.io/test/npm/lodash/4.17.15 |
Someday they may lost an access to |
I don't think anyone is advocating that we keep lodash-es for no reason, but I do recommend a bunch of mitigations above that need to be considered before merging this, and this should probably be shipped with v3 and not v2 for those who have already solved the duplication in their projects another way, unless we can prove in all situations I listed above this doesn't have a negative impact. |
I am open to removing lodash in v3 but we need to do it gracefully with warnings in v2 if there are any backwards incompatible changes (such as bracket path references) |
This pull request is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 60 days |
This bit looks fixed now. See https://github.com/lodash/lodash/issues/4879#issuecomment-748571123 |
@TrySound I'm 💯 in favor of this. 75kb (ungzipped) is a lot.. |
This pull request is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 60 days |
This pull request is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 60 days |
This pull request is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 60 days |
This pull request is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 60 days |
No description provided.