Restrict private Block.json and Theme.json APIs usage to Gutenberg plugin #47741
Labels
Developer Experience
Ideas about improving block and theme developer experience
[Feature] Block API
API that allows to express the block paradigm.
Global Styles
Anything related to the broader Global Styles efforts, including Styles Engine and theme.json
[Type] Experimental
Experimental feature or API.
Description
Now that the usage of private selectors, actions, components, functions, and other exports can be restricted to the Gutenberg plugin, it's time to also make it possible for
block.json
andtheme.json
APIs.This issue is a part of Developer Experience: There's ~280 __experimental APIs. Let's stabilize them!.
Block.json
At the moment, the private
block.json
APIs can be restricted to core blocks by manually checking the block type. For example, here's how that would look like forsupports.__experimentalMetadata
:It would be convenient to automate this process and apply it to all
__experimental
block.json entries. Here's an idea: preprocess all theblock.json
metadata and remove the__experimental
keys from all non-core blocks. This wouldn't apply to the__experimental
entries that have already become a public API. Technically speaking, I'm thinking of recursive filtering based on the block type prefix and an allowlist of public experimental APIs.Theme.json
I don't understand the meaning of restricting the experimental theme.json API to the Gutenberg plugin. Would it be based on a list of core themes? Theme.json files have a hierarchy – what if a third-party theme inherits experimental settings from a theme.json file related to WordPress core? CC @scruffian @mtias @draganescu @youknowriad
CC @gziolo @dmsnell @jsnajdr @ciampo @noisysocks @talldan @ntsekouras @andrewserong
The text was updated successfully, but these errors were encountered: