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

Lodash: Remove from FormTokenField component #43744

Merged
merged 2 commits into from Sep 1, 2022

Conversation

tyxla
Copy link
Member

@tyxla tyxla commented Aug 31, 2022

What?

This PR removes all Lodash usage from the <FormTokenField /> component.

Why?

Lodash is known to unnecessarily inflate the bundle size of packages, and in most cases, it can be replaced with native language functionality. See these for more information and rationale:

How?

All usages are straightforwardly replaced with native Array prototype functionality.

Testing Instructions

  • Verify tests still pass: npm run test:unit packages/components/src/form-token-field
  • Smoke test the FormTokenField component in Storybook.

@tyxla tyxla added [Type] Performance Related to performance efforts [Type] Code Quality Issues or PRs that relate to code quality [Package] Components /packages/components labels Aug 31, 2022
@tyxla tyxla self-assigned this Aug 31, 2022
@tyxla tyxla requested a review from ajitbohra as a code owner August 31, 2022 12:25
Copy link
Member

@mirka mirka left a comment

Choose a reason for hiding this comment

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

Looks good 🚀

Copy link
Contributor

@sgomes sgomes left a comment

Choose a reason for hiding this comment

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

LGTM as well! 👍

@tyxla tyxla force-pushed the remove/lodash-form-token-field branch from 54f4f2b to 77a6a50 Compare September 1, 2022 09:09
@tyxla tyxla merged commit ef8264a into trunk Sep 1, 2022
@tyxla tyxla deleted the remove/lodash-form-token-field branch September 1, 2022 10:21
@github-actions github-actions bot added this to the Gutenberg 14.1 milestone Sep 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components [Type] Code Quality Issues or PRs that relate to code quality [Type] Performance Related to performance efforts
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants