-
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
data: set up auto-generated API docs #14277
Conversation
0ca167f
to
7ce0e70
Compare
I wouldn't consider it as a |
|
||
[src/index.js#L14-L14](src/index.js#L14-L14) | ||
|
||
Undocumented declaration. |
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 needs documenting. To be added as a JSDoc comment in the component.
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 needs documenting. To be added as a JSDoc comment in the component.
Are you considering this a blocker? Do you need help with it?
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.
Not a blocker from my point of view. It was undocumented and will stay that way after all.
I feel this is ready and is a good addition, but would like feedback on 1) did I miss something? 2) does the general approach works well for this package or are things we should improve?
|
||
[src/index.js#L14-L14](src/index.js#L14-L14) | ||
|
||
Undocumented declaration. |
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 needs documenting. To be added as a JSDoc comment in the component.
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'm a bit more sensitive to this document than most other modules, since it's a key integration point for a majority of plugins. That said, I think while there's some general reorganization, it appears most of the examples are retained. Generally we might want to push toward more tutorials as part of the handbook, anyways.
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'm a bit concerned about the arbitrary order of the documentation, but being that it's automated I understand it somewhat. It'd be nice if the api can be grouped a bit more. For example, general api functions that are used more frequently are registerStore
, dispatch
, select
, subscribe
, withSelect
and withDispatch
. Then the others tend to be for more advanced usage. With automation, could grouping be controlled a bit via special tags (i.e. @docs:advanced
)?
afd9249
to
0bff374
Compare
@aduth @nerrad Please, feel welcome to commit your suggestions to reorganization directly to this branch. I'm not familiar with this package as you are, so I'll need a little guidance. Regarding grouping - for context, see related discussion. TLDR is:
|
@nerrad I wanted to address this separately because that's a great question. We currently have a very raw mechanism for grouping: we can update different parts of the README leveraging the I don't think that's enough. I welcome new ideas and look forward to adding support for them! Some that I've already listed are: #14333, #14332 and #14292 Note that these are generic and decoupled from a specific output. I'd want us to avoid adding metadata that is tied to a specific output (for example: adding metadata about which section in the README a symbol should be embedded, etc.). |
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 say let's get this merged and then iterate. Documentation is something that can be improved on over time. I think there may be some benefit to getting this merged now being that there's some churn happening in wp.data that would be advantageous to get documented where possible.
Related to #14227
This PR sets up auto-generated API docs for the
data
package through thenpm run docs:build
command and updates its README file.Test instructions
packages/data/README.md
within the start<!-- START TOKEN(Autogenerated API docs) -->
and end<!-- END TOKEN(Autogenerated API docs) -->
tokens.npm run docs:build
and verify they are re-created.