List View: Speed up opening by removing a forced style recalculation - #80929
Conversation
cd5cb5a to
861514a
Compare
|
Size Change: -29 B (0%) Total Size: 7.76 MB 📦 View Changed
|
|
Flaky tests detected in 861514a. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/30528988137
|
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Did a combined run of all three PRs, perf improvement is almost 50% - #80984. Screenshot
|
andrewserong
left a comment
There was a problem hiding this comment.
Oh clever! Yeah, we're only ever passing a string to this, so this feels like a safe change, and it's testing just as on trunk in Firefox with Voice Over on Mac for me.
|
Thanks for testing, @andrewserong 🙇 |

What?
PR replaces the imperative
textContentself-assignment inAriaReferencedTextwith akeyon the element, so React replaces the node instead of updating its text in place.Why?
AriaReferencedTextrenders once per List View row. ItsuseEffectsettextContenton the node after every commit, invalidating the style for the whole document. Because that write lands between layout reads, the next reader pays for a full style recalculation, twice per open.Testing Instructions
Same as in #51035.
Testing Instructions for Keyboard
Same.
Screenshots or screencast
The last two Perf checks on run CI for
listViewOpenmetric.Use of AI Tools
Assisted by Claude.