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

Say no - to lodash #360

Closed
uboness opened this issue Feb 1, 2018 · 8 comments
Closed

Say no - to lodash #360

uboness opened this issue Feb 1, 2018 · 8 comments

Comments

@uboness
Copy link
Contributor

uboness commented Feb 1, 2018

Get rid of lodash dependency!

@myasonik
Copy link
Contributor

Is the impetus to remove lodash just bundle size or is there more to it than that?

@chandlerprall
Copy link
Contributor

Bundle size and limiting number & scope of external dependencies.

@smhutch
Copy link
Contributor

smhutch commented Oct 2, 2020

I started looking into this today, and would like to help out. As a starting point, would it be suitable to open a PR which changes a couple of lodash imports as shown below?

# current
import _ from 'lodash'
import { utilA, utilB } from 'lodash'

# proposed
import utilA from 'lodash/utilA'
import utilB from 'lodash/utilB'

Although the approach I'm proposing here is a bit repetitive, my understanding is that it enables Webpack to bundle-split lodash. When I perform bundle analysis on my current application (which consumes eui), it appears the entire lodash library is included. This guide, and this summary post led me to make this suggestion, though I'm unsure if other webpack configuration changes would be required.

It appears that these two modules would need to change:

import { defaults } from 'lodash';

Getting rid of lodash completely would also be good. My idea is to use this as a low-risk stepping stone towards that. 😄

@chandlerprall
Copy link
Contributor

Removing lodash completely is the goal. Replacing each instance of its use in small batches - either by file by lodash method - will likely be the easiest way for us to review.

@smhutch
Copy link
Contributor

smhutch commented Oct 2, 2020

Awesome, I'll likely make that contribution at the start of next week 😄

@github-actions
Copy link

github-actions bot commented Apr 1, 2021

👋 Hey there. This issue hasn't had any activity for 180 days. We'll automatically close it if that trend continues for another week. If you feel this issue is still valid and needs attention please let us know with a comment.

@smith
Copy link
Contributor

smith commented Dec 17, 2021

Note that if you remove lodash from EUI (a noble goal!) when you use it in Kibana you will still have lodash.

@cee-chen
Copy link
Member

cee-chen commented Apr 3, 2023

Agreed that this is a noble goal, but given the size of EUI's backlog and many other higher priority tech debt items to work on, it's unlikely we'll be working on this as a team anytime soon. We're going to go ahead and close this as a result, but if anyone else is interested in contributing to EUI or taking lead on this, we will gladly welcome your contributions.

@cee-chen cee-chen closed this as not planned Won't fix, can't repro, duplicate, stale Apr 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants