-
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
HTML API: Backport updates from Core #57022
Conversation
This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress. If so, it is recommended to create a new Trac ticket and submit a pull request to the WordPress Core Github repository soon after this pull request is merged. If you're unsure, you can always ask for help in the #core-editor channel in WordPress Slack. Thank you! ❤️ View changed files❔ lib/compat/wordpress-6.5/html-api/class-gutenberg-html-open-elements-6-5.php ❔ lib/compat/wordpress-6.5/html-api/class-gutenberg-html-processor-6-5.php ❔ lib/compat/wordpress-6.5/html-api/class-gutenberg-html-processor-state-6-5.php ❔ lib/compat/wordpress-6.5/html-api/class-gutenberg-html-tag-processor-6-5.php ❔ lib/load.php |
58a6b69
to
43b9a9c
Compare
Flaky tests detected in f02244a. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7280154863
|
2f72fa6
to
2c8de78
Compare
- Add support for H1 - H6 elements (WordPress/wordpress-develop#5535)
@SergeyBiryukov when the WPCS ignore statements were removed in https://core.trac.wordpress.org/changeset/56753 it started preventing updates in this repo to the file where it was removed. I couldn't find a Trac ticket or any code review for that change before it was merged. @hellofromtonya @anton-vlasenko I don't like merging over failing CI steps so I would appreciate your guidance. the WPCS rules which are preventing this PR from maintaining code harmony between the projects are the same rules that forced the change that created the obstacle; this seems silly. |
I'm sorry to hear that misalignment in coding standards is still causing issues, @dmsnell. Hopefully, one day, coding standards can be fully aligned. In my opinion , <rule ref="VariableAnalysis.CodeAnalysis.VariableAnalysis">
<properties>
<property name="allowUnusedParametersBeforeUsed" value="true"/>
</properties>
</rule> with <rule ref="VariableAnalysis.CodeAnalysis.VariableAnalysis">
<properties>
<property name="allowUnusedParametersBeforeUsed" value="true"/>
</properties>
<!-- Exclude the html-api folder to prevent linter errors until coding standards are aligned. -->
<exclude-pattern>./lib/compat/wordpress-*/html-api/*.php</exclude-pattern>
</rule> What is your opinion on this? |
Sounds great @anton-vlasenko - I appreciate making the adjustment to the rules, and avoiding the need to add more IGNORE statements. I'll add that change in this backport PR. For some reason I often forget that I can modify the WPCS rules in one of these backport PRs. Thanks as always for your help.
We'll get there. Things have been getting better. I think in this case the problem happened because someone changed Core in a way that broke Gutenberg but that change was never run through any review process or preview in Gutenberg, so the error didn't appear until it was too late. |
2c8de78
to
f54fc66
Compare
- Add support for H1 - H6 elements (WordPress/wordpress-develop#5535)
f54fc66
to
d3319f5
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.
My personal preference aside, I'm afraid we can't merge this as-is: The problem is that the Dynamic Block PHP code (i.e. everything in packages/block-library/src/**/*.php
) will be carried over into Core via npm package sync. But in Core, none of the back-compat Gutenberg_HTML_Tag_Processor_6_x
classes exist, so it would fatal there 😕
(The same might apply to lib/block-supports/*.php
, but I'm not sure about that.)
is there not a way we can replace those classes during the packaging? and doesn't this same problem exist in other shared code? I can pull these out if we need to; still trying to find a more reliable method to avoid breakages. |
We have sort of the reverse mechanism in place for some function names in Dynamic Blocks' PHP (that are changed from gutenberg/tools/webpack/blocks.js Lines 25 to 36 in 1275d2f
To avoid confusion, we'd need to align with that and also transform from
I think we have a recommendation somewhere that Dynamic Blocks generally use functions rather than classes (and class methods); although upon some further research, there seems to be some precedent in the guise of some Style Engine related class names which are indeed transformed: gutenberg/tools/webpack/packages.js Lines 40 to 46 in 1275d2f
...although the transformed names seem to look a bit different than the "usual" gutenberg/tools/webpack/packages.js Lines 57 to 64 in 1275d2f
Thank you. How about we land the backport of WordPress/wordpress-develop#5535 and WordPress/wordpress-develop#5725 separately first (to unblock further work), and file a separate PR for the other changes (since they might need some more tweaking)? TBH I'm still not 100% convinced we should really duplicate all classes from Core in GB's back-compat layer and update all code to use the latter, given that it'll add a ton more code that will need syncing and require that extra magic at build time, which will likely mean another list of classes tucked away in a webpack config that we'll need to keep updated. |
f02244a
to
444a0c5
Compare
@ockham this has been pared back to only include the changes to the existing classes. |
f3fb05e
to
e5b2e6a
Compare
Updates from WordPress/wordpress-develop at 54a09a7ec99c59b8e640bd5aacebfdbf03bb02cc - WordPress/wordpress-develop#5535 Adds support for H1 - H6 elements in the HTML Processor. - WordPress/wordpress-develop#5725 Pause the Tag Processor when reaching the end of the document inside an incomplete syntax element. - Incorporates linting changes from "TODO:" to "todo" This patch adds the blanket exclusion from the HTML API compatability layer after they were removed and started blocking updates from Core. The PHP files in the compatability layer are merged and maintained in the Core repo and all changes or updates need to happen first in Core and then be brought over to Gutenberg as built files. From Gutenberg's perspective they are no different than NPM packages. Co-authored-by: Anton Vlasenko <43744263+anton-vlasenko@users.noreply.github.com> Co-authored-by: Bernie Reiter <96308+ockham@users.noreply.github.com>
e5b2e6a
to
ca8d29d
Compare
Updates from WordPress/wordpress-develop at 54a09a7ec99c59b8e640bd5aacebfdbf03bb02cc - WordPress/wordpress-develop#5535 Adds support for H1 - H6 elements in the HTML Processor. - WordPress/wordpress-develop#5725 Pause the Tag Processor when reaching the end of the document inside an incomplete syntax element. - Incorporates linting changes from "TODO:" to "todo" This patch adds the blanket exclusion from the HTML API compatability layer after they were removed and started blocking updates from Core. The PHP files in the compatability layer are merged and maintained in the Core repo and all changes or updates need to happen first in Core and then be brought over to Gutenberg as built files. From Gutenberg's perspective they are no different than NPM packages. Co-authored-by: Anton Vlasenko <43744263+anton-vlasenko@users.noreply.github.com> Co-authored-by: Bernie Reiter <96308+ockham@users.noreply.github.com>
ca8d29d
to
7b6607f
Compare
7b6607f
to
bed2804
Compare
bed2804
to
b6586a4
Compare
Updates from WordPress/wordpress-develop at 54a09a7ec99c59b8e640bd5aacebfdbf03bb02cc - WordPress/wordpress-develop#5535 Adds support for H1 - H6 elements in the HTML Processor. - WordPress/wordpress-develop#5725 Pause the Tag Processor when reaching the end of the document inside an incomplete syntax element. - Incorporates linting changes from "TODO:" to "todo". - WordPress/wordpress-develop#5762 Handles the "all other tags" rules in IN BODY insertion mode. - WordPress/wordpress-develop#5539 Adds support for list elements in the HTML Processor. This patch adds the blanket exclusion from the HTML API compatability layer after they were removed and started blocking updates from Core. The PHP files in the compatability layer are merged and maintained in the Core repo and all changes or updates need to happen first in Core and then be brought over to Gutenberg as built files. From Gutenberg's perspective they are no different than NPM packages. Co-authored-by: Anton Vlasenko <43744263+anton-vlasenko@users.noreply.github.com> Co-authored-by: Bernie Reiter <96308+ockham@users.noreply.github.com>
b6586a4
to
d8d7bbc
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.
LGTM!
I've compared all files to their counterparts in the https://github.com/WordPress/wordpress-develop repo. They are all exact matches, except for the different class names (as expected).
This is a backport PR to bring updates from changes in WordPress/WordPress-develop at 54a09a7e into this repository into a compatibility layer.