Loader Hooks

Calvin Metcalf calvin.metcalf at gmail.com
Wed Jul 2 05:58:56 PDT 2014


Another helpful place for a hook might be an executeDependencies type
thing, currently the list of dependencies returned by instantiate are all
loaded and ensureEvaluated is run on them, this makes sense for ES6 modules
which always evaluate all dependencies before the module that depends on
them, but it means you can't do an alternative evaluation strategy like
running ensureEvaluated when the module is imported in the code (when using
loading a module from some other system that works that way obviously),
currently it's impossible to do that without loading your dependencies
through some side channel which would likely break static checking of those
dependencies.



On Tue, Jun 24, 2014 at 2:16 PM, Juan Ignacio Dopazo <jdopazo at yahoo-inc.com>
wrote:

>
>
>
>  On Tuesday, June 24, 2014 11:38 AM, Calvin Metcalf <
> calvin.metcalf at gmail.com> wrote:
>
>  Say you wanted to add a hook which automatically added an export named
> filepath to a module is the path to the file
>
>   For this use case and other similar ones it'd be nice if the `metadata`
> property of load records would be exposed as part of the modules metadata
> in `this` or `Reflect.currentModule()`.
>
>  or add an import just for the side effects (say a shim or something)
>
>  We've been discussing conditional loading for shims and other similar
> stuff at https://github.com/systemjs/systemjs/issues/9.
>
> Juan
>
>
>
>


-- 
-Calvin W. Metcalf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140702/8daed82e/attachment.html>


More information about the es-discuss mailing list