[wp-trac] [WordPress Trac] #63254: Introduce development mode for block editor styles
WordPress Trac
noreply at wordpress.org
Fri Apr 18 12:47:12 UTC 2025
#63254: Introduce development mode for block editor styles
-------------------------------------+------------------------------
Reporter: helgatheviking | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Editor | Version:
Severity: normal | Resolution:
Keywords: has-patch needs-testing | Focuses:
-------------------------------------+------------------------------
Comment (by gziolo):
That would be great to fix it. I think the logic should be unified between
JS and CSS assets. Something like that should work best:
{{{#!php
<?php
$default_version = SCRIPT_DEBUG ? time() : false;
$block_version = isset( $metadata['version'] ) ? $metadata['version'] :
$default_version;
$script_version = isset( $script_asset['version'] ) ?
$script_asset['version'] : $block_version;
}}}
This would cover all possible cases including where the `block.json` and
`script.asset.php` don't contain tje `version` property. For styles,
everything should look exactly the same but for the style asset when
defined. However, it could be break down into two steps as today, reading
style asset is not covered. The related issue is tracked in Gutenberg:
https://github.com/WordPress/gutenberg/issues/56838.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/63254#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list