Re: [webcomponents]: de-duping in HTMLImports

Duplicate fetching is not observable, but duplicate parsing and duplicate
copies are observable.

Preventing duplicate parsing and duplicate copies allows us to use
'imports' without a secondary packaging mechanism. For example, I can load
100 components that each import 'base.html' without issue. Without this
feature, we would need to manage these dependencies somehow; either
manually, via some kind of build tool, or with a packaging system.

If import de-duping is possible, then ideally there would also be an
attribute to opt-out.

Scott


On Tue, Apr 9, 2013 at 11:08 AM, Dimitri Glazkov <dglazkov@google.com>wrote:

> The trick here is to figure out whether de-duping is observable by the
> author (other than as a performance gain). If it's not, it's a
> performance optimization by a user agent. If it is, it's a spec
> feature.
>
> :DG<
>
> On Tue, Apr 9, 2013 at 10:53 AM, Scott Miles <sjmiles@google.com> wrote:
> > When writing polyfills for HTMLImports/CustomElements, we included a
> > de-duping mechanism, so that the same document/script/stylesheet is not
> (1)
> > fetched twice from the network and (2) not parsed twice.
> >
> > But these features are not in specification, and are not trivial as
> design
> > decisions.
> >
> > WDYT?
> >
> > Scott
> >
>

Received on Tuesday, 9 April 2013 19:17:30 UTC