[wp-trac] [WordPress Trac] #54018: Allow scripts registered via block.json to be enqueued in the footer

WordPress Trac noreply at wordpress.org
Wed Jul 19 17:26:32 UTC 2023


#54018: Allow scripts registered via block.json to be enqueued in the footer
---------------------------+--------------------------
 Reporter:  jeremyfelt     |       Owner:  (none)
     Type:  enhancement    |      Status:  new
 Priority:  normal         |   Milestone:  6.4
Component:  Script Loader  |     Version:
 Severity:  normal         |  Resolution:
 Keywords:  has-patch      |     Focuses:  performance
---------------------------+--------------------------
Changes (by westonruter):

 * milestone:  Awaiting Review => 6.4


Comment:

 Are there any cases where a block view script ''has'' to be executed in
 the `head`? If not, instead of moving block view scripts to execute in the
 footer, as has been suggested on
 [https://github.com/WordPress/gutenberg/pull/52536 gutenberg#52536], how
 about keeping them in the `head` but add the `defer` attribute? This will
 allow early discovery of the block scripts to start loading early, but
 then their execution will still be delayed until the DOM has loaded, thus
 not impeding LCP.

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


More information about the wp-trac mailing list