-
Notifications
You must be signed in to change notification settings - Fork 513
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
Import only lodash submodules #2032
Labels
Comments
Hey, @yurishkuro! I would like to work on this. |
Can you please tell how did you generated this bundle size visualization. |
It's auto generated by our build, stats.html |
yurishkuro
added a commit
that referenced
this issue
Dec 8, 2023
## Which problem is this PR solving? - Part of #2032 ## Description of the changes - Port partial changes from #2023 ## How was this change tested? - CI --------- Signed-off-by: MeenuyD <meenu.coninja@gmail.com> Signed-off-by: Yuri Shkuro <github@ysh.us> Co-authored-by: MeenuyD <meenu.coninja@gmail.com>
4 tasks
yurishkuro
pushed a commit
that referenced
this issue
Dec 12, 2023
## Which problem is this PR solving? - resolves #2032 ## Description of the changes - Import only lodash submodules ## How was this change tested? - locally Super cool that it reduced the size taken by lodash bundle by 70.59% (master branch vs this) Before: ![image](https://github.com/jaegertracing/jaeger-ui/assets/94157520/25bc9f04-c4a7-45c0-b481-0332c09fca3c) lodash: 773.55 KB After: ![image](https://github.com/jaegertracing/jaeger-ui/assets/94157520/54bbb26e-9804-4718-beaf-02cb382d0f62) lodash: 227.43 KB ## Checklist - [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [x] I have signed all commits - [x] I have added unit tests for the new functionality - [x] I have run lint and test steps successfully - for `jaeger`: `make lint test` - for `jaeger-ui`: `yarn lint` and `yarn test` --------- Signed-off-by: Ansh Goyal <anshgoyal1704@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In order to reduce the bundle size, lodash recommends importing submodules, e.g.
import _get from 'lodash/get'
instead ofimport { debounce } from 'lodash'
. Most of our code is already like that, with the exception of just a handful of files:This ticket is to clean up these remaining full imports by replacing them with the needed submodule imports.
It will be interesting to see how much it would affect the bundle size:
The text was updated successfully, but these errors were encountered: