librelist archives

« back to archive

Nice

Nice

From:
Tom Yandell
Date:
2011-06-21 @ 08:40
Good point (nug). I think the point is that the dependencies would be using
the sync version of require, which would require them to be processed before
being suitable for the browser (requirejs will actually deal with for you by
scanning the function body IIRC, but I don't think this will work across all
mobiles and PS3 so I wont use it). I'd agree with Krys Zyp's comment here:


http://groups.google.com/group/requirejs/browse_thread/thread/68a039882a6ede42/e2e126ab947c0652?hl=en&q=requirejs+kris+zyp+NodeJS+AMD+support#e2e126ab947c0652

..which was where I saw it (" I believe that is huge step forward for
interoperability"). I'm going to switch to authoring modules in this limited
amd form, do a build time (and dev time when browser based development)
process to turn them into modules that can be loaded in the browser
(including all mobiles and ps3). I can then make releases that contain the
node versions (which npm should know what to do with) and the browser
versions.

Thoughts?

Tom



On 21 Jun 2011, at 09:25, Michael Mathews wrote:

+* Only the last argument to `define()` matters.  Other module loaders

+  sometimes use a `define(id, [deps], cb)` pattern, but since this is

+  not relevant in node programs, the other arguments are ignored.


I don't understand how this could work. What if your factory method (cb)
depends on other modules? (Answer: You needs a deps parameter.) And what if
you have multiple defines in a single file? (Answer: You need an id
parameter.) What exactly is meant by "not relevant in node programs"?


Also why wasn't this message sent to the NUG? Or, in other words, why do you
hate The Community, Tom?


On 21/06/2011 08:44, Tom Yandell wrote:

https://github.com/joyent/node/commit/9967c369c9272335bb0343558673b689725c6d7c