Document BlockControls component as preferred controls rendering #1172
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.
Related: #468, #830, #1019
This pull request seeks to update blocks documentation, removing references to
controlsandwp.blocks.registerControl, the latter of which was never implemented. In their place is new documentation for theBlockControlscomponent, which can be returned in theeditrendered result to populate a block's toolbars. See #830 for real-world example usage.View documentation
Open questions:
How should we approach ES2015+/JSX vs. ES5 in documentation? Thus far the majority of documentation has been written as ES5 style, with assumption that ES2015 will not be a prerequisite for registering blocks. An exception to this is that an external link is included to an equivalent ES2015+/JSX implementation of the example block, but this has been difficult to maintain especially as changes have been made to the original code snippet. GitHub Markdown files support the
<details>element, which could be useful for collapsible equivalent implementations. As we move toward integrating documentation into the WordPress developer site, it might be nice to consider tabbable previews like PouchDB Callbacks/Promises/Async functions demonstrations or Stripe language demonstrations.Testing instructions:
There are only documentation changes included in this pull request.