[wp-trac] [WordPress Trac] #53375: Loading separate core block assets tries to load stylesheets on blocks that dosn't have styles

WordPress Trac noreply at wordpress.org
Tue Jun 22 16:18:04 UTC 2021


#53375: Loading separate core block assets tries to load stylesheets on blocks that
dosn't have styles
--------------------------+---------------------
 Reporter:  walbo         |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  5.8
Component:  Editor        |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+---------------------

Comment (by hellofromTonya):

 Code Review of [https://github.com/WordPress/wordpress-develop/pull/1370
 PR 1370]:

 - Remove the loose implicit conditionals and replace with explicit
 conditional. My suggestion is to add a new variable called
 `$has_style_file`. See notes in the PR.

 - @desrosj and I discussed `filemtime()` for non-core blocks.

 I'm not seeing another dynamic way of setting a version number for these
 non-core blocks without checking the stylesheet's modification time. Non-
 dynamic ways would require adding a version to the metadata or opening the
 file and reading a version annotation (significantly less performant than
 `filemtime`. IMO `filemtime()` is the best route for dynamic versioning to
 ensure the browser requests the newest version of the non-core asset from
 the server.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/53375#comment:16>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list