[wp-trac] [WordPress Trac] #26113: Create a WordPress-specific, dependable reference to the WP-bundled jQuery object.

WordPress Trac noreply at wordpress.org
Tue Nov 19 17:22:32 UTC 2013


#26113: Create a WordPress-specific, dependable reference to the WP-bundled jQuery
object.
--------------------------+------------------------------
 Reporter:  markjaquith   |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Themes        |     Version:
 Severity:  normal        |  Resolution:
 Keywords:                |
--------------------------+------------------------------

Comment (by wonderboymusic):

 This might be a good stop gap, but our thinking about JS as a whole needs
 a reboot. There is a systemic problem of relying on global scope
 everywhere all over WordPress JS code.

 We should really switch to using dependency injection via RequireJS or
 something similar. The NYTimes used a similar stopgap measure to prevent
 stomping - currently uses an `NYTD.jQuery` object equal to the first
 `jQuery` object on the page - great, right? Doesn't stop other code from
 loading jQuery 3-4 times elsewhere (+ 2 Prototypes + a Scriptaculous or
 2). When using AMD + dependency injection, global scope never matters, so
 stomping is rarely possible.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/26113#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list