Module Loader Comments

Kevin Smith khs4473 at gmail.com
Tue Mar 12 06:12:53 PDT 2013


(Referencing http://wiki.ecmascript.org/doku.php?id=harmony:module_loaders)

When creating a custom loader, I believe there ought to be a way to
fallback to using the parent loader's fetching behavior from within the
fetch hook.  After all, you might want to only override the parent loader's
fetching behavior for a certain subset of resolved URLs.

If that feature is available, then I think we should consider eliminating
the translate hook and instead allow translation semantics to be defined
from within the fetch hook.

- Aesthetically, we should keep the module loading kernel as small as
possible.  Translation is really independent from module loading and we
should probably push the concept of translation up to a higher layer if
possible.

- The current translate hook only provides URLs as input.  This might not
be sufficient in some cases to determine the appropriate translation.  For
example, we might want to use the value of a "Content-Type" HTTP header.
 In such a scenario, the natural place to define that branching logic would
be in the fetch hook, after retrieving the file using (X-Domain) HTTP
requests.

Thoughts?  I could be missing an obvious counter-argument, of course ; )

{ Kevin }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130312/7dc9f5a2/attachment.html>


More information about the es-discuss mailing list