-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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()
from @wordpress/blocks
#43711
Conversation
Size Change: -124 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.
LGTM, good work! 👍
I'm not entirely sure about perpetuating the excessively terse lodash function naming (omit
doesn't really say much; omitKeys
would be better), but that's a matter of personal preference. At least it's not as silly as deburr
😄
Thanks for the feedback, @sgomes!
I see where you're coming from. I initially thought about renaming it specifically to |
What?
This PR removes most of the remaining
_.omit()
usage from the@wordpress/blocks
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 in most cases. For the rest where we have a dynamic list of keys to omit, we already had a helper in one of the test files, we just moved it toutils
and utilized it.Testing Instructions