[wp-trac] [WordPress Trac] #53507: Block style version: replace filemtime with version from Block API metadata
WordPress Trac
noreply at wordpress.org
Tue Jun 29 11:54:46 UTC 2021
#53507: Block style version: replace filemtime with version from Block API metadata
-------------------------------------------+---------------------
Reporter: hellofromTonya | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 5.8
Component: Script Loader | Version: 5.5
Severity: normal | Resolution:
Keywords: has-patch dev-feedback commit | Focuses:
-------------------------------------------+---------------------
Comment (by gziolo):
> With this patch, non-Core blocks would use the WordPress version unless
a version was supplied in the blocks.json file.
Yes, this should work as intended, and it is simple enough to include as
the last-moment fix for WordPress 5.8 release.
> I did some spot checking of blocks in the directory, and I did not find
any with version defined as a top level field in blocks.json.
Correct. There is `apiVersion` but it's related to the change introduced
in WordPress 5.6 (https://make.wordpress.org/core/2020/11/18/block-api-
version-2/) and it has a completely different purpose related so far to
the client-side implementation of the block.
If we assume that the `version` is similar to what plugin authors provide
as the version in the metadata, we could consider going a step further. In
the future, we could make the `version` also a field on the
`WP_Block_Type` object and include it in the REST API endpoint for block
types. In general, it would go in the direction I proposed in #53149 -
feed `block.json` with all fields that are now provided in the PHP file as
plugin metadata like plugin version, min PHP version, license information,
etc.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/53507#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list