-
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
PaletteEdit
: refactor away from lodash.kebabCase
#48637
Conversation
Size Change: +413 B (0%) Total Size: 1.34 MB
ℹ️ View Unchanged
|
Flaky tests detected in e32d9ad. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4304365943
|
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.
Looks good 👍
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.
We should be careful for the differences between paramCase()
and kebabCase()
(there are some regex differences), but in this case it's safe. Tests well too.
Thanks 🚀
Just to clarify, here's an example of such a difference:
Seems like it should be fine in this instance here, but let's make sure to consider it. |
e32d9ad
to
2684460
Compare
What?
This PR removes Lodash's
_.kebabCase()
from thePaletteEdit
componentWhy?
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?
Replaces
_.kebabCase
withparamCase
from thechange-case
package (already used in the components package).Testing Instructions
<PaletteEditListView />
, inspect theelements
prop and verify theslug
attribute looks as expected (param-cased depending on what name you chose).