-
Notifications
You must be signed in to change notification settings - Fork 171
fix: lodash bundle-size #1044
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: lodash bundle-size #1044
Conversation
🦋 Changeset detectedLatest commit: d2be401 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
✅ PR title follows Conventional Commits specification. |
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit d2be401:
|
| @@ -1,5 +1,5 @@ | |||
| import { isEmpty } from 'lodash'; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😢
divyanshu013
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
.changeset/fifty-penguins-tickle.md
Outdated
| "@razorpay/blade": patch | ||
| --- | ||
|
|
||
| fix: lodash tree shaking. Reduce lodash bundle size from 47kb -> 23kb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's instead reword - reduce effective bundle size ... :)
| @@ -1,5 +1,5 @@ | |||
| import { isEmpty } from 'lodash'; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably need lodash esm or webpack lodash plugin if we don't want to do 'lodash/isEmpty'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup. I think we're anyway re-exporting it. auto-import imported it and I didn't notice earlier ;__;
We can have some eslint rules to disable these imports.
…lade into saurabh/fix/lodash-bundlesize
d2be401
This import was adding entire lodash bundle. There are some issues with tree-shaking which I am figuring out but this was a quickfix
Before - 47kb
After - 23kb