-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 _.omit()
usage from components
#43474
Conversation
Size Change: -23 B (0%) Total Size: 1.24 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't actually loaded the code up in my IDE but doesn't this method create linting warnings since we are creating a bunch of variables that never get used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you @tyxla! 👍
Left some minor comments.
3fe1518
to
68acc9a
Compare
Thank you for the feedback, both 🙌 |
What?
This PR removes the
_.omit()
usage from the@wordpress/components
package.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:
@wordpress/api-fetch
package haslodash
as a dependency #39495How?
_.omit()
is easily replaceable by destructuring with...rest
parameters.Testing Instructions
NavigableContainer
Notice
Snackbar
UnitControl
BottomSheet