-
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
Block library: Standardize file structure of core blocks #14743
Conversation
c225b78
to
6546a64
Compare
|
||
return ( | ||
<RichText | ||
identifier="values" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sometimes we seem to set these as constants, other times not. Would it be good to standardise this too? Personally, I feel like the constants are good, but a separate file for it a bit too much.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we should both ensure they are provided and figure out what's the best way to encode them. We can't use constants inside block.json
files but maybe it would be possible to create ESLint rule which would ensure that identifiers use the existing attribute's name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Personally I think the contants file is a bit too much, especially if we will have them for all blocks.
As it turns out in #14770, I figured out that constants don't play well with |
Description
This is trying to bring the structure of core blocks closer to what is proposed in block registration RFC #13693. In particular, it ensures that:
edit
methods are moved to their own fileExtracting SVG icons is going to be a good step towards exploring how #14628 could be achieved as all SVG based icons would be located in their own files making it easier to reason how to convert them to the current form from the commonly known file format.
Testing
Ensure all block icons in the inserter display as before for core blocks.
Follow-up task
save
methods as well.transforms
ormerge
.