Registration: Server registration is not validated on client #6702
Labels
[Feature] Block API
API that allows to express the block paradigm.
Good First Issue
An issue that's suitable for someone looking to contribute for the first time
Needs Dev
Ready for, and needs developer efforts
[Type] Enhancement
A suggestion for improvement.
While experimenting with the server-side registry of custom blocks, I ran into a problem where my block was supposedly being registered correctly on the server-side, but it did not appear in the block picker in the client-side.
In the end, I figured out that I had used the properties to enqueue scripts/styles through the server registration in the wrong way: I had used a dash instead of an underscore in the properties, i.e.
'editor-script'
instead of'editor_script'
.However, I would have expected Gutenberg to show some kind of warning (at least in the console) when I register something on the server-side and it ends up not creating anything on the client-side. I cannot think of a use case where you would want to register something on the server only to not have it exist on the client.
This is why I'd like to suggest adding a check in JS-land that gives some kind of feedback to developers when server-registered blocks are missing on the client.
The text was updated successfully, but these errors were encountered: