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

Compat: Update HTML API with changes from 6.6 #63089

Merged
merged 1 commit into from
Jul 3, 2024
Merged

Conversation

dmsnell
Copy link
Member

@dmsnell dmsnell commented Jul 3, 2024

What?

Ports code from WordPress 6.6 into lib/compat/wordpress-6.6.
Ports code from WordPress 6.5 into lib/compat/wordpress-6.5.
Ports code from WordPress 6.4 into lib/compat/wordpress-6.4.

Because of the breaking change in 6.5 of the Span and Text Replacement, the 6.6 functions still refer to Gutenberg_HTML_Span_6_5 and Gutenberg_HTML_Text_Replacement_6_5.

Why?

Ensures that code relying on functionality in the HTML API will work on Gutenberg sites running on older WordPress versions.

How?

Copies files from Core in the 6.6 branch and replaces WP_ classes that have updates in 6.6 with their Gutenberg_ counterparts.

Testing Instructions

Let the tests run. Since nothing calls these classes yet the only thing that should matter is whether a site loads with the plugin installed.

@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 Jul 3, 2024
@dmsnell dmsnell requested review from ockham and t-hamano July 3, 2024 12:36
@dmsnell dmsnell requested a review from spacedmonkey as a code owner July 3, 2024 12:36
Copy link

github-actions bot commented Jul 3, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: dmsnell <dmsnell@git.wordpress.org>
Co-authored-by: ockham <bernhard-reiter@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@dmsnell dmsnell mentioned this pull request Jul 3, 2024
19 tasks
case '-NAV':
case '-SEARCH':
case '-SECTION':
case '-SUMMARY':
Copy link
Member Author

Choose a reason for hiding this comment

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

I apparently added code from the 6.5 branch when I initially added this file.

Copy link

github-actions bot commented Jul 3, 2024

Flaky tests detected in 29797ed.
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/9779966065
📝 Reported issues:

Copy link
Contributor

@ockham ockham left a comment

Choose a reason for hiding this comment

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

LGTM! I diffed all files against their counterparts from the respective Core branches, and the diffs looked fine 👍

dmsnell added a commit that referenced this pull request Jul 3, 2024
Updates the HTML API components in the compatability layer with updates
from each of the 6.4, 6.5, and 6.6 branches from Core.

Notably, because of the breaking change in 6.5 to the `WP_HTML_Span` and
`WP_HTML_Text_Replacement` classes, which changed the range format from
`(start, end)` to `(start, length)`, the 6.6 classes still reference the
`Gutenberg_HTML_Span_6_5` and `Gutenberg_HTML_Text_Replacement_6_5`
substitutions.

While updating it was noticed that the 6.4 compatability code
accidentally pulled in updates from the 6.5 branch for the HTML
Processor. These additions have been removed for the sake of closer
correspondance with the Core code.

Co-authored-by: ockham <bernhard-reiter@git.wordpress.org>
@dmsnell dmsnell force-pushed the compat/add-html-api-6-6 branch from 29797ed to 15bc8c0 Compare July 3, 2024 16:55
dmsnell added a commit that referenced this pull request Jul 3, 2024
Updates the HTML API components in the compatability layer with updates
from each of the 6.4, 6.5, and 6.6 branches from Core.

Notably, because of the breaking change in 6.5 to the `WP_HTML_Span` and
`WP_HTML_Text_Replacement` classes, which changed the range format from
`(start, end)` to `(start, length)`, the 6.6 classes still reference the
`Gutenberg_HTML_Span_6_5` and `Gutenberg_HTML_Text_Replacement_6_5`
substitutions.

While updating it was noticed that the 6.4 compatability code
accidentally pulled in updates from the 6.5 branch for the HTML
Processor. These additions have been removed for the sake of closer
correspondance with the Core code.

Co-authored-by: ockham <bernhard-reiter@git.wordpress.org>
@dmsnell dmsnell force-pushed the compat/add-html-api-6-6 branch from 15bc8c0 to d8d6efa Compare July 3, 2024 17:16
Updates the HTML API components in the compatability layer with updates
from each of the 6.4, 6.5, and 6.6 branches from Core.

Notably, because of the breaking change in 6.5 to the `WP_HTML_Span` and
`WP_HTML_Text_Replacement` classes, which changed the range format from
`(start, end)` to `(start, length)`, the 6.6 classes still reference the
`Gutenberg_HTML_Span_6_5` and `Gutenberg_HTML_Text_Replacement_6_5`
substitutions.

While updating it was noticed that the 6.4 compatability code
accidentally pulled in updates from the 6.5 branch for the HTML
Processor. These additions have been removed for the sake of closer
correspondance with the Core code.

Co-authored-by: ockham <bernhard-reiter@git.wordpress.org>
@dmsnell dmsnell force-pushed the compat/add-html-api-6-6 branch from d8d6efa to 750f1db Compare July 3, 2024 17:36
@dmsnell dmsnell merged commit 750f1db into trunk Jul 3, 2024
61 checks passed
@dmsnell dmsnell deleted the compat/add-html-api-6-6 branch July 3, 2024 18:46
@github-actions github-actions bot added this to the Gutenberg 18.8 milestone Jul 3, 2024
carstingaxion pushed a commit to carstingaxion/gutenberg that referenced this pull request Jul 18, 2024
Updates the HTML API components in the compatability layer with updates
from each of the 6.4, 6.5, and 6.6 branches from Core.

Notably, because of the breaking change in 6.5 to the `WP_HTML_Span` and
`WP_HTML_Text_Replacement` classes, which changed the range format from
`(start, end)` to `(start, length)`, the 6.6 classes still reference the
`Gutenberg_HTML_Span_6_5` and `Gutenberg_HTML_Text_Replacement_6_5`
substitutions.

While updating it was noticed that the 6.4 compatability code
accidentally pulled in updates from the 6.5 branch for the HTML
Processor. These additions have been removed for the sake of closer
correspondance with the Core code.

Co-authored-by: ockham <bernhard-reiter@git.wordpress.org>
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.

2 participants