Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Parsing: Enforce block naming requirements consistently #3521
Conversation
aduth
added
the
[Component] Parsing
label
Nov 16, 2017
aduth
requested a review
from
dmsnell
Nov 16, 2017
codecov
bot
commented
Nov 16, 2017
•
Codecov Report
@@ Coverage Diff @@
## master #3521 +/- ##
==========================================
+ Coverage 34.54% 35.62% +1.08%
==========================================
Files 261 262 +1
Lines 6710 6896 +186
Branches 1225 1286 +61
==========================================
+ Hits 2318 2457 +139
- Misses 3704 3738 +34
- Partials 688 701 +13
Continue to review full report at Codecov.
|
| -ASCII_AlphaNumeric | ||
| - = ASCII_Letter | ||
| +ASCII_LowercaseAlphaNumeric | ||
| + = ASCII_LowercaseLetter |
dmsnell
Nov 16, 2017
•
Collaborator
this seems a bit verbose. what if instead we ripped out the whole ASCII nomenclature and just simplified down to something like Block_Name or Block_Name_Part - we're not using the other rules so we can get rid of them
Namespaced_Block_Name
= $( Block_Name_Part "/" Block_Name_Part )
Core_Block_Name
= type:Block_Name_Part { return 'core/' + type }
Block_Name_Part
= $([a-z] [a-z0-9_-]*)
aduth
Nov 17, 2017
Member
this seems a bit verbose. what if instead we ripped out the whole
ASCIInomenclature and just simplified down to something likeBlock_NameorBlock_Name_Part
Sounds good to me. Applied in df43eb4.
aduth commentedNov 16, 2017
This pull request seeks to resolve inconsistencies between block registration validation and name parsing expectations. Specifically:
Further, these requirements were not documented in block registration documentation.
The proposed changes remedies each of the above issues.
Testing instructions:
Ensure tests pass:
Follow-up Tasks:
Gutenberg examples have names beginning with numbers and must be updated:
https://github.com/WordPress/gutenberg-examples