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

Add 'since' versions to the deprecated features #30072

Merged
merged 3 commits into from
Mar 24, 2021

Conversation

Mamaduka
Copy link
Member

Description

This is a follow-up of #30017 and adds deprecation versions to the features.

I've used a combination of git history, Github milestones, and inline comments to track down deprecation versions.

How has this been tested?

Locally by using the deprecated features. Example:

wp.data.select( 'core/editor' ).getSelectedBlock();

Calling the following selector in the console should result in a deprecation message with a version it was deprecated.

Types of changes

New feature

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • [N/A] My code follows the accessibility standards.
  • [N/A] I've tested my changes with keyboard and screen readers.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • [N/A] I've updated all React Native files affected by any refactorings/renamings in this PR.

@Mamaduka Mamaduka added [Type] Enhancement A suggestion for improvement. [Package] Deprecated packages/deprecated labels Mar 22, 2021
@Mamaduka Mamaduka self-assigned this Mar 22, 2021
@gziolo
Copy link
Member

gziolo commented Mar 23, 2021

I'm wondering how valuable those versions are without context. They should make it clear that this version is related to the plugin:

plugin: 'Gutenberg',

Aside: For folks consuming the block editor from the WordPress core, this information might be less useful as they would rather prefer seeing the version of WordPress core.

@Mamaduka
Copy link
Member Author

Hi @gziolo,

I also would prefer seeing the WP version in those messages. As a plugin developer, it would make it easier for me to check if the suggested alternative will work with my minimum required WP version.

Maybe we should use the WP version in log messages and add the Gutenberg version in DocBlocks.

P.S. I remember there was a document with a list, which WP version included which Gutenberg version. But I'm not able to find it right now.

@gziolo
Copy link
Member

gziolo commented Mar 23, 2021

P.S. I remember there was a document with a list, which WP version included which Gutenberg version. But I'm not able to find it right now.

You can open a file and switch to the branch for a given WP version, e.g.:

Screen Shot 2021-03-23 at 13 36 18

https://github.com/WordPress/gutenberg/blob/wp/5.7/packages/block-editor/src/components/block-card/index.js
vs
https://github.com/WordPress/gutenberg/blob/wp/5.6/packages/block-editor/src/components/block-card/index.js

@gziolo
Copy link
Member

gziolo commented Mar 23, 2021

So we could default to the Gutenberg version in the code when introducing a deprecation and update them just before every major WordPress release. How does it sound? It would give good feedback on where the deprecation comes from.

@Mamaduka
Copy link
Member Author

So we could default to the Gutenberg version in the code when introducing a deprecation and update them after every major WordPress release. How does it sound? It would give good feedback on where the deprecation comes from.

Sounds great. I will update PR to use WP versions.

@Mamaduka Mamaduka force-pushed the add/since-to-deprecated-features branch from 0919fa0 to aa9120b Compare March 24, 2021 09:38
@Mamaduka
Copy link
Member Author

@gziolo I've updated since options for deprecated features that are part of the core to use WP versions.

Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

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

There are some places where it would be valuable to explicitly say that the since comes from the Gutenberg plugin. Otherwise, nice improvements 👍🏻

@Mamaduka
Copy link
Member Author

Thanks, @gziolo for the suggestion.

I provided a plugin option for Gutenberg deprecations and removed them from WP ones.

Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

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

All good 🚢

@gziolo
Copy link
Member

gziolo commented Mar 24, 2021

https://github.com/WordPress/gutenberg/tree/trunk/docs/how-to-guides/backward-compatibility#deprecations

The last step would be to update the documentation and share recommendations on how to use deprecation helper moving on. There is this section that could be extended:

https://github.com/WordPress/gutenberg/tree/trunk/docs/how-to-guides/backward-compatibility#deprecations

@Mamaduka
Copy link
Member Author

The last step would be to update the documentation and share recommendations on how to use deprecation helper moving on. There is this section that could be extended:

Sounds good. I will create a separate PR for this if it's okay with you.

@gziolo
Copy link
Member

gziolo commented Mar 24, 2021

Sounds good. I will create a separate PR for this if it's okay with you.

Yes, for sure 👍🏻

@Mamaduka Mamaduka merged commit 42dca26 into WordPress:trunk Mar 24, 2021
@github-actions github-actions bot added this to the Gutenberg 10.3 milestone Mar 24, 2021
@Mamaduka Mamaduka deleted the add/since-to-deprecated-features branch March 25, 2021 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Deprecated packages/deprecated [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants