Experiment: Content types reuse some commone utils#78091
Conversation
|
Size Change: -321 B (0%) Total Size: 7.92 MB 📦 View Changed
ℹ️ View Unchanged
|
tyxla
left a comment
There was a problem hiding this comment.
This is looking good to me. Tests well too.
I actually like how some of the consolidation already solved some of the inconsistencies we had (checkboxes => toggles for example).
Suggested a few things to potentially address, but nothing blocking.
🚀
| pluralLabelField, | ||
| singularLabelField, | ||
| slugField, | ||
| ] as Field< PostTypeFormData >[], |
There was a problem hiding this comment.
Why the casting when we could use the generic useMemo type above?
There was a problem hiding this comment.
There are nuances due to the Field<ContentType> fields we share and DataForms. Similar case is the media-utils fields (Field< RestAttachment >). I'll keep it for now but will look closer if we can handle this differently.
| hideLabelFromVision, | ||
| markWhenOptional, | ||
| validity, | ||
| }: DataFormControlProps< any > ) { |
There was a problem hiding this comment.
Would have been nice to limit any to ContentType
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Flaky tests detected in 2c8849e. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/25554159025
|
What?
Since #78059 we have a single package for content types.
This part adds some shared utils between the two. There are more to consolidate, but let's iterate.