On Mon, Aug 18, 2014 at 10:43 AM, Ian Hickson <i...@hixie.ch> wrote:
>
>
> On Fri, 15 Aug 2014, John Barton wrote:
> > On Fri, Aug 15, 2014 at 3:41 PM, Ian Hickson <i...@hixie.ch> wrote:
> > > On Fri, 15 Aug 2014, John Barton wrote:
> > > >
> > > > The ES Loader does not maintain a dependency tree. It maintains a
> > > > table of names->modules.
> > >
> > > Maybe I'm misunderstanding the ES6 loader spec. What's the Load Record
> > > [[Dependencies]] list?
> >
> > The dependencies for the Load. Once the load is complete the record is
> > not needed.
>
> How about if the dependencies are changed during the load? For example:
>
>    <script id=a src="a.js" load-policy=when-needed></script>
>

This seems like an unfortunate design choice....


>    <script id=b src="b.js" load-policy=when-needed></script>
>    <script id=c needs="a"> ... </script>
>    <script>
>     // at this point, the script with id=c is blocked waiting for a.js to
>     // load. Let's change its dependencies:
>     document.scripts.c.needs = 'b';
>

...which leads to exotic quirks like this.


>     // now the script needs to trigger b.js to load
>     // a.js' load can be deprioritised (or canceled, if network is at a
>     // premium), and no longer blocks the script from loading
>    </script>
>

System.import already supports dynamic loading with runtime dependency
selection. If you have a problem with it let's discuss that before
redesigning it.

jjb
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to