[wp-trac] [WordPress Trac] #36392: wp_add_inline_script() breaks script dependency order when using script loader (no SCRIPT_DEBUG)

WordPress Trac noreply at wordpress.org
Fri Apr 8 23:40:26 UTC 2016


#36392: wp_add_inline_script() breaks script dependency order when using script
loader (no SCRIPT_DEBUG)
--------------------------------------+-------------------------
 Reporter:  westonruter               |       Owner:  swissspidy
     Type:  defect (bug)              |      Status:  assigned
 Priority:  high                      |   Milestone:  4.5
Component:  Script Loader             |     Version:  trunk
 Severity:  major                     |  Resolution:
 Keywords:  has-unit-tests has-patch  |     Focuses:
--------------------------------------+-------------------------

Comment (by jeremyfelt):

 Replying to [comment:26 swissspidy]:
 > > If we *must* have "right before" and right after" scripts, thinking
 the only "sane" way would be to disable concatenating when they are used.
 > > Also, looking forward to the time we stop concatenating scripts and
 stylesheets because of HTTP/2 :)
 >
 > I explored many options today and everything eventually comes back to
 this. HTTP/2 is an argument as well.

 I think we need a patch that does this.

 > However, are we confident in disabling concatenating in this case? Will
 this confuse developers expecting concatenated scripts all the time?

 If a developer uses `wp_add_inline_script()` on a core script that is
 normally concatenated, then they are asking for more granular control of
 those scripts.

 Printing them individually is a sane way to maintain that control **and**
 is what we should be thinking about for HTTP/2. We don't have to worry
 about front-end scripts here and this is a new feature, so I think we can
 be confident with that route.

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


More information about the wp-trac mailing list