Mochabot log - CommonJS IRC channel: #commonjs on irc.freenode.net

2011-01-12:

[19:26] <khs4473> The proper use of injection? module.load("a", "b", "c", function(a, b, c) {});
[19:33] <Wes-> khs4473: You can't inject exports into a loaded module without initializing the module, which means you're initializing it before the first call to require, which in turns means you're violating existing CommonJS semantics
[19:39] <khs4473> True. In effect though, you are calling require, just in it's async/callback form. More...
[19:40] <khs4473> Some ideas: Both Modules 1.1 -and- AMD conflate dynamic and static dependencies.
[19:41] <khs4473> So in Modules 1.1 you have people doing try { require(...); } which is crazy talk
[19:42] <khs4473> In AMD, everything is dynamic - that comes from RequireJS's history as a script tag loader
[19:45] <khs4473> static and dynamic need to be separated so that we can reliably do static analysis while still allowing for runtime dependencies, checking for modules at runtime, etc.

 

 

Logs by date :