[wp-trac] [WordPress Trac] #50328: Enqueue script and style assets only for blocks present on the page

WordPress Trac noreply at wordpress.org
Thu Jul 2 15:11:07 UTC 2020


#50328: Enqueue script and style assets only for blocks present on the page
-------------------------+-------------------------
 Reporter:  aduth        |       Owner:  gziolo
     Type:  enhancement  |      Status:  assigned
 Priority:  normal       |   Milestone:  5.5
Component:  Editor       |     Version:
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:  javascript
-------------------------+-------------------------

Comment (by gziolo):

 @westonruter, it all edge cases makes me wonder whether the initial
 approach proposed by @aduth wouldn't be more reliable in the majority of
 cases. Plugin developers can always opt-out from using `style` or `script`
 when registering a block and handle everything themselves.

 Shouldn't we seek for an alternative proposal that would make it easier to
 print CSS or JS inside the rendered block?

 There is also this question @matveb asked about sites with infinite
 scrolls and how it would work with the current proposal:
 https://github.com/WordPress/gutenberg/issues/21838#issuecomment-620586710

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


More information about the wp-trac mailing list