Skip to content
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

chore: use lodash-es to improve bundle size #4072

Merged
merged 4 commits into from
Sep 28, 2020
Merged

Conversation

layershifter
Copy link
Member

@layershifter layershifter commented Sep 28, 2020

This PR reduces bundle size for projects that are using ES modules i.e. Webpack, Rollup, Next.js, Gatsby, etc. As SUIR depends on Lodash heavily the usage of lodash-es allows to improve tree-shaking as ModuleConcatenationPlugin understands currently only ES modules.

The solution was inspired by TSDx.


This may have negative impact on projects that are using lodash dependency, feel free to leave feedback in this PR.

@github-actions
Copy link

github-actions bot commented Sep 28, 2020

size-limit report

Path Size
bundle-size/dist/Button.size.js 58.63 KB (-13.36% 🔽)
bundle-size/dist/Icon.size.js 25.06 KB (-22.33% 🔽)
bundle-size/dist/Image.size.js 53.81 KB (-14.67% 🔽)
bundle-size/dist/Modal.size.js 68.67 KB (-11.73% 🔽)
bundle-size/dist/Portal.size.js 40.52 KB (-17.93% 🔽)

@codecov-commenter
Copy link

codecov-commenter commented Sep 28, 2020

Codecov Report

Merging #4072 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #4072   +/-   ##
=======================================
  Coverage   99.84%   99.84%           
=======================================
  Files         183      183           
  Lines        3280     3280           
=======================================
  Hits         3275     3275           
  Misses          5        5           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 26daf99...c679f12. Read the comment docs.

@noinkling
Copy link
Contributor

Just thought you might want to be aware of lodash/lodash#4879, I don't know what's going on there.

@layershifter
Copy link
Member Author

@noinkling good call 🙁 Let's see how it will go, overall I would like to use less Lodash on our components.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants