-
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 _.mapValues()
from edit-site
#49639
Conversation
Size Change: -6 B (0%) Total Size: 1.37 MB
ℹ️ View Unchanged
|
Flaky tests detected in 6f68c93. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4630058292
|
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.
Thank you @tyxla, the code looks good 👍
What?
This PR removes Lodash's
_.mapValues()
from theedit-site
package.Changes are similar to the ones in #49637 and #49638 since it has the same utility for deep cleaning objects.
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?
We're using
Object.fromEntries( Object.entries().map() )
as a replacement.Maybe it could be a good follow-up to unify the
cleanEmptyObject
utility.Testing Instructions