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

Remove lodash as a dependency #1507

Merged
merged 18 commits into from
Apr 5, 2022
Merged

Remove lodash as a dependency #1507

merged 18 commits into from
Apr 5, 2022

Conversation

connor-baer
Copy link
Member

@connor-baer connor-baer commented Apr 5, 2022

Purpose

Lodash is one of Circuit UI's larger dependencies. It doesn't support treeshaking out of the box1 and is included in some of the basic building blocks of Circuit UI, so most components bear its performance cost.

Lodash makes up 8.5% of Circuit UI's bundle size

Since we will drop support for legacy browsers in Circuit UI v5, we're now able to replace Lodash with native browser APIs and a small set of utility functions.

Approach and changes

  • Replace Lodash with native browser APIs and a small set of utility functions

Definition of done

  • Development completed
  • Reviewers assigned
  • Unit and integration tests
  • Meets minimum browser support
  • Meets accessibility requirements

Footnotes

  1. Requires the use of babel-plugin-lodash.

@changeset-bot
Copy link

changeset-bot bot commented Apr 5, 2022

🦋 Changeset detected

Latest commit: aedee23

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sumup/circuit-ui Minor

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

@vercel
Copy link

vercel bot commented Apr 5, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/sumup/oss-circuit-ui/8unshgBaCdYvPVefN2CFpweLibuB
✅ Preview: https://oss-circuit-ui-git-feature-drop-lodash.sumup-vercel.app

@codecov
Copy link

codecov bot commented Apr 5, 2022

Codecov Report

Merging #1507 (aedee23) into canary (e775311) will increase coverage by 0.15%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           canary    #1507      +/-   ##
==========================================
+ Coverage   92.42%   92.57%   +0.15%     
==========================================
  Files         202      201       -1     
  Lines        4210     4216       +6     
  Branches     1353     1353              
==========================================
+ Hits         3891     3903      +12     
+ Misses        299      293       -6     
  Partials       20       20              
Impacted Files Coverage Δ
...nents/Sidebar/components/Aggregator/Aggregator.tsx 94.28% <ø> (ø)
packages/circuit-ui/components/Table/Table.tsx 89.24% <ø> (ø)
...ckages/circuit-ui/components/TextArea/TextArea.tsx 100.00% <ø> (ø)
...cuit-ui/cli/migrate/component-static-properties.ts 100.00% <100.00%> (ø)
packages/circuit-ui/components/Grid/utils.ts 100.00% <100.00%> (ø)
...cuit-ui/components/ListItemGroup/ListItemGroup.tsx 95.45% <100.00%> (ø)
...cuit-ui/components/SelectorGroup/SelectorGroup.tsx 84.61% <100.00%> (ø)
...components/DesktopNavigation/DesktopNavigation.tsx 100.00% <100.00%> (ø)
...s/circuit-ui/components/Sidebar/SidebarService.tsx 96.66% <100.00%> (+0.11%) ⬆️
packages/circuit-ui/components/Tabs/Tabs.js 87.50% <100.00%> (ø)
... and 5 more

@connor-baer connor-baer force-pushed the feature/drop-lodash branch from 43402e9 to 52ec86b Compare April 5, 2022 13:58
@connor-baer connor-baer marked this pull request as ready for review April 5, 2022 14:09
@connor-baer connor-baer requested a review from a team as a code owner April 5, 2022 14:09
@connor-baer connor-baer requested review from robinmetral and removed request for a team April 5, 2022 14:09
@connor-baer connor-baer changed the title Remove dependency on lodash Remove lodash as a dependency Apr 5, 2022
Copy link
Contributor

@robinmetral robinmetral left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing! Thanks a lot for tackling this 🪶 Nice to see that we already had most of the helper functions we needed, too! Just left a few thoughts

@connor-baer
Copy link
Member Author

Nice to see that we already had most of the helper functions we needed, too!

That's because I've been working towards this for a while, even before #1504 and #1505 😏

@connor-baer connor-baer requested a review from robinmetral April 5, 2022 17:50
@connor-baer connor-baer enabled auto-merge (squash) April 5, 2022 17:54
@connor-baer connor-baer merged commit c194250 into canary Apr 5, 2022
@connor-baer connor-baer deleted the feature/drop-lodash branch April 5, 2022 17:58
@connor-baer
Copy link
Member Author

Whoops, I thought auto-merge would wait for your review. Sorry, @robinmetral!

@robinmetral
Copy link
Contributor

😄 no worries, this looks great! 🎉

This was referenced May 4, 2022
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.

2 participants