Harmony modules feedback

Wes Garland wes at page.ca
Tue Jan 17 09:28:53 PST 2012


On 16 January 2012 14:20, Andrea Giammarchi <andrea.giammarchi at gmail.com>wrote:

> var module = require("module");
>
> is totally fine but
>
> require("module", function (module) {
>   // is totally fine too
> });
>
> latter could be synchronous in node.js and asynchronous in the web, who
> cares, as long as it scales for all scenarios ... don't you agree?
>

One fundamental difference between how AMD modules and CommonJS modules
(presumably Node) load is that CommonJS modules have lazy initialization,
whereas AMD modules have eager initialization.

This is probably where some of the Node<>AMD "impedance mismatch" is coming
from -- in CommonJS with Modules/1.0 on the server side, developers expect
to be able to perform certain types of initialization when the module is
loaded, and they do not expect to need to pre-declare their modules.

It will be interesting to see how the addition of ES.Next modules plays out
with the server-side JS communities.

Wes

-- 
Wesley W. Garland
Director, Product Development
PageMail, Inc.
+1 613 542 2787 x 102
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120117/65bc962f/attachment.html>


More information about the es-discuss mailing list