Re: [WICG/webcomponents] Interaction between imperative slotting and declarative shadow DOM (Issue #967)

There is an impedance mismatch here, somewhat similar to scoped registries, but more tractable to a purely declarative solution...

I think, like proposed for scoped registries, the `slotAssignment` option can be represented as an attribute on `<template shadowroot` to at the very lease keep the fallback content from showing until script takes over.

> I wonder if there is a way to serialize imperative slot API though

The naive thing, and maybe even quite practical in SSR systems, is to write the slot attribute back onto the children - but we obviously don't want to modify children and don't have a way to switch from declarative to imperative slotting. Children don't have to have IDs, but element ordering should be pretty stable to use for SSR, so maybe `<slot>` can have an attribute that's the index of the child nodes assigned to it? This could allow text nodes to be assigned too.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/WICG/webcomponents/issues/967#issuecomment-1229096711
You are receiving this because you are subscribed to this thread.

Message ID: <WICG/webcomponents/issues/967/1229096711@github.com>

Received on Saturday, 27 August 2022 01:53:16 UTC