W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2013

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

From: Dimitri Glazkov <dglazkov@google.com>
Date: Wed, 13 Mar 2013 09:36:36 -0700
Message-ID: <CADh5Ky1qK-rYpkqiWpgSBppqDpCWjkn5wMQ-EGjhTmqTHxHGxw@mail.gmail.com>
To: Anne van Kesteren <annevk@annevk.nl>
Cc: public-webapps <public-webapps@w3.org>
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 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:58 GMT