Skip to content

[element] Scoped element registrations #30

@justinfagnani

Description

@justinfagnani

We need to support the upcoming scoped custom element registry spec.

A few things to do:

  • Make <h-define-element> able to be non-self-registering
  • Allow <h-define-element> to register elements within a scope. This probably looks like an element that can reference a constructor in various ways:
    • An id to another <h-define-element>
    • A module specifier/export combo
    • A Heximal expression
    • An HTML import and id reference
  • Allow main document registrations of non-self-registering elements. This can probably use the same element as in <h-define-element>
  • Possibly scope main document registrations within <h-scope>. The new scoped custom element registry spec allows this.

We will end up having two element definition-related elements: one declares the constructor, the other registers the element. Along with #26 maybe we have <h-define> and <h-register>. The corresponding JSs APIs are a class declaration and CustomElementRegistry.define() though, so maybe we want <h-declare> (make the class) and <h-define> (register the element). We'll need to ask potential users what's the most clear.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Help WantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions