-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Initial documentation of entity configuration #55103
Conversation
Pinging some folks that have worked with the |
packages/core-data/README.md
Outdated
@@ -40,6 +40,60 @@ function MyAuthorsListBase() { | |||
} | |||
``` | |||
|
|||
## What's an entity? | |||
|
|||
An entity represents a WordPress REST API endpoint. Each item within the entity is called entity record. Available entities are defined in `rootEntitiesConfig` at ./src/entities.js. |
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.
For me REST API is just an implementation detail and my ultimate Goal has always been to decouple from the WordPress REST API using an adapter layer, so in that sense, I'm not a big fan for tieing a definition of an entity to the backend.
I'd define an entity as a type of "model/data" or something like that that the data layer provides to the consumers. Granted that the current definition is tied to the REST API though but this is consequential to me.
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.
Pushed an update that tones down the WordPress REST API in favor of a more general approach.
Flaky tests detected in ae108b4. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6433339008
|
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.
It's great seeing all the new documentation lately, nice work 👍
I'd define an entity as a type of "model/data" or something like that that the data layer provides to the consumers
FWIW this aligns with what I sort of expected for the entity definition.
Other than that, there were a few minor nits and typos I've left as inline suggestions. Hope that helps 🙂
Co-authored-by: Aaron Robertshaw <[email protected]>
Co-authored-by: Aaron Robertshaw <[email protected]>
Co-authored-by: Aaron Robertshaw <[email protected]>
Co-authored-by: Aaron Robertshaw <[email protected]>
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.
👍
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.
I think these are some very useful docs 👍 Couldn't find anything beyond a minor grammar fix.
Thanks @oandregal 🚀
Co-authored-by: Marin Atanasov <[email protected]>
Part of #55153
What?
This PR aims to create some initial docs explaining what is an entity and what it needs in terms of configuration.
Why?
It's a crucial part of Gutenberg. Having some introductory high level documentation would help folks to navigate this part of our codebase.
How?
Adds a new section in the
README.md
of thecore-data
package.See
Read the section "What's an entity".