-
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 _.merge()
from getMappedColumnWidths()
#48032
Conversation
Size Change: -5 B (0%) Total Size: 1.33 MB
ℹ️ View Unchanged
|
Flaky tests detected in f8a5f9a. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4165094302
|
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!
What?
This PR removes Lodash's
_.merge()
from thegetMappedColumnWidths()
helper function of theColumns
block. There is just a single use in that function and conversion is pretty straightforward.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 replacing
_.merge()
with a straightforward object spread. There's no good reason to use such a complex merging function. We're also adding some new unit tests to ensure that the original behavior continues to work well.Testing Instructions