Skip to content
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

Registration: Server registration is not validated on client #6702

Open
schlessera opened this issue May 11, 2018 · 1 comment
Open

Registration: Server registration is not validated on client #6702

schlessera opened this issue May 11, 2018 · 1 comment
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.

Comments

@schlessera
Copy link
Member

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.

@schlessera schlessera added the [Feature] Block API API that allows to express the block paradigm. label May 11, 2018
@danielbachhuber danielbachhuber added the [Type] Enhancement A suggestion for improvement. label May 11, 2018
@nerrad nerrad added the Good First Issue An issue that's suitable for someone looking to contribute for the first time label Apr 15, 2019
@gziolo gziolo added the Needs Dev Ready for, and needs developer efforts label Oct 21, 2019
@draganescu
Copy link
Contributor

I second this idea, it is a very confusing experience when there is no indication that something is missing yet registration doesn't work. Just a console warning would do wonders. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

No branches or pull requests

5 participants