-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Lodash: Simplify a few isEmpty calls
#45525
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
Conversation
|
|
|
Size Change: 0 B Total Size: 1.28 MB ℹ️ View Unchanged
|
|
Hey team, could anyone take a look? I was left with the impression these are pretty straightforward to review. |
|
Hey there 👋 I have it on my list to review it today! Sorry for the delay 😅 |
|
Ah, thanks a ton in advance @geriux 🙌 |
geriux
left a comment
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! I tested this on an iPhone 14 Pro with VoiceOver. 🚀
What?
This PR removes a few
_.isEmpty()in favor of simpler checks.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-fetchpackage haslodashas a dependency #39495How?
We're replacing a few usages with a simple native
! stringcheck when we're dealing with strings. The good thing about that new way is that it will catchundefinedandnullas well, so it's a pretty safe change.Testing Instructions
On native: