Re: [webcomponents]: First stab at the Web Components spec

On Wed, Mar 13, 2013 at 5:41 AM, Anne van Kesteren <annevk@annevk.nl> wrote:

> On Tue, Mar 12, 2013 at 4:53 PM, Dimitri Glazkov <dglazkov@google.com>
> wrote:
> > Yup, been doing this for a while now. The stylesheet-like behavior seems
> to
> > have settled as the least evil of the compromises. It's an
> over-constrained
> > problem, as usual :)
>
> If applications have issues with performance because of this today,
> how is increasing the number of external resources that exhibits this
> behavior going to help?
>

I am glad you're asking this question. It's been burning in the back of my
head for years now and I haven't gotten many good answers.

If we make components load completely asynchronously, we will have the
problem of creating instances of custom elements whose definitions haven't
loaded yet. The only solution to that problem is element upgrade (that is,
the equivalent of renameNode), and it will most definitely eat all (and
more) of your performance gains from asynchronous loads.

At least, with stylesheet-like load, a webdev can use good judgement and
take advantage the fact that the components are fetched and processed
asynchronously.

The sad truth is that most apps will probably choose to inline most (if not
all)  component documents into the master document for their production
builds. At this point, I am primarily hoping to help in 2 ways:

1) make it possible to achieve nice modularity in a development (or any
other non-mission critical) build, so that the webdevs don't need to use
complex and varying packaging shims that often use document.write and other
crazy hacks to get the right behavior;

2) make inlining as close to just concatenating files as possible.


>
> What's the scenario if there's a <script> before <link rel=component>
> or you insert <link rel=component> at some later point in time?
>

<script> before <link rel=component> is fairly straightforward, right?
<script> runs first, then <link rel=component> is fetched.

Dynamically inserting <link rel=component> is interesting. Logically, it
should be equivalent to synchronously fetching and processing the component
document.

:DG<

Received on Wednesday, 13 March 2013 16:37:10 UTC