Skip to content

Remove lodash dependency from '@wordpress/element' #16938

@nerrad

Description

@nerrad

Is your feature request related to a problem? Please describe.

One of the challenges for projects that want to use various WordPress packages on the frontend is keeping js bundles small. While lodash itself is small in size, the fact that wp.element depends on it means that any code wanting to enqueue wp.element on the frontend is also going to load lodash.

Since there are many native implementations for lodash features that can be used reliably (and in some cases are faster than lodash), I think it'd be good to remove this package's dependency on lodash and replace with native implementation.

Describe the solution you'd like

Replace lodash dependency in @wordpress/element by reimplementing any lodash features as native js.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions