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

Plugin: Move files from lib to the compat subfolder #39904

Merged
merged 1 commit into from
Mar 31, 2022

Conversation

gziolo
Copy link
Member

@gziolo gziolo commented Mar 30, 2022

What?

Part of #39889. It only moved the files to the proper subfolders so they can be matched with the corresponding WordPress major release.

Why?

To follow the best practices for PHP code in the Gutenberg plugin as documented in https://github.com/WordPress/gutenberg/tree/trunk/lib#file-structure.

How?

I was going through the files that need to be backported to WordPress core for the upcoming 6.0 release. I noticed a few files in the lib folder that should live elsewhere.

I also moved all files from lib/compat/experimental to lib/experimental based on the feedback from @hellofromtonya.

Experimental features

  • WP_REST_Block_Editor_Settings_Controller
  • WP_REST_Block_Navigation_Areas_Controller
  • WP_Rest_Customizer_Nonces

Shipped in WordPress 5.9

I located the same code in WP core:

  • WP_REST_Menu_Items_Controller
  • WP_REST_Menu_Locations_Controller
  • WP_REST_Menus_Controller
  • WP_REST_URL_Details_Controller

To ship in WordPress 6.0

  • gutenberg_register_gutenberg_patterns

Testing Instructions

There should be no change in how the Gutenberg plugin works.

@gziolo gziolo added Gutenberg Plugin Issues or PRs related to Gutenberg Plugin management related efforts [Type] Code Quality Issues or PRs that relate to code quality labels Mar 30, 2022
@gziolo gziolo self-assigned this Mar 30, 2022
@gziolo
Copy link
Member Author

gziolo commented Mar 30, 2022

@ntsekouras - it looks like gutenberg_register_gutenberg_patterns targeted WordPress 5.9, are there any follow-up changes that should get included in WordPress 6.0?

@hellofromtonya
Copy link
Contributor

Experimental features

  • WP_REST_Block_Editor_Settings_Controller
  • WP_REST_Block_Navigation_Areas_Controller
  • WP_Rest_Customizer_Nonces

Why move these experimental features to lib/compat/experiment. Should they live in lib/experimental per https://github.com/WordPress/gutenberg/tree/trunk/lib#file-structure as they are still experimental and not ready to be merged into WordPress Core?

lib/experimental - Experimental features that exist only in the plugin. They are not ready to be merged to Core.

@gziolo
Copy link
Member Author

gziolo commented Mar 31, 2022

Experimental features

  • WP_REST_Block_Editor_Settings_Controller
  • WP_REST_Block_Navigation_Areas_Controller
  • WP_Rest_Customizer_Nonces

Why move these experimental features to lib/compat/experiment. Should they live in lib/experimental per https://github.com/WordPress/gutenberg/tree/trunk/lib#file-structure as they are still experimental and not ready to be merged into WordPress Core?

lib/experimental - Experimental features that exist only in the plugin. They are not ready to be merged to Core.

The reality is a bit different than the documentation because there is no lib/experimental folder in the project.Anyway, I will move everything from lib/compat/experiment to the the documented location. 👍

@ntsekouras
Copy link
Contributor

@ntsekouras - it looks like gutenberg_register_gutenberg_patterns targeted WordPress 5.9, are there any follow-up changes that should get included in WordPress 6.0?

Actually it seems that the specific file might not be needed. Let me check a bit better. It seems to have changes six months ago, but it was for another feature that later on, I moved it to the compat/5.9 here.

@gziolo
Copy link
Member Author

gziolo commented Mar 31, 2022

@ntsekouras - it looks like gutenberg_register_gutenberg_patterns targeted WordPress 5.9, are there any follow-up changes that should get included in WordPress 6.0?

Actually it seems that the specific file might not be needed. Let me check a bit better. It seems to have changes six months ago, but it was for another feature that later on, I moved it to the compat/5.9 here.

Great, I'm waiting for the confirmation 👍🏻

@ntsekouras
Copy link
Contributor

Hm.. I just checked and this was the last PR updating the patterns there: #38063, which is for 6.0. So it should be moved to 6.0.

@gziolo gziolo force-pushed the update/gutenberg-lib-update branch from a4604cf to eabc879 Compare March 31, 2022 08:58
@gziolo gziolo force-pushed the update/gutenberg-lib-update branch from eabc879 to a7bcdc9 Compare March 31, 2022 09:18
@gziolo
Copy link
Member Author

gziolo commented Mar 31, 2022

I moved all files from lib/compat/experimental to lib/experimental based on the feedback from @hellofromtonya.

Hm.. I just checked and this was the last PR updating the patterns there: #38063, which is for 6.0. So it should be moved to 6.0.

gutenberg_register_gutenberg_patterns it's now clustered correctly for inclusion in WP 6.0.

Copy link
Contributor

@hellofromtonya hellofromtonya left a comment

Choose a reason for hiding this comment

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

LGTM 👍

What's up with the failed e2e tests?

@gziolo
Copy link
Member Author

gziolo commented Mar 31, 2022

What's up with the failed e2e tests?

I see the same issue in other open PRs. It fails randomly in trunk, too.

@gziolo gziolo merged commit a623dbe into trunk Mar 31, 2022
@gziolo gziolo deleted the update/gutenberg-lib-update branch March 31, 2022 11:34
@github-actions github-actions bot added this to the Gutenberg 13.0 milestone Mar 31, 2022
@hellofromtonya
Copy link
Contributor

I see the same issue in other open PRs. It fails randomly in trunk, too.

Hmm, good to know it's unrelated to this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Gutenberg Plugin Issues or PRs related to Gutenberg Plugin management related efforts [Type] Code Quality Issues or PRs that relate to code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants