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

Replace lodash dependency with lodash.isEmpty #443

Open
davidjoy opened this issue Jul 2, 2024 · 1 comment
Open

Replace lodash dependency with lodash.isEmpty #443

davidjoy opened this issue Jul 2, 2024 · 1 comment

Comments

@davidjoy
Copy link
Contributor

davidjoy commented Jul 2, 2024

Currently the Studio footer depends on the entire lodash library. This pulls in significantly more code than we need, as we only use the isEmpty function.

We should replace the lodash dependency with the lodash.isEmpty library; this will take a decently sized chunk out of the bundle sizes of our MFEs.

@regisb
Copy link

regisb commented Jul 4, 2024

I ran npx howfat . in this repo and this is what I got. If I'm reading this right, removing lodash is going to remove 1054 files (!!!) and 1.35 MB?

@edx/[email protected] (150 deps, 39.2mb, 8916 files, ©undefined)
├─┬ @fortawesome/[email protected] (1 dep, 1.13mb, 16 files, ©MIT)
│ ╰── @fortawesome/[email protected] (771.85kb, 5 files, ©MIT)
├─┬ @fortawesome/[email protected] (1 dep, 2.84mb, 1062 files, ©(CC-BY-4.0 AND MIT))
│ ╰── @fortawesome/[email protected] (771.85kb, 5 files, ©MIT)
├─┬ @fortawesome/[email protected] (1 dep, 1.4mb, 526 files, ©(CC-BY-4.0 AND MIT))
│ ╰── @fortawesome/[email protected] (771.85kb, 5 files, ©MIT)
├─┬ @fortawesome/[email protected] (1 dep, 5.6mb, 3914 files, ©(CC-BY-4.0 AND MIT))
│ ╰── @fortawesome/[email protected] (771.85kb, 5 files, ©MIT)
├─┬ @fortawesome/[email protected] (5 deps, 178.39kb, 44 files, ©MIT)
│ ╰─┬ [email protected] (4 deps, 141.47kb, 38 files, ©MIT)
│   ├─┬ [email protected] (1 dep, 20.39kb, 13 files, ©MIT)
│   │ ╰── [email protected] (14.72kb, 5 files, ©MIT)
│   ├── [email protected] (5.36kb, 4 files, ©MIT)
│   ╰── [email protected] (23.39kb, 9 files, ©MIT)
├─┬ [email protected] (117 deps, 13.4mb, 1848 files, ©MIT)
│ ├─┬ @jest/[email protected] (56 deps, 3.68mb, 530 files, ©MIT)
│ │ ├── @jest/[email protected] (🔗, 55 deps, 3.67mb, 526 files, ©MIT)
│ │ ├── @jest/[email protected] (🔗, 15 deps, 2.7mb, 220 files, ©MIT)
│ │ ├── @types/[email protected] (🔗, 1 dep, 2.06mb, 100 files, ©MIT)
│ │ ╰── [email protected] (🔗, 26 deps, 3.02mb, 309 files, ©MIT)
│ ├─┬ @jest/[email protected] (55 deps, 3.67mb, 526 files, ©MIT)
│ │ ├── @jest/[email protected] (🔗, 15 deps, 2.7mb, 220 files, ©MIT)
│ │ ├─┬ @sinonjs/[email protected] (2 deps, 156.41kb, 63 files, ©BSD-3-Clause)
│ │ │ ╰─┬ @sinonjs/[email protected] (1 dep, 78.19kb, 59 files, ©BSD-3-Clause)
│ │ │   ╰── [email protected] (41.12kb, 5 files, ©MIT)
│ │ ├── @types/[email protected] (🔗, 1 dep, 2.06mb, 100 files, ©MIT)
│ │ ├─┬ [email protected] (42 deps, 3.29mb, 385 files, ©MIT)
│ │ │ ├─┬ @babel/[email protected] (11 deps, 194.28kb, 70 files, ©MIT)
│ │ │ │ ├─┬ @babel/[email protected] (10 deps, 170.78kb, 65 files, ©MIT)
│ │ │ │ │ ├── @babel/[email protected] (48.15kb, 10 files, ©MIT)
│ │ │ │ │ ├─┬ [email protected] (6 deps, 83.07kb, 38 files, ©MIT)
│ │ │ │ │ │ ├─┬ [email protected] (2 deps, 44.62kb, 18 files, ©MIT)
│ │ │ │ │ │ │ ╰─┬ [email protected] (1 dep, 35.47kb, 14 files, ©MIT)
│ │ │ │ │ │ │   ╰── [email protected] (9.14kb, 7 files, ©MIT)
│ │ │ │ │ │ ├── [email protected] (2.63kb, 4 files, ©MIT)
│ │ │ │ │ │ ╰─┬ [email protected] (1 dep, 9.53kb, 9 files, ©MIT)
│ │ │ │ │ │   ╰── [email protected] (3.05kb, 4 files, ©MIT)
│ │ │ │ │ ├── [email protected] (🔗, 14.72kb, 5 files, ©MIT)
│ │ │ │ │ ╰── [email protected] (🔗, 5.03kb, 7 files, ©ISC)
│ │ │ │ ╰── [email protected] (5.03kb, 7 files, ©ISC)
│ │ │ ├── @jest/[email protected] (🔗, 15 deps, 2.7mb, 220 files, ©MIT)
│ │ │ ├── @types/[email protected] (6.28kb, 5 files, ©MIT)
│ │ │ ├── [email protected] (🔗, 5 deps, 95.08kb, 33 files, ©MIT)
│ │ │ ├── [email protected] (🔗, 31.77kb, 7 files, ©ISC)
│ │ │ ├─┬ [email protected] (5 deps, 234.52kb, 36 files, ©MIT)
│ │ │ │ ├─┬ [email protected] (3 deps, 91.73kb, 22 files, ©MIT)
│ │ │ │ │ ╰─┬ [email protected] (2 deps, 48.14kb, 12 files, ©MIT)
│ │ │ │ │   ╰─┬ [email protected] (1 dep, 31.79kb, 8 files, ©MIT)
│ │ │ │ │     ╰── [email protected] (9.39kb, 4 files, ©MIT)
│ │ │ │ ╰── [email protected] (🔗, 87.84kb, 10 files, ©MIT)
│ │ │ ├─┬ [email protected] (4 deps, 533.63kb, 76 files, ©MIT)
│ │ │ │ ├── @jest/[email protected] (🔗, 1 dep, 437.62kb, 48 files, ©MIT)
│ │ │ │ ├── [email protected] (13.28kb, 5 files, ©MIT)
│ │ │ │ ╰── [email protected] (23.45kb, 8 files, ©MIT)
│ │ │ ├── [email protected] (3.42kb, 5 files, ©MIT)
│ │ │ ╰─┬ [email protected] (1 dep, 17.44kb, 9 files, ©MIT)
│ │ │   ╰── [email protected] (3.18kb, 5 files, ©MIT)
│ │ ├── [email protected] (🔗, 26 deps, 3.02mb, 309 files, ©MIT)
│ │ ╰── [email protected] (🔗, 25 deps, 2.97mb, 304 files, ©MIT)
│ ├─┬ @jest/[email protected] (15 deps, 2.7mb, 220 files, ©MIT)
│ │ ├─┬ @jest/[email protected] (1 dep, 437.62kb, 48 files, ©MIT)
│ │ │ ╰── @sinclair/[email protected] (431.69kb, 43 files, ©MIT)
│ │ ├── @types/[email protected] (5.32kb, 5 files, ©MIT)
│ │ ├─┬ @types/[email protected] (2 deps, 19.57kb, 15 files, ©MIT)
│ │ │ ╰─┬ @types/[email protected] (1 dep, 13.05kb, 10 files, ©MIT)
│ │ │   ╰── @types/[email protected] (🔗, 5.32kb, 5 files, ©MIT)
│ │ ├── @types/[email protected] (🔗, 1 dep, 2.06mb, 100 files, ©MIT)
│ │ ├─┬ @types/[email protected] (1 dep, 67.19kb, 14 files, ©MIT)
│ │ │ ╰── @types/[email protected] (8.45kb, 5 files, ©MIT)
│ │ ╰─┬ [email protected] (5 deps, 95.08kb, 33 files, ©MIT)
│ │   ├─┬ [email protected] (2 deps, 49.67kb, 16 files, ©MIT)
│ │   │ ╰─┬ [email protected] (1 dep, 33.09kb, 11 files, ©MIT)
│ │   │   ╰── [email protected] (6.54kb, 4 files, ©MIT)
│ │   ╰─┬ [email protected] (1 dep, 11.19kb, 10 files, ©MIT)
│ │     ╰── [email protected] (4.32kb, 5 files, ©MIT)
│ ├─┬ @types/[email protected] (5 deps, 3.16mb, 243 files, ©MIT)
│ │ ├── @types/[email protected] (🔗, 1 dep, 2.06mb, 100 files, ©MIT)
│ │ ├── @types/[email protected] (13.22kb, 5 files, ©MIT)
│ │ ╰─┬ [email protected] (1 dep, 1.06mb, 132 files, ©MIT)
│ │   ╰── [email protected] (403.21kb, 68 files, ©BSD-2-Clause)
│ ├─┬ @types/[email protected] (1 dep, 2.06mb, 100 files, ©MIT)
│ │ ╰── [email protected] (71.34kb, 35 files, ©MIT)
│ ├─┬ [email protected] (26 deps, 3.02mb, 309 files, ©MIT)
│ │ ├── @jest/[email protected] (🔗, 15 deps, 2.7mb, 220 files, ©MIT)
│ │ ├── @types/[email protected] (🔗, 1 dep, 2.06mb, 100 files, ©MIT)
│ │ ╰── [email protected] (🔗, 25 deps, 2.97mb, 304 files, ©MIT)
│ ├─┬ [email protected] (25 deps, 2.97mb, 304 files, ©MIT)
│ │ ├── @jest/[email protected] (🔗, 15 deps, 2.7mb, 220 files, ©MIT)
│ │ ├── @types/[email protected] (🔗, 1 dep, 2.06mb, 100 files, ©MIT)
│ │ ├─┬ [email protected] (5 deps, 95.08kb, 33 files, ©MIT)
│ │ │ ├─┬ [email protected] (2 deps, 49.67kb, 16 files, ©MIT)
│ │ │ │ ╰─┬ [email protected] (1 dep, 33.09kb, 11 files, ©MIT)
│ │ │ │   ╰── [email protected] (6.54kb, 4 files, ©MIT)
│ │ │ ╰─┬ [email protected] (1 dep, 11.19kb, 10 files, ©MIT)
│ │ │   ╰── [email protected] (4.32kb, 5 files, ©MIT)
│ │ ├── [email protected] (25.45kb, 7 files, ©MIT)
│ │ ├── [email protected] (31.77kb, 7 files, ©ISC)
│ │ ╰── [email protected] (87.84kb, 10 files, ©MIT)
│ ╰─┬ [email protected] (55 deps, 8.61mb, 1171 files, ©MIT)
│   ├── [email protected] (10.2kb, 7 files, ©BSD-3-Clause, ⛔ Use your platform's native atob() a…)
│   ├── [email protected] (525kb, 10 files, ©MIT)
│   ├─┬ [email protected] (2 deps, 585.6kb, 22 files, ©MIT)
│   │ ├── [email protected] (🔗, 525kb, 10 files, ©MIT)
│   │ ╰─┬ [email protected] (1 dep, 576.38kb, 18 files, ©MIT)
│   │   ╰── [email protected] (🔗, 525kb, 10 files, ©MIT)
│   ├── [email protected] (50.84kb, 26 files, ©MIT)
│   ├─┬ [email protected] (1 dep, 219.94kb, 119 files, ©MIT)
│   │ ╰── [email protected] (47.85kb, 24 files, ©MIT)
│   ├─┬ [email protected] (6 deps, 393.59kb, 53 files, ©MIT)
│   │ ├── [email protected] (🔗, 10.2kb, 7 files, ©BSD-3-Clause, ⛔ Use your platform's native atob() a…)
│   │ ├── [email protected] (🔗, 16.42kb, 8 files, ©MIT)
│   │ ╰── [email protected] (🔗, 3 deps, 359.1kb, 33 files, ©MIT)
│   ├── [email protected] (276.16kb, 6 files, ©MIT)
│   ├─┬ [email protected] (1 dep, 43.38kb, 15 files, ©MIT, ⛔ Use your platform's native DOMExcep…)
│   │ ╰── [email protected] (🔗, 23.67kb, 4 files, ©BSD-2-Clause)
│   ├─┬ [email protected] (4 deps, 1.25mb, 46 files, ©BSD-2-Clause)
│   │ ├── [email protected] (306.99kb, 7 files, ©BSD-2-Clause)
│   │ ├── [email protected] (36.22kb, 6 files, ©BSD-2-Clause)
│   │ ├── [email protected] (49.4kb, 7 files, ©BSD-2-Clause)
│   │ ╰── [email protected] (786.35kb, 20 files, ©BSD-3-Clause)
│   ├─┬ [email protected] (5 deps, 306.73kb, 50 files, ©MIT)
│   │ ├── [email protected] (26.72kb, 20 files, ©MIT)
│   │ ├─┬ [email protected] (1 dep, 19.08kb, 11 files, ©MIT)
│   │ │ ╰── [email protected] (7.83kb, 6 files, ©MIT)
│   │ ╰─┬ [email protected] (1 dep, 218.57kb, 11 files, ©MIT)
│   │   ╰── [email protected] (200.72kb, 6 files, ©MIT)
│   ├─┬ [email protected] (3 deps, 405.6kb, 50 files, ©MIT)
│   │ ╰── [email protected] (🔗, 2 deps, 394.2kb, 46 files, ©MIT)
│   ├─┬ [email protected] (4 deps, 114.52kb, 41 files, ©MIT)
│   │ ├── @tootallnate/[email protected] (15.95kb, 12 files, ©MIT)
│   │ ├─┬ [email protected] (2 deps, 81.89kb, 21 files, ©MIT)
│   │ │ ╰── [email protected] (🔗, 1 dep, 48.12kb, 11 files, ©MIT)
│   │ ╰─┬ [email protected] (1 dep, 48.12kb, 11 files, ©MIT)
│   │   ╰── [email protected] (6.68kb, 4 files, ©MIT)
│   ├─┬ [email protected] (5 deps, 155.4kb, 43 files, ©MIT)
│   │ ├─┬ [email protected] (2 deps, 81.89kb, 21 files, ©MIT)
│   │ │ ╰── [email protected] (🔗, 1 dep, 48.12kb, 11 files, ©MIT)
│   │ ╰─┬ [email protected] (1 dep, 48.12kb, 11 files, ©MIT)
│   │   ╰── [email protected] (6.68kb, 4 files, ©MIT)
│   ├── [email protected] (3.83kb, 4 files, ©MIT)
│   ├── [email protected] (78.8kb, 7 files, ©MIT)
│   ├─┬ [email protected] (1 dep, 1.06mb, 132 files, ©MIT)
│   │ ╰── [email protected] (403.21kb, 68 files, ©BSD-2-Clause)
│   ├─┬ [email protected] (1 dep, 217.51kb, 23 files, ©ISC)
│   │ ╰── [email protected] (57.58kb, 18 files, ©MIT)
│   ├── [email protected] (55.74kb, 7 files, ©MIT)
│   ├─┬ [email protected] (6 deps, 673.84kb, 48 files, ©BSD-3-Clause)
│   │ ├── [email protected] (450.63kb, 9 files, ©MIT)
│   │ ├── [email protected] (32.73kb, 5 files, ©MIT)
│   │ ├── [email protected] (4.67kb, 4 files, ©MIT)
│   │ ╰─┬ [email protected] (2 deps, 76.64kb, 18 files, ©MIT)
│   │   ├── [email protected] (6.8kb, 4 files, ©MIT)
│   │   ╰── [email protected] (8.36kb, 7 files, ©MIT)
│   ├─┬ [email protected] (1 dep, 30.79kb, 10 files, ©MIT)
│   │ ╰── [email protected] (🔗, 13.23kb, 4 files, ©Apache-2.0)
│   ├── [email protected] (23.67kb, 4 files, ©BSD-2-Clause)
│   ├─┬ [email protected] (2 deps, 394.2kb, 46 files, ©MIT)
│   │ ╰─┬ [email protected] (1 dep, 381.66kb, 40 files, ©MIT)
│   │   ╰── [email protected] (41.31kb, 7 files, ©MIT)
│   ├── [email protected] (16.42kb, 8 files, ©MIT)
│   ├─┬ [email protected] (3 deps, 359.1kb, 33 files, ©MIT)
│   │ ├─┬ [email protected] (1 dep, 242.95kb, 12 files, ©MIT)
│   │ │ ╰── [email protected] (🔗, 32.73kb, 5 files, ©MIT)
│   │ ╰── [email protected] (🔗, 23.67kb, 4 files, ©BSD-2-Clause)
│   ├── [email protected] (143.21kb, 19 files, ©MIT)
│   ╰── [email protected] (13.23kb, 4 files, ©Apache-2.0)
├── [email protected] (1.35mb, 1054 files, ©MIT)
╰─┬ [email protected] (33 deps, 3.8mb, 531 files, ©MIT)
  ├─┬ [email protected] (1 dep, 63.26kb, 42 files, ©MIT)
  │ ╰── [email protected] (🔗, 16.56kb, 18 files, ©MIT)
  ├── [email protected] (16.56kb, 18 files, ©MIT)
  ├─┬ [email protected] (25 deps, 2.97mb, 304 files, ©MIT)
  │ ├── @jest/[email protected] (🔗, 15 deps, 2.7mb, 220 files, ©MIT)
  │ ├── @types/[email protected] (🔗, 1 dep, 2.06mb, 100 files, ©MIT)
  │ ├─┬ [email protected] (5 deps, 95.08kb, 33 files, ©MIT)
  │ │ ├─┬ [email protected] (2 deps, 49.67kb, 16 files, ©MIT)
  │ │ │ ╰─┬ [email protected] (1 dep, 33.09kb, 11 files, ©MIT)
  │ │ │   ╰── [email protected] (6.54kb, 4 files, ©MIT)
  │ │ ╰─┬ [email protected] (1 dep, 11.19kb, 10 files, ©MIT)
  │ │   ╰── [email protected] (4.32kb, 5 files, ©MIT)
  │ ├── [email protected] (25.45kb, 7 files, ©MIT)
  │ ├── [email protected] (31.77kb, 7 files, ©ISC)
  │ ╰── [email protected] (87.84kb, 10 files, ©MIT)
  ├── [email protected] (229.69kb, 20 files, ©MIT)
  ├── [email protected] (19.65kb, 4 files, ©MIT)
  ├── [email protected] (12.14kb, 6 files, ©ISC)
  ├── [email protected] (93.19kb, 52 files, ©ISC)
  ╰── [email protected] (125.46kb, 11 files, ©ISC)

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

No branches or pull requests

2 participants