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

Blocks: Add a warning for developers if they use reserved words for attributes #48112

Open
ryelle opened this issue Feb 15, 2023 · 1 comment
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

Comments

@ryelle
Copy link
Contributor

ryelle commented Feb 15, 2023

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 custom style 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?

@ryelle ryelle added the Developer Experience Ideas about improving block and theme developer experience label Feb 15, 2023
@gziolo gziolo added [Feature] Block API API that allows to express the block paradigm. Needs Dev Ready for, and needs developer efforts labels Feb 16, 2023
@gziolo gziolo mentioned this issue Feb 16, 2023
58 tasks
@gziolo gziolo changed the title Add a warning for block developers if they use reserved words for attributes Blocks: Add a warning for developers if they use reserved words for attributes Feb 16, 2023
@gziolo gziolo added [Type] Code Quality Issues or PRs that relate to code quality [Type] Bug An existing feature does not function as intended and removed [Type] Code Quality Issues or PRs that relate to code quality labels Feb 26, 2023
@margolisj
Copy link
Contributor

Is there a list somewhere of reserved attribute keys?

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

No branches or pull requests

3 participants