WordPress / gutenberg

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

Style variation cache not cleared with WP_DEVELOPMENT_MODE set to theme #60399

Open mikemcalister opened 4 months ago

mikemcalister commented 4 months ago

Description

When developing a theme, it is handy to have define( 'WP_DEVELOPMENT_MODE', 'theme' ); defined so your theme.json styles don't get cached. While this works for theme.json, it doesn't seem to clear the cache for style variations in the /styles folder.

The only way I can get the cache to clear is by going to Editor → Styles and clicking another style and clicking back. Ideally using the theme development mode should clear all .json caches.

Step-by-step reproduction instructions

  1. Add a style variation in the /styles folder.
  2. Add a button and set the color to an accent color.
  3. In your style variation, override the accent color with something like #000 and save.
  4. Visit the browser and refresh the page.

Screenshots, screen recording, code snippet

No response

Environment info

WordPress 6.5

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

Yes

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

Yes

colorful-tones commented 4 months ago

Curious, does define( 'SCRIPT_DEBUG', true ); work?

mikachan commented 3 months ago

Some related issues with further discussion: https://github.com/WordPress/gutenberg/issues/43395 & https://github.com/WordPress/gutenberg/issues/46397