-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Error: The block "xxx" can have a maximum of 3 keywords. #11949
Comments
A silent fail would be nice for prod build, and when using dev build to provide the console warn or error. Dev feedback should be more prominent |
Hi @timelsass. Can you clarify on what you mean by "silent fail"?
|
I agree with this.
The warning could be helpful, but we could only show it in dev mode. |
PR submitted 🤞 |
@elliotcondon my bad I meant suppressing the error instead in production build - as it would still be a useful warning for people who are developing and registering blocks. @jameelmoses should this now become console.warn since input is being accepted a modified instead of console.error? |
@timelsass yeah probably. just wasn’t sure if i was allowed to change linting rules, but seems fine if console.error is being disabled |
changed to |
Related discussion: #6633. |
We should just abolish this 3-keyword limit. I haven't seen anyone provide any compelling reason for why it exist, and it's certainly caused more friction than value it's provided. |
Afore-mentioned pull request: #11953 |
@aduth is this something you want me to tackle? or you guys want to handle internally? im not sure if there's a series of changes that require more thought and strategy, or if it's just in this section of code. |
I'm not personally aware of any ongoing effort here, so feel free to take it on.
I think it's relatively well-contained here, but I'm happy to do some more digging if you ping me for a review on a related pull request. |
@aduth updated my PR to remove the restriction entirely |
Landed #13848 which removes this limit altogether. |
Good work @gziolo |
What am I, chopped liver @elliotcondon? ¯_(ツ)_/¯ Jk ❤️ |
@jameelmoses Haha, sorry mate. Just looked closer at the PR. Thank you sir. |
Describe the bug
When registering a block type with more than 3 keywords, the following JS error is logged and the block type is not registered:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The current behavior is too extreme.
The block type should be registered as normal, and WP should use the first 3 keywords ignoring any others if provided. There is also no need for a JS error, or even a warning.
The text was updated successfully, but these errors were encountered: