-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Heading: Add block classname deprecation #46138
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
Conversation
|
Size Change: +95 B (0%) Total Size: 1.32 MB
ℹ️ View Unchanged
|
ab037fa to
68ac06b
Compare
|
Thank you! I haven't gotten a chance to review yet, but this looks great. As a side note...
@dmsnell is this something that your block API work would solve in the general case? |
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.
Thanks for following up with this PR @aaronrobertshaw!
✅ The added deprecation appears to work as expected and the errors are no longer present in the console
❓ The order of the deprecations in deprecated.js is now ascending in structure, whereas it looks like other deprecated.js files in the repo are descending (with the latest version coming first in the file). E.g. Navigation, and Cover. Should we do the same here? (Though I see the docs have it ascending 🤔)
It looks like the deprecations are correctly named here (e.g. v1 is the earliest of the deprecations, and v5 is the latest, and the const deprecated statement sets them in the correct order), so this question is only about the order of the functions in the file, which doesn't make a difference in the run-time.
Other than that, and given that Adam confirmed we'd be sticking to storing the heading classname in post content for now (#42122 (comment)) this LGTM! ✨
|
Thanks for reviewing this @andrewserong 👍
I'd say there are a couple of reasons I went with this order:
As you note, the order in which the deprecations are defined makes no difference, only the order they appear in the I'll merge this now to eliminate the block validation errors on trunk. If there is consensus on the order deprecations are defined, we can update this and the docs or all the other block deprecations in a follow-up. |
Sounds good, and I agree that it feels more natural to place the latest deprecation at the end of the file, and it should be pretty clear for the next person based on the naming of each of the deprecation versions. Thanks for landing this one! |
|
Collective dev note in #42122 |
Related:
What?
Adds missing deprecation for Heading block after adding of block classname via supports.
Why?
Without the deprecation old heading blocks throw block validation errors.
How?
Testing Instructions
npm run test:unit test/integration/full-content/full-content.test.jsExample deprecated heading content:
NOTE: It might be easiest to review the code changes by commit. The first commit (bc5fc1c) includes the new deprecation and the updated fixtures. The second commit (68ac06b) refactors the deprecations into the currently recommended format.