Hi James - There's definitely room for collaboration here. As I mentioned in the comments on the commit I'm planning on holding off on jQuery.require() until post-1.4 so that we can really get it right and hopefully standardize a bit. I'll ping you again after the 1.4 dust has settled and we can discuss it some more.
--John On Wed, Dec 16, 2009 at 7:16 PM, James Burke <jrbu...@gmail.com> wrote: > I heard about the jQuery require that is shown as part of this > changeset: > http://github.com/jquery/jquery/commit/998cb005fc378188b3bae319e391d1b7881b7ad2 > > I work on Dojo's module loader, and have a new standalone (no other > library dependency) script loader here: > http://code.google.com/p/runjs/wiki/RunJs > > The goal is to keep RunJS compatible with the goals of CommonJS > (avoiding globals mainly) but still allow for a module syntax that > works well natively in the browser. It does not use XHR calls, just > script tags. Works before page load and after page load. > > It also handles loading regular scripts that are not coded as modules: > > run(["some/script.js", "another/script.js"], function() { > //This callback is fired when both scripts load > }); > > For scripts that do follow the module syntax and have dependencies, it > properly traces the module dependencies and calls the module > definition functions in the correct order. > > It would be ideal if more of the JS libraries started to standardize > on a script loader. I am happy to work out changes to RunJS if jQuery > might find it useful to use. For instance, the entry point does not > have to be called run(), I am considering switching to script() since > it handles general script loading and callbacks when scripts are > loaded. > > It also might be good to pull out a script loader from the core jQuery > library, if only to keep the separation of concerns easier to track. > RunJS has plugins for i18n string bundle loading, and also can load > text files (like HTML snippets) via async xhr, then inline those text > files as part of a build process. > > But I may be misunderstanding the scope of jQuery's require. In any > case, I just wanted to see if there was some common interest and if we > might be able to coordinate our efforts. > > Thanks for your time, > James Burke > > -- > > You received this message because you are subscribed to the Google Groups > "jQuery Development" group. > To post to this group, send email to jquery-...@googlegroups.com. > To unsubscribe from this group, send email to > jquery-dev+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/jquery-dev?hl=en. > > > -- You received this message because you are subscribed to the Google Groups "jQuery Development" group. To post to this group, send email to jquery-...@googlegroups.com. To unsubscribe from this group, send email to jquery-dev+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en.