Re: webcomponents: <import> instead of <link>

On Wed, May 15, 2013 at 11:03 AM, Dimitri Glazkov <>wrote:

> On Wed, May 15, 2013 at 10:59 AM, Jonas Sicking <> wrote:
> > On Wed, May 15, 2013 at 10:21 AM, John J Barton
> > <> wrote:
> >>
> >>
> >>
> >> On Tue, May 14, 2013 at 8:04 PM, Jonas Sicking <>
> wrote:
> >>>
> >>> Apparently I wasn't clear enough before.
> >>>
> >>> We shouldn't add dynamically updating imports of components just
> >>> because we're choosing to reuse <link>. We add dynamic imports if
> >>> there are use cases.
> >>>
> >>> So far no-one has presented any use cases.
> >>
> >>
> >> Sorry if this is out-of-context, but as far as I can tell you are
> proposing
> >> that demand-loading of Web components for Web apps is not a valid
> use-case
> >> for components.
> >
> > That's not what I'm proposing. What I'm saying is that unloading of a
> > component document is not a use case.

I agree that unloading a component document is not a high-priority use case.

> I.e. using <link> to point to
> > URL A and wait for it to load the components in A. Then change the
> > <link> to point to URL B and have it unload the components from A and
> > instead load the components in B.
> >
> > This is how stylesheets work if you dynamically modify a <link> from
> > pointing at A to pointing at B.

And the same logic could apply to web-components. However the consequences
need not be similar.

When you remove a stylesheet you remove rules from an active rule set. The
only reason is history. Historically we had poor JS control over CSS so we
did not manipulate the CSS rule set. This meant 1) unloading the stylesheet
had some utility and 2) removing the corresponding rules makes some sense.
 If we had a lot of JS operating on CSS, then we would consider CSS rule
removal with stylesheet unloading to be a horrible mistake.

Unloading web-components need not follow that path. Unloading could simply
mean un-registering the component so no new instances of that component
could be created. Would that be horrible? I don't think so. The next
attempt to create that component instance simply falls over.

> > I definitely agree there are use cases for at some point after a
> > document has finished loading, loading components from url A, and
> > again at a yet later point loading components from URL B.
> I think unloading components (unregistering custom elements, to be
> precise), is out of questions and never should be on the table. In
> fact, we have a separate table for that -- it's in a dark, scary place
> with eternal burning fire, where all bad ideas go after they die.

If web-components are meta objects for creating instances, then unloading
is a marginal-value idea. Else there is something more to understand...
What makes unloading apocalyptically bad?


> :DG<

Received on Thursday, 16 May 2013 17:57:54 UTC