Skip to content
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

Replace lodash-es with es-toolkit/compat #17872

Merged
merged 4 commits into from
Feb 4, 2025
Merged

Conversation

filipsobol
Copy link
Member

@filipsobol filipsobol commented Feb 3, 2025

Suggested merge commit message (convention)

Other: Replace lodash-es with es-toolkit. See #16395.


You can find more information about why we made this change here: #16395 (comment)

@@ -176,7 +176,7 @@ describe( 'ImageStyleEditing', () => {
plugins: [ ImageBlockEditing, ImageStyleEditing ]
} );

sinon.assert.calledOnceWithMatch( normalizationSpy, {
expect( normalizationSpy.firstCall.args[ 0 ] ).to.deep.equal( {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is related to toss/es-toolkit#953 because sinon internally tries to use toString which is not available. IMO, current es-toolkit behavior makes more sense than in lodash-es.

@@ -308,7 +307,7 @@ export default class ImageResizeButtons extends Plugin {
} )
};

const allDropdownValues = map( optionsWithSerializedValues, 'valueWithUnits' );
const allDropdownValues = Object.values( optionsWithSerializedValues ).map( option => option.valueWithUnits );
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the same, so let's just use native APIs.

arkflpc
arkflpc previously approved these changes Feb 3, 2025
@filipsobol filipsobol merged commit a08312a into master-it84 Feb 4, 2025
8 checks passed
@filipsobol filipsobol deleted the replace-lodash branch February 4, 2025 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants