-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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 server side registration to fix translation #2826
Add server side registration to fix translation #2826
Conversation
Hi @c4rl0sbr4v0! 👋 Thank you for your contribution to WordPress! 💖 It looks like this is your first pull request to No one monitors this repository for new pull requests. Pull requests must be attached to a Trac ticket to be considered for inclusion in WordPress Core. To attach a pull request to a Trac ticket, please include the ticket's full URL in your pull request description. Pull requests are never merged on GitHub. The WordPress codebase continues to be managed through the SVN repository that this GitHub repository mirrors. Please feel free to open pull requests to work on any contribution you are making. More information about how GitHub pull requests can be used to contribute to WordPress can be found in this blog post. Please include automated tests. Including tests in your pull request is one way to help your patch be considered faster. To learn about WordPress' test suites, visit the Automated Testing page in the handbook. If you have not had a chance, please review the Contribute with Code page in the WordPress Core Handbook. The Developer Hub also documents the various coding standards that are followed:
Thank you, |
<?php | ||
/** | ||
* Server-side rendering of the `core/comments-query-loop` block. | ||
* | ||
* @package WordPress | ||
*/ | ||
|
||
/** | ||
* Registers the `core/comments-query-loop` block on the server. | ||
*/ |
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.
Let's maybe add a note somewhere in these comments why we need this file (with a reference to this PR or the discussion in WordPress/gutenberg#41292), as it might otherwise be very tempting to remove it 😬
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, LGTM!
A lot of unit tests are failing, but those seem unrelated to me (?)
I'm checking and running on local. Anyway, here there are not reviews-merges, they are done in Trac 😄 |
I had another look at the unit tests. All 18 failures are actually the same (although they happen in different locations):
I had one idea -- maybe we are doing something wrong when registering the block. Turns out that the PHP for individual blocks is synced from Gutenberg via npm packages (see e.g. 619693e an example). So basically, we don't really edit
I'm not 100% sure this is the reason for the unit test failure, but it might be. Regardless, it seems to be how block changes need to be made 😅 (And yeah, if wonder if this is documented anywhere.) |
I realize that this might be tricky since we've already changed the directory name to But here's another thought -- unit tests are specifically complaining about an "incorrect usage notice for |
I managed to track down the incorrect usage notice that's being triggered; it's this:
|
I think that error makes sense; after all, the Comments Query Loop block has already been registered prior to this PR. So now we have to find where that was happening and probably disable it. |
I tried grepping for other occurrences of wordpress-develop/tools/webpack/blocks.js Line 92 in a5b555a
I think this is a likely candidate -- some Webpack plugin that gets information about all static and dynamic blocks, separately. So I tried moving diff --git a/tools/webpack/blocks.js b/tools/webpack/blocks.js
index 3250df5bbf..05b50d5e4d 100644
--- a/tools/webpack/blocks.js
+++ b/tools/webpack/blocks.js
@@ -38,6 +38,7 @@ module.exports = function( env = { environment: 'production', watch: false, buil
'comments-pagination-next',
'comments-pagination-numbers',
'comments-pagination-previous',
+ 'comments-query-loop',
'cover',
'file',
'gallery',
@@ -89,7 +90,6 @@ module.exports = function( env = { environment: 'production', watch: false, buil
'code',
'column',
'columns',
- 'comments-query-loop',
'embed',
'freeform',
'group', I then ran
Which makes sense, since the I wonder if we'll have to do an npm release with that rename reverted 😕 cc/ npm expert in residence @gziolo |
We forgot to list the block here: wordpress-develop/src/wp-includes/blocks/index.php Lines 77 to 114 in a5b555a
@adamziel has a patch that is nearly ready to land that automates the whole process to avoid future mistakes: For the 6.0.1 release, we will need a manual patch in the |
Closed in favor of #2921 |
Just to follow up on this, I've committed a change to the test suite in r53637 to always include the actual |
Add server-side registration so we can fix Comment Query Loop title and description not being translated.
More info on the issue.
Trac ticket: https://core.trac.wordpress.org/ticket/55809
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.