-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Fix small uppercase/lowercase inconsistency in create block template #39853
Fix small uppercase/lowercase inconsistency in create block template #39853
Conversation
It's a recurring issue. If we agree to apply the changes proposed we should also update the Create a Block Tutorial and other templates used when scaffoling blocks: |
Oh, I see your point 🙂 But I'm not sure if people will infer that they cannot use hooks from the fact that it's lowercase instead of uppercase. I think people see JSX and they assume it is a proper component.
Could you please explain to me what is the technical problem with hooks? Why are the |
Yes, it always has been confusing and this issue existed from the very beginning of the project.
I explained it in this comment #38139 (comment). The gist of it is that Regarding React hooks, the implementation was never added to the custom serializer. @nerrad started looking into that in #15873, but it didn't seem like a very pressing issue back then since the initial; idea was to make those hooks ignored anyway. |
Thanks, @gziolo. I understand that Gutenberg is using a custom renderer, but I'd like to understand why it needs it, and why the save components are different than regular server-side-rendered React components, especially if we want to start sharing code between the save and the frontend components. But this is probably not the place to talk about it. |
I wanted to emphasize that it's 3rd or even 4th attempt to unify the casing for those two names from folks working closely with blocks. It's a clear sign that we need to finally do something about it because it is simply too confusing for everyone. I would appreciate some help here from @ryanwelcher, @juanmaguitar, and @mburridge who to my knowledge are actively looking into ways to improve the block development experience. |
What?
Fix a small inconsistency with uppercase/lowercase of Edit and Save components in the create-block template.
Why?
It felt a bit weird to use lowercase for
save
and uppercase forEdit
. Maybe people can think that it is necessary for some reason.How?
I've renamed
save
toSave
to follow React's standard, but it could be done the other way around (Edit
toedit
).