tlrobinson / narwhal

[DEPRECATED] A JavaScript standard library, package manager, and more.
http://narwhaljs.org/
372 stars 16 forks source link

[browser] Asynchronous Require #21

Open kriskowal opened 15 years ago

kriskowal commented 15 years ago

Implement a promise-based asynchronous require for dynamically named module requests using either asynchronous XHR and eval (with no global footprint) or script injection (with a global module factory registration system).

isaacs commented 15 years ago

I vote for script injection. XHR would require that all scripts be served from the same server as the initial page, which might not always be optimal, and doesn't seem to have any other benefits.