Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Move
usePostFields
towordpress/editor
package #67024Move
usePostFields
towordpress/editor
package #67024Changes from 1 commit
e406199
81726b3
d049eee
1b76327
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
This file was deleted.
This file was deleted.
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.
Instead of keeping the list of fields here, should we transform this to a "registration API" like actions and start opening the API in Gutenberg? Separate thing obviously, but just want to start this discussion.
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.
This is actually a relevant question for this PR:
usePostActions
is defined in the editor package; but I'm operating under the assumption that we want both to live inwordpress/fields
at some point, that's why I'm moving it here. Is that your thinking as well?After that, yeah, field registration would be nice. Probably private to Gutenberg for now?
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.
yeah
usePostActions
or more precisely for megetEntityActions
selector lives in the editor package, mostly because creating new stores is not an easy task and also shouldn't be done at all for bundled packages. So temporarily, the store lives in the editor package. I think we should ultimately do the same for fields.And when we decide to make things more public (make the fields package non bundled), we should probably move the store to the fields package.
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.
ok, so this means that, for now, we should move
usePostFields
to theeditor
package in preparation for adding extensibility. Later, when fields is public will move both to this package.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.
That's a good plan. Do you think we should also add the
postType
as param here or in a follow up?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.
Moved to
editor
at 1b76327It's best to do it when we add support for other post types.
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.
#67175 to pull the fields from the registry