-
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
Plugin: Correctly classify functionality in the lib
folder
#39972
Conversation
* @param WP_REST_Response $response Response data served by the WordPress REST index endpoint. | ||
* @return WP_REST_Response | ||
*/ | ||
function gutenberg_register_site_logo_to_rest_index( $response ) { |
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.
good call adding the gutenberg_prefix
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.
LGTM, I restarted the failing E2E test that, again, seems to be just flaky.
1db15f0
to
0a8e9c9
Compare
268dccd
to
563e51a
Compare
@noisysocks, @talldan, and @anton-vlasenko, can you confirm whether all changes applied to navigation.php were fully backported for WordPress 5.9 release? I definitely can find some changes in this commit WordPress/wordpress-develop@f034bc8. The question is whether we still need to add some changes as part of WordPress 6.0. I'd like also to confirm that all code in navigation-theme-opt-in.php is still experimental. Functions reference still open Trac ticker: https://core.trac.wordpress.org/ticket/50544, so I assumed it's still not part of WordPress core. The same question applies to navigation-page.php. |
563e51a
to
9bc946f
Compare
I updated more code in 9bc946f:
|
9bc946f
to
bfa2120
Compare
I'm pretty happy about the current folder structure: I tried removing With bfa2120 I moved With 7d631be I moved I also renamed |
7d631be
to
9d8938f
Compare
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.
Really cool PR :) Thanks for doing that.
For the edit-site-page.php
I'm not sure whether we can just move it as is to 5.9 lib. It seems there's some changes in the "preloading" in 6.0. So I guess either we move the file to 6.0 or find a way to override the preloading stuff in 6.0 folder.
* | ||
* @param WP_Scripts $scripts WP_Scripts instance. | ||
*/ | ||
function gutenberg_register_vendor_scripts( $scripts ) { |
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.
With React 18, we might need to move that to another folder, but it's a problem for later :)
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.
I took that into account. It's probably fine to move it between WP versions. When SCRIPT_DEBUG
is enabled I inject the dev scripts for React Fast Refresh so I will think how to add it to WP core so we don't have to include that every time we update the React version.
There is a hook that targets only the preloading functionality. I will land this PR to help coordinate backports to WordPress core and see how we can attack the preloading in a more granular way 💯 |
It looks like @jsnajdr has covered everything for WordPress 5.9 with this hook: gutenberg/lib/compat/wordpress-6.0/edit-form-blocks.php Lines 14 to 51 in 4bd51e1
|
I think this PR may have accidentally broken some of the Site Logo functionality. Before this PR, the W would be replaced by any site logo set, like so: After this PR, that's broken: Steps to reproduce:
The W should be replaced by a round-rectangle site logo instead. |
function register_site_icon_url( $response ) { | ||
$data = $response->data; | ||
$data['site_icon_url'] = get_site_icon_url(); | ||
$response->set_data( $data ); | ||
return $response; | ||
} | ||
|
||
add_filter( 'rest_index', 'register_site_icon_url' ); |
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.
@jasmussen, great catch. I accidentally removed this filter related to the Site Logo block 😱
I will open PR as the first thing in the morning.
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.
Ready in #40041.
Regression introduced in the `lib` folder refactoring #39972.
* Site Logo: Fix adding the site icon Regression introduced in the `lib` folder refactoring #39972. * Fix formatting issues
What?
Part of #39889 that lists the changes to backport for the WordPress 6.0 release.
Related Site Editor core merge commit WordPress/wordpress-develop@f034bc8.
Related Trac ticket for the navigation editor https://core.trac.wordpress.org/ticket/50544.
Why?
We need to correctly classify added code changes so we know exactly whether they are still experimental, they were shipped in WordPress 5.9 or they should be backported to WordPress core as part of 6.0 major release.
How?
I moved files from the
lib
folder to subfolders after checking whether they are still experimental, were backported to WordPress 5.9 or I believe they should be backported to WordPress 6.0.Experimental
WordPress 5.9
WordPress 6.0
Testing Instructions
No changes at all. The plugin should work as before.