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

Deprecate Subheading block #9355

Merged
merged 2 commits into from
Aug 27, 2018
Merged

Deprecate Subheading block #9355

merged 2 commits into from
Aug 27, 2018

Conversation

ZebulanStanphill
Copy link
Member

@ZebulanStanphill ZebulanStanphill commented Aug 25, 2018

Description

This PR deprecates the Subheading (core/subhead) block. It removes the Subheading block from the inserter. It also removes the Paragraph→Subheading transform and improves the Subheading→Paragraph transform to preserve custom CSS classes. It also changes the visible title and description of the Subheading block to indicate that it is deprecated.

Fixes #9308 and closes #5475, #8141, #8234, and #8716.

Additional notes

When should the Subheading block be removed entirely? I have noticed that the Text Columns block still technically exists despite being deprecated in 3.3.

Currently, there is no way to migrate from a deprecated/removed block to another block automatically. Should this feature be added before the Text Columns and Subheading blocks are removed entirely?

Related issues and PRs

@chrisvanpatten
Copy link
Contributor

Love this approach!

@ZebulanStanphill
Copy link
Member Author

@chrisvanpatten Thanks! I took a look at #8036 and applied a similar approach here, this time changing the visible title and description (the latter of which was really misleading) to indicate the deprecation status of the block.

@@ -7,6 +7,7 @@ Gutenberg's deprecation policy is intended to support backwards-compatibility fo
- `wp.editor.getColorName` has been removed. Please use `wp.editor.getColorObjectByColorValue` instead.
- `wp.editor.getColorClass` has been renamed. Please use `wp.editor.getColorClassName` instead.
- `value` property in color objects passed by `wp.editor.withColors` has been removed. Please use color property instead.
- The Subheading block has been removed. Please use the Paragraph block instead.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think deprecating blocks is special and we shouldn't remove it in 3.9.0. We may remove it later when we merge to Core or when we build a deprecated versions across blocks. So I'd suggested removing this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notably, the same kind of message was put in the 3.5.0 section for the Text Columns block, which is why I put this message here. I will remove my message and create a separate PR for removing the one that was created for the Text Columns block.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh maybe let's keep for now then for the sake of consistency. It could be argued that it "encourages" people to migrate.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, that was fast! I actually pushed a commit to remove the message, but it looks like you merged the branch before I did that, so I guess I will just delete the branch now. 😛

Copy link
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@youknowriad youknowriad merged commit 18f45f9 into WordPress:master Aug 27, 2018
@youknowriad youknowriad added this to the 3.7 milestone Aug 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove sub heading Pressing Return in the subhead block does not create a new paragraph
3 participants