RichText: Mark onSetup, getSettings as unstable APIs #9106
Merged
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.
This pull request seeks to deprecate the following two props of
RichText
, while still making them available as intentionally-flagged "unstable" equivalent props:getSettings
unstableGetSettings
onSetup
unstableOnSetup
These changes follow a similar pattern to that of #7029 (
unstableOnFocus
), where the intent is to discourage use of these props, which are already undocumented. Their existence is undesirable, but necessary in current implementations of core blocks. Until the core blocks can be refactored to avoid them, they are marked as unstable to discourage other developers from considering adoption.These props are considered undesirable because they pierce the abstraction RichText is intended to serve atop TinyMCE. Respectively they are intended to allow a consumer to override TinyMCE settings or to receive the initialized TinyMCE instance.
Testing instructions:
Verify that there are no regressions in the behavior of the List and Table blocks.
Then revert a9a6792 in your local copy of the branch to reintroduce the deprecated prop usage. Verify that the blocks still operate as expected, but log a deprecated warning in the process.