[dojo-contributors] Module formats for the browser

Eugene Lazutkin eugene at lazutkin.com
Fri Mar 26 12:37:24 EDT 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

You should be more specific on how you want to do that.

1) Mechanical inclusion of two different loaders in the base?

2) Adding loaders as modules? How?

3) Reworking one or both loaders to support two paradigms?

4) Cost estimates? (space/time)

A simplistic prototype would help a lot of people get a feel of the
proposal.

Eugene

On 3/26/10 11:29 AM, Kris Zyp wrote:
> 
> 
> On 3/26/2010 9:56 AM, Eugene Lazutkin wrote:
>> I think everybody is in agreement that we want to have interoperability
>> with XXX library as a separate plugin somewhere in DojoX. Obviously XXX
>> can be CommonJS too. (I assume that there is a wealth of modules in this
>> format that our users want to use --- I didn't really check.)
>>
>> Regarding RequireJS --- it is not backward compatible with what we have,
>> so until this situation changes it cannot be introduced before 2.0.
> 
> In my proposed migration path, I suggested adding RequireJS and
> retaining dojo.require support for 1.x. How does that break backwards
> compatibility? Perhaps I should have explicitly stated that as a
> corrolary to keeping dojo.require that we also need to retain our global
> namespaces. I think we could move to defining modules with something
> like this for 1.x:
> 
> require.def("dijit/Tooltip", ["dijit/_Widget"], function(_Widget){
>   return dojo.declare("dijit.Tooltip", [_Widget], {
>     ...
>   }
> });
> 
> And then you can do:
> 
> require.async("dijit/Tooltip", function(Tooltip){
>   dijit.Tooltip == Tooltip // is true
> });
> 
> or:
> dojo.require("dijit.Tooltip");
> dijit.Tooltip -> // works like it always has
> 
> And in 2.0 we could move to:
> require.def("dijit/Tooltip", ["dijit/_Widget"], function(_Widget){
>   // perhaps always retain the dojo.* namespace:
>   return dojo.declare([_Widget], { // anonymous declaration
>     ...
>   }
> });
> 
> require.async("dijit/Tooltip", function(Tooltip){
>   // Must use Tooltip variable
> });
> 
> Kris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkus4sQACgkQY214tZwSfCvVewCgqCahugrcGTABnFNwD+jC1ZQx
UfUAoJKxEaSocKRYSIdL2Hn7YEy7tv3B
=EknI
-----END PGP SIGNATURE-----


More information about the dojo-contributors mailing list