Re: [WICG/webcomponents] [scoped-registries] Interaction with declarative shadow DOM (#914)

This might be a bad idea—I’m really good at bad ideas—but this feels like a place for a more declarative API (perhaps in addition to the current proposal). If we could name registries and refer to those in the DOM, that could solve for some these issues:

```html
<script>
const registry = new CustomElementRegistry({ name: 'foobar' });

registry.define('x-', class extends HTMLElement {});
</script>
<template shadowroot="open" shadowrootregistry="foobar">
  <x-></x->
</template>
```

Such that the template will look in some global scope for registries with that name or id and only upgrade from that registry. The obvious downside is that it leaks details about scoped registries which might not be desirable. 

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

Received on Saturday, 13 March 2021 20:29:10 UTC