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

HTML API: Backport updates from Core #54481

Merged
merged 1 commit into from
Sep 27, 2023

Conversation

dmsnell
Copy link
Member

@dmsnell dmsnell commented Sep 14, 2023

What?

Pulling over work on the HTML API from Core:

Why?

The HTML API is being developed and maintained in Core and backported into Gutenberg. This is a periodic and "blessed" PR where the code has already been reviewed and accepted; merging into Gutenberg is simply accepting what has already been adopted.

How?

Pulls files from Core and adds a Gutenberg prefix where required.

Testing Instructions

Please review how we're updating the Tag Processor in 6.3 and also in 6.4.
Do we need to make this Gutenberg_HTML_Processor_6.4 now that it extends the Gutenberg_HTML_Tag_Processor_6_4? Is Gutenberg_HTML_Tag_Processor_6_4 even needed?

@dmsnell dmsnell added Backport from WordPress Core Pull request that needs to be backported to a Gutenberg release from WordPress Core [Feature] HTML API An API for updating HTML attributes in markup labels Sep 14, 2023
@github-actions
Copy link

github-actions bot commented Sep 14, 2023

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.4/html-api/class-gutenberg-html-tag-processor-6-4.php
❔ lib/compat/wordpress-6.3/html-api/class-gutenberg-html-tag-processor-6-3.php
❔ lib/compat/wordpress-6.4/html-api/class-wp-html-processor.php
❔ lib/load.php

@aristath
Copy link
Member

@dmsnell I pushed a commit excluding the file from WPCS checks since it's maintained in Core and not Gutenberg. That should fix the failing tests 👍

@dmsnell dmsnell force-pushed the html-api/backport-updates-from-core branch from f943e07 to 9fddb81 Compare September 21, 2023 23:51
@dmsnell
Copy link
Member Author

dmsnell commented Sep 21, 2023

@aristath thank you so much! this exclusion can remove a major obstacle I've had in keeping momentum on the HTML API. should we expand it to all the HTML API files?

./lib/compat//html-api/.php

I'm not sure if the wildcards work that way or not 🤷‍♂️

I've really struggled with communication here, because I try to find people actively working in the same places I am developing, but I've had a hard time going the opposite direction and flagging things early enough to avoid headache for people coming into where I'm actively working who don't reach out in the same way.

I figure this is going to keep coming up, and with the WPCS 3.0 changes, we're creating the situation where the CI job prevents us from reverting bugs, and I'd love it if we can avoid that; redirect everyone to WordPress/wordpress-develop where this code "lives".

@dmsnell
Copy link
Member Author

dmsnell commented Sep 22, 2023

@aristath I've gone ahead and expanded that exclusion because once I pulled in updates for the 6.4 release track, it immediately rejected this again 🙃

feel free to add more commits if you think something should be different. please note, however, that I did rebase the branch, so you will want to hard-reset/pull from origin before you add more commit and push

@dmsnell dmsnell force-pushed the html-api/backport-updates-from-core branch from 47a8be3 to 7734551 Compare September 27, 2023 11:15
Copy link
Member

@aristath aristath left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@dmsnell dmsnell force-pushed the html-api/backport-updates-from-core branch from 7734551 to 5171ca5 Compare September 27, 2023 11:35
@dmsnell
Copy link
Member Author

dmsnell commented Sep 27, 2023

(will merge as soon as the tests pass before someone merges into trunk - it's a thing in order to sign the commit)

@dmsnell dmsnell force-pushed the html-api/backport-updates-from-core branch 4 times, most recently from 666410b to 8b63073 Compare September 27, 2023 13:01
@dmsnell dmsnell force-pushed the html-api/backport-updates-from-core branch from 8b63073 to 98c1f71 Compare September 27, 2023 13:05
Pulling over work on the HTML API from Core:

 - bug fix: stop parsing tags inside of STYLE, IFRAME, and other RAWTEXT elements.
 - bug fix: stay on track when document ends in the middle of processing a tag.
 - bug fix: remove all copies of an attribute when duplicates exist on a tag.
 - bug fix: stop processing in the HTML Processor when encountering unsupported markup
 - reverts changes made in #53866 which introduced a bug during a styling refactor.
 - update docblock comments through HTML API.

This patch also excludes the HTML API folders in the compatability
layer from WPCS inspection, since this code is maintained, reviewed,
and accepted into Core and brought back into Gutenberg. Changes to
the code need to be made first in Core and brought over as blessed
backport changes.

Co-authored-by: Ari Stathopoulos <aristath@gmail.com>
Co-authored-by: Bernie Reiter <96308+ockham@users.noreply.github.com>
@dmsnell dmsnell force-pushed the html-api/backport-updates-from-core branch from 98c1f71 to e1a88b3 Compare September 27, 2023 13:11
@github-actions
Copy link

Flaky tests detected in e1a88b3.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6326435591
📝 Reported issues:

@dmsnell dmsnell merged commit e1a88b3 into trunk Sep 27, 2023
49 checks passed
@dmsnell dmsnell deleted the html-api/backport-updates-from-core branch September 27, 2023 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backport from WordPress Core Pull request that needs to be backported to a Gutenberg release from WordPress Core [Feature] HTML API An API for updating HTML attributes in markup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants