WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
9.99k stars 4.02k forks source link

Outline button variation slow-load styles in TT4 #62668

Closed bgardner closed 1 day ago

bgardner commented 2 weeks ago

Description

Likely a bi-product of work done in https://github.com/WordPress/gutenberg/issues/62451, there seems to be a lag during the styling in the editor (on page load) for buttons with the outline variation. (Original issue was fixed, now the lag exists)

Step-by-step reproduction instructions

  1. Go to a post or page and add the buttons block.
  2. Create a button, apply Outline variation.
  3. See bug.

Screenshots, screen recording, code snippet

https://github.com/WordPress/gutenberg/assets/486261/ba34769f-fbc6-4efb-ab4d-aaaed3b23cfd

Environment info

WordPress 6.6 beta3 (Gutenberg NOT active) Issue goes away with Gutenberg 18.5 active.

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

No

bgardner commented 2 weeks ago

cc: @aaronrobertshaw @ellatrix

aaronrobertshaw commented 2 weeks ago

Thanks for flagging this @bgardner 👍

I'm not sure what the cause is yet however it does appear isolated to the post editor as there is no styling flash in the site editor. My hunch is the variation styling in the post editor relies on global styles data set in the editor settings which is likely loaded asynchronously causing the delay.

bgardner commented 2 weeks ago

@aaronrobertshaw Can confirm the site editor does not experience the lag. Can you confirm the lag in the post editor on your end?

aaronrobertshaw commented 2 weeks ago

Can you confirm the lag in the post editor on your end?

Yes, I tested this before making my prior comment that the issue is isolated to the post editor.

I've checked with and without Gutenberg active using the latest 6.6 beta.

justintadlock commented 2 weeks ago

I was just coming to report this. I'm always seeing this flash of the wrong style when loading the Post Editor.

bgardner commented 1 week ago

Maybe we can get this resolved in RC2?

aaronrobertshaw commented 3 days ago

I'd like to think we can come up with something for this as quickly hacking around providing the global styles data from the server side initially, as a fallback, successfully prevented the flash of styles.

It will need some deeper thought though to be able to come up with a proper solution that doesn't negatively impact performance too much.

aaronrobertshaw commented 2 days ago

I have a potential fix for the flash of variation styles in the post editor up in https://github.com/WordPress/gutenberg/pull/63071.