Skip to content

Remove compat function for unsupported unprefixed style states - #84531

Merged
tellthemachines merged 4 commits into
trunkfrom
remove/unprefixed-state-helper
Oct 13, 2026
Merged

tellthemachines merged 4 commits into
trunkfrom
remove/unprefixed-state-helper

Conversation

@tellthemachines

Copy link
Copy Markdown
Contributor

What?

Removes gutenberg_resolve_style_state_aliases and all its calls. This function was introduced in #79210, before style states shipped to core, and it was meant to provide temporary back compat for unprefixed states for two Gutenberg plugin releases only. We can remove it now!

Testing Instructions

Add some style states (viewport and/or pseudo) to some blocks, save and ensure everything displays as expected on the front end.

Use of AI Tools

copilot + gpt-6 luna used. reviewed by me.

@tellthemachines tellthemachines self-assigned this Oct 12, 2026
@tellthemachines tellthemachines added the [Type] Code Quality Issues or PRs that relate to code quality label Oct 12, 2026
@tellthemachines tellthemachines added the [Feature] Style States Related to block style states (currently viewport and pseudo-states) label Oct 12, 2026
@github-actions github-actions Bot added the [Package] Block library /packages/block-library label Oct 12, 2026
@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

🎉 Props

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: tellthemachines <isabel_brison@git.wordpress.org>
Co-authored-by: talldan <talldanwp@git.wordpress.org>
Co-authored-by: ramonjd <ramonopoly@git.wordpress.org>

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

Updated as activity occurs, without notifying anyone named here. Add the props-bot label to refresh.

📦 Bundle size

Size Change: -905 B (-0.01%)

Total Size: 8.58 MB

📦 View Changed
Filename Size Change
build/modules/lazy-editor/index.min.js 15.1 kB -157 B (-1.03%)
build/scripts/block-editor/index.min.js 538 kB -168 B (-0.03%)
build/scripts/blocks/index.min.js 46.3 kB -101 B (-0.22%)
build/scripts/edit-site/index.min.js 396 kB -258 B (-0.07%)
build/scripts/editor/index.min.js 648 kB -221 B (-0.03%)

5742afc Run

⚡ Performance

Show the results

Client side metrics exclude the server response time.

front-end-block-theme

Metric ee93344 trunk % Change
timeToFirstByte 53.05 ms +4.05% -2.54% 55.9 ms +11.36% -6.98% -5.1%
largestContentfulPaint 88 ms +9.09% -0% 92 ms +8.7% -6.52% -4.35%
lcpMinusTtfb 35.85 ms +24.83% -5.3% 33.6 ms +21.58% -2.68% 6.7%
wpBeforeTemplate 28.2 ms +5.85% -1.67% 28.34 ms +22.41% -2.01% -0.49%
wpTemplate 20.55 ms +4.96% -2.04% 21.47 ms +7.22% -3.21% -4.29%
wpTotal 49.47 ms +4.02% -3.05% 51.86 ms +10.91% -6.52% -4.61%
wpMemoryUsage 7.59 MB +0% -0% 7.58 MB +0% -0% 0.03%
wpDbQueries 17 +0% -0% 17 +0% -0% 0%

front-end-classic-theme

Metric ee93344 trunk % Change
timeToFirstByte 45.15 ms +7.53% -1.77% 45.55 ms +5.93% -2.31% -0.88%
largestContentfulPaint 100 ms +8% -0% 100 ms +4% -2% 0%
lcpMinusTtfb 55 ms +1.82% -2.82% 53.95 ms +2.78% -3.89% 1.95%
wpBeforeTemplate 26.49 ms +7.93% -2.91% 26.46 ms +5.9% -1.78% 0.11%
wpTemplate 15.83 ms +6.57% -1.96% 16.01 ms +2.5% -2.31% -1.12%
wpTotal 42.18 ms +7.61% -1.83% 42.62 ms +6.34% -2.53% -1.03%
wpMemoryUsage 6.25 MB +0% -0% 6.21 MB +0% -0% 0.65%
wpDbQueries 14 +0% -0% 14 +0% -0% 0%

media-processing

Metric ee93344 trunk % Change
mediaProcessingJpeg 403.6 ms +1.04% -0.16% 400.59 ms +1.26% -0.96% 0.75%
mediaProcessingAvif 6088.64 ms +0.1% -0.08% 6032.27 ms +0.44% -0.16% 0.93%
mediaProcessingJpegToAvif 4198.13 ms +0.23% -0.37% 4172.86 ms +0.23% -0.39% 0.61%

media-upload

Metric ee93344 trunk % Change
jpegUploadProcessing 1454.77 ms +33.77% -2.18% 1413.34 ms +1.87% -0.6% 2.93%
pngUploadProcessing 181.84 ms +19.17% -4.15% 212.52 ms +17.75% -16.96% -14.44%
largeJpegUploadProcessing 1413.42 ms +0.57% -0.49% 1419.14 ms +0.35% -0.84% -0.4%
multipleImageUploadProcessing 1557.02 ms +0.65% -1.12% 1565.36 ms +1.48% -2.26% -0.53%

post-editor

Metric ee93344 trunk % Change
serverResponse 529.88 ms +1.48% -10.71% 516.38 ms +1.18% -5.94% 2.61%
firstPaint 528.89 ms +1.59% -10.56% 458.35 ms +13.2% -38.5% 15.39%
domContentLoaded 1224.05 ms +1.21% -1.47% 1188.85 ms +1.36% -1.44% 2.96%
loaded 1225.7 ms +1.18% -1.47% 1190.35 ms +1.35% -1.45% 2.97%
firstContentfulPaint 528.89 ms +1.59% -7.85% 518.91 ms +1.63% -3.9% 1.92%
firstBlock 3662.15 ms +0.9% -1.64% 3559.04 ms +0.86% -0.58% 2.9%
type 18.75 ms +1.76% -3.47% 17.71 ms +6.95% -4.23% 5.87%
typeWithoutInspector 18.48 ms +4.06% -2.16% 20.16 ms +2.08% -9.52% -8.33%
typeWithTopToolbar 22.84 ms +4.77% -5.25% 25.31 ms +3.28% -6.05% -9.76%
typeContainer 8.91 ms +6.73% -9.09% 9.02 ms +5.1% -9.2% -1.22%
focus 124.12 ms +2.38% -5.78% 123.05 ms +7.11% -7.12% 0.87%
firstFocus 238.23 ms +0% -0% 229.21 ms +0% -0% 3.94%
selectAll 604.04 ms +2.41% -4.91% 586.26 ms +1.12% -1.21% 3.03%
listViewOpen 78.23 ms +5.89% -7.39% 78.01 ms +8.88% -5.42% 0.28%
inserterOpen 40.31 ms +8.53% -7.22% 41.83 ms +3.83% -6.86% -3.63%
inserterHover 11.63 ms +22.53% -6.28% 12.16 ms +11.35% -11.51% -4.36%
inserterSearch 9.03 ms +7.53% -5.98% 8.96 ms +3.57% -3.91% 0.78%
loadPatterns 653.07 ms +3.63% -0.57% 714.75 ms +1.12% -6.77% -8.63%
wpTotal 518.25 ms +1.6% -10.94% 504.85 ms +1.15% -6.03% 2.65%
wpMemoryUsage 13.34 MB +0% -0% 13.31 MB +0% -0% 0.22%
wpDbQueries 54 +0% -1.85% 54 +0% -1.85% 0%

site-editor

Metric ee93344 trunk % Change
serverResponse 493.51 ms +5.26% -5.98% 494.21 ms +4.27% -3.03% -0.14%
firstPaint 264.46 ms +5.73% -10.46% 277.03 ms +20.42% -6.44% -4.54%
domContentLoaded 1244.58 ms +1.94% -0.29% 1252.22 ms +3.12% -0.54% -0.61%
loaded 1245.95 ms +1.93% -0.3% 1253.46 ms +3.13% -0.51% -0.6%
firstContentfulPaint 514.06 ms +1.68% -1.15% 518.39 ms +3.52% -1.66% -0.84%
firstBlock 4664.05 ms +0.62% -0.54% 4653.95 ms +1.25% -1.17% 0.22%
type 18.68 ms +3.27% -4.87% 20.55 ms +5.99% -4.38% -9.1%
navigate 115.65 ms +15.21% -2.48% 134.46 ms +3.99% -9.01% -13.99%
loadPatterns 1323.17 ms +1.02% -3.47% 1390.09 ms +1.13% -3.87% -4.81%
loadPages 998.73 ms +7.23% -0.57% 1072.69 ms +3.06% -1.5% -6.89%
wpTotal 482.8 ms +5.27% -6.18% 481.37 ms +4.86% -2.71% 0.3%
wpMemoryUsage 12.37 MB +0% -0% 12.36 MB +0% -0% 0.07%
wpDbQueries 43 +2.33% -0% 43 +2.33% -0% 0%

5742afc Run

🏁 Flaky tests

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.

pushes earlier threads above the canvas to keep the selected one aligned in /test/e2e/specs/editor/various/block-notes-floating.spec.js, passed after 1 failed attempt.
Error: expect(locator).toBeVisible() failed

Locator: getByRole('region', { name: /^(Notes|Editor settings)$/ }).getByRole('treeitem', { name: 'Note: Four: Comprehensive considerations regarding extraordinarily sophisticated implementation characteristics notwithstanding.' })
Expected: visible
Timeout: 5000ms
Error: element(s) not found

Call log:
  - Expect "toBeVisible" getByRole('region', { name: /^(Notes|Editor settings)$/ }).getByRole('treeitem', { name: 'Note: Four: Comprehensive considerations regarding extraordinarily sophisticated implementation characteristics notwithstanding.' }) with timeout 5000ms
  - waiting for getByRole('region', { name: /^(Notes|Editor settings)$/ }).getByRole('treeitem', { name: 'Note: Four: Comprehensive considerations regarding extraordinarily sophisticated implementation characteristics notwithstanding.' })

    at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/editor/various/block-notes-floating.spec.js:551:4

5742afc Run

@tellthemachines tellthemachines added the No Core Sync Required Indicates that any changes do not need to be synced to WordPress Core label Oct 12, 2026
@ramonjd

ramonjd commented Oct 12, 2026

Copy link
Copy Markdown
Member

Is normalizeStyleStateAliases also a candidate for removal?

@talldan

talldan commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Is normalizeStyleStateAliases also a candidate for removal?

Same question here, or is that for a separate PR? There's also the code in this file - https://github.com/WordPress/gutenberg/blob/trunk/packages/global-styles-engine/src/style-state-back-compat.ts

@tellthemachines

Copy link
Copy Markdown
Contributor Author

Is normalizeStyleStateAliases also a candidate for removal?

Oh yes we should remove that too! No reason not to do it all in the same PR.

@github-actions github-actions Bot added the [Package] Blocks /packages/blocks label Oct 12, 2026
@tellthemachines

Copy link
Copy Markdown
Contributor Author

🧹

@talldan talldan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, very thorough, and nice that this will simplify the codebase in the future!

@tellthemachines
tellthemachines force-pushed the remove/unprefixed-state-helper branch from bc7dc5f to 5742afc Compare October 13, 2026 22:49
@tellthemachines
tellthemachines merged commit fb2f367 into trunk Oct 13, 2026
116 of 117 checks passed
@tellthemachines
tellthemachines deleted the remove/unprefixed-state-helper branch October 13, 2026 23:34
@github-actions github-actions Bot added this to the Gutenberg 24.3 milestone Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Style States Related to block style states (currently viewport and pseudo-states) No Core Sync Required Indicates that any changes do not need to be synced to WordPress Core [Package] Block library /packages/block-library [Package] Blocks /packages/blocks [Type] Code Quality Issues or PRs that relate to code quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants