id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc,focuses
15833,Script concatenation fails to take external dependencies into account.,jczorkmid,,"Script concatenation places the concatenated script include first, before any scripts loaded separately. If one of the scripts in the concatenation relies on a script outside the concatenation the dependency order is ignored.
When the dependencies are all internal to the concatenation things work fine (for example script4 relies on script3):
* concat=script1,script2,script3,script4,script5
But when script3 is loaded externally, script4 will break:
* concat=script1,script2,script4,script5
* external-script3
This becomes apparent if jQuery is loaded from a non-standard location (via a plugin or the [http://codex.wordpress.org/Function_Reference/wp_enqueue_script#Load_a_default_WordPress_script_from_a_non-default_location code from the Codex]) in that the visual editor fails to function correctly because source:/trunk/wp-admin/js/editor.js uses jQuery (which it fails to register as a dependency, see ticket:15830, but when I fixed that locally the results were the same).
I'm working around this in [http://wordpress.org/extend/plugins/use-google-libraries/ Use Google Libraries] by globally disabling concatenation, but it would be nice if this was fixed.
If possible, it would be nice if the loader was smart enough to do something like:
* concat=script1,script2
* external-script3
* concat=script4,script5
Or at least flagged the script with the dependency as unsafe for concatenation:
* concat=script1,script2,script5
* external-script3
* script4
",defect (bug),new,normal,Future Release,Script Loader,3.0,normal,,,,