[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
Sat Apr 9 15:17:11 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 azaozz):

 36392.2.diff looks good here.

 > I got rid of the extra disable_concat property

 Yep, `do_concat` can be reused for this. I mostly added another "toggle"
 as if it is local (at the top of `WP_Scripts::do_item()`) it will act as a
 "break" in concatenating. That would make it work as described above:
 concat scripts as usual, when there is a script with "before" or "after",
 output all already concatenated scripts, then output the current script
 with the extras, and after that continue concatenating. Something to try
 next release :)

 > Since nobody seems to be in favor of reverting the feature...

 I'm actually 51/49 for 36392.2.diff vs. reverting at the moment. That
 change may still bring regression(s) somewhere. Hoping more people will
 look, test, push it today.

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


More information about the wp-trac mailing list