On Tuesday, November 17, 2015 at 7:17:00 PM UTC+2, Aria Stewart wrote: > Indeed that is difficult: the way most people solve it now is with > webpack or browserify, where the requires are done statically, at build > time, not at runtime. There's a few modules where that won't work, but for > the most part it's a workable way. > > OK. I was trying to do it on-the-fly, but I suppose I could look at just bundling everything up, or maybe have different bundles for different situations, or... (sigh).
> You really don't want to be blocking the browser interaction thread, so > synchronous is in fact not good there (though you're likely only doing it > at startup time), and requests have a real cost in latency, especially > unparallelized like a synchronous interface will allow you to do. > The only other ideas I had were (a) to fork it off into a separate thread (which I could do easily in Java, but in JS... maybe use setTimeout? I don't know enough about the JS threading model) (b) write my own version of "require" which injects a <script> node into the DOM tree and let the browser do the loading rather than using XHR... Either way it seems I would have to figure out a way to notify the main thread when things were ready to roll. (More sighs,) Does any of this sound remotely practical? -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/d5a8884c-b14a-47c9-89b1-0fd2f1c2bb0f%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
