Changing dependencies during the load process.

Ian Hickson ian at hixie.ch
Wed Aug 20 15:23:23 PDT 2014


On Wed, 20 Aug 2014, John Barton wrote:
> > >
> > > The reverse case, where a img depends on a script, is not a use 
> > > case.
> >
> > Why not? What if the image has an onmouseover handler that calls an 
> > API function defined in a module, for instance?
> 
> Then the page depends on the onmouseover handler code and it has a 
> dependency on the module. Images are leaf nodes in the dependency tree.

Can you show me the markup for how you would like this to work? I'm not 
sure I follow what your vision is here.


> > > > > > Or indeed even when scripting is enabled, how would you use it 
> > > > > > to mark one non-loaded script as dependent on another 
> > > > > > non-loaded script such that when you later ask for the former, 
> > > > > > the latter loads automatically?
> > > > >
> > > > > import './latter';
> > > > >
> > > > > It's a solved problem for scripts.
> > > >
> > > > The key part of my question was "non-loaded". The "import" bit is 
> > > > in the script. The script isn't loaded yet, so we can't rely on 
> > > > it.
> > >
> > > <script>
> > > System.import('./former').then((former) => {
> > >   // do stuff with former, knowing './former' imported './latter'.
> > > });
> > > </script>
> >
> > This results in multiple RTTs.
> 
> If you don't want multiple round trips, import from a "bundle".

That doesn't work; see the discussion in this e-mail:
   https://mail.mozilla.org/pipermail/es-discuss/2014-August/038853.html


> > Also, this doesn't wait until former is needed before loading it.
> 
> But the mechanisms for knowing "need" are not available to any one at 
> this point.

Right. I'm trying to set up the groundwork to add such features to HTML.


> I think you are imagining a magical trigger that does not exist.

That more or less summarises my job, yeah. :-)

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'


More information about the es-discuss mailing list