On Tue, May 27, 2014 at 3:04 PM, Ian Hickson <i...@hixie.ch> wrote:
>
>
> On Tue, 27 May 2014, John Barton wrote:
> > On Fri, May 23, 2014 at 5:04 PM, Ian Hickson <i...@hixie.ch> wrote
>
...

>
> > > and how would we hook all the specs together to use it?
> >
> > Define a "System" object for ES6 that implements the ES6 Loader API and
> > extends it to dynamically load CSS and HTML.
>
> Can you elaborate on this? I don't really follow.


TC39, the ES6 folks, have a partial spec for module loading. They have
defined the language elements of a module system and part of the runtime
system, a class called Loader. The instance of Loader used to actually load
modules is not defined except that it is given a name, System. Loading
configuration and customization will happen through the instance. (I
believe the Loader is written up in the ES6 document but not official on
the ES6 roadmap, whatever that means).

I believe the logic here is that each platform must define
normalize/locate/fetch/translate, so the standard specification should also
be done at the platform layer.

I think the Loader nicely isolates these particular functions: I don't see
any urgency in standardizing them. However the delegation of the
specification of System leaves us in the weird place of having everything
except the actually external API spec-ed.   Web folks could almost just say
"Browsers shall have a window.System instance of Loader". There is a
missing part of the Loader spec essential for Web and not very important
for node: bundling for network transmission see
https://github.com/systemjs/systemjs.

But to your original question about non-JS loading: you can extend the
Loader class to add methods for CSS and HTML.  These would be a cache in
front of xhr for the most part, hence my suggestion that implementation
(GitHub) is a good place to start.   The next step, and one quite critical
to practice, is integration with bundling.  Here practical expertise is
essential so again implementation would be a critical guide.  There exist
solutions in the pre-ES6 space to consult as well.

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

Reply via email to