Understanding the 'normalize' Loader hook

Kevin Smith zenparsing at gmail.com
Tue Aug 12 15:21:52 PDT 2014

> Ah, fascinating. So basically:
>  - "normalize" does relative URL logic based on the current base URL and
>    the referrer (i.e. the URL of the script doing the importing).
>  - "locate" resolves that URL and adds ".js" (only if the last segment
>    is part of the "path" part of the URL and doesn't contain a "."?).

In my opinion, we should consider the possibility that we have one too many
hooks here.  Why not one hook to resolve a module specifier to an absolute
URL, given a base URL?  What does the added indirection of an ad hoc global
namespace which maps into the URL namespace buy us?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140812/e036463d/attachment.html>

More information about the es-discuss mailing list