[PROPOSAL] Lazy loading dependancy system

[PROPOSAL] Lazy loading dependancy system

<div dir="ltr">Hi everyone,
I yesterday commited a lazy loading mechanism for jQuery UI widgets to ui.core.js, but later moved it to the 1.7 branch for now
(since we have a feature freeze right now, and I should discuss completely new features here first).
The mechanism is quite awesome and works like this:
a) The user includes jQuery and ui.core.js
b) and makes sure that in the same folder than ui.core.js, you'll find all other widget files (with correct naming, i.e. ui.draggable.js)
c) then, without inclusion, he can directly use jQuery UI, i.e. $("div").draggable()
This will do the following: Call a stub function that loads ui.draggable.js using getScript and then initializes the widget in the callback.
Although very cool, there are a few things to dicuss / be aware of:
1) The initialization of widgets will be (slightly) asynchroneous. While this will work in almost all usecases, things like $("div").draggable().draggable("disable") won't, and
     this needs to be documented if people use the lazy loading pattern (I think it's really just a matter of good documentation)
2) How do we handle options for the lazy loading? I.e., someone who wants to load remote files / from a whole different path, or with a different naming scheme, i.e. ui.*.min.js?<br clear="all">
--
Paul Bakaus
UI Architect
--
<a href="http://paulbakaus.com">http://paulbakaus.com</a>
<a href="http://www.linkedin.com/in/paulbakaus">http://www.linkedin.com/in/paulbakaus</a>
</div>