Blocks: Add a warning for developers if they use reserved words for attributes #48112
Labels
Developer Experience
Ideas about improving block and theme developer experience
[Feature] Block API
API that allows to express the block paradigm.
Needs Dev
Ready for, and needs developer efforts
[Type] Bug
An existing feature does not function as intended
Part of #41236.
I have a block that has an attribute called
style
(a string), and it's worked fine. Recently I wanted to add color & border support to it, and when I did, it broke the validation for my customstyle
attribute. I imagine because it's trying to use that value for the block support styles, which converted it from string to object. It took me a bit of debugging before I realized what was going on.It would be nice if there was a warning for developers if a reserved word (ex
layout
,style
) is used as an attribute name. Maybe show a console notice if we're in debug mode?The text was updated successfully, but these errors were encountered: