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

Element: Add isEmptyElement utility function #9681

Merged
merged 2 commits into from
Sep 12, 2018
Merged

Conversation

gziolo
Copy link
Member

@gziolo gziolo commented Sep 7, 2018

Description

This PR exposed new isEmptyElement utility helper function in @wordpress/element packaged based on the suggestion from @aduth #9371 (comment):

In that case I'd rather just flag it as experimental.

My main issue is that, as far as anything in components is concerned, there should be zero awareness of what value an element holds. There is no commitment guaranteed by @wordpress/element that this shape is to remain, and will be hard to account for if ever changed. And we'd do well to avoid future headaches of plugin authors who follow similar practices to see how to accommodate this need by "solving" it internally for our own usage (as otherwise, they'll follow the same pattern and similarly face breakage whenever element structure changes).

I exposed it as stable API because it is used by @wordpress/components so I'm not quite sure if it really should be experimental.

How has this been tested?

npm test

@gziolo gziolo added the [Package] Element /packages/element label Sep 7, 2018
@gziolo gziolo added this to the 3.9 milestone Sep 7, 2018
@gziolo gziolo self-assigned this Sep 7, 2018
@gziolo gziolo requested review from aduth and a team September 7, 2018 08:48
Copy link
Member

@tofumatt tofumatt left a comment

Choose a reason for hiding this comment

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

Makes sense to me; if we're using it for Slot it's not really experimental 😄

@aduth aduth merged commit 7af6f28 into master Sep 12, 2018
@aduth aduth deleted the add/is-empty-element branch September 12, 2018 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Element /packages/element
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants