Skip to content

Move defineElement elsewhere? #431

@domenic

Description

@domenic

Given the variety of proposals for new custom element related methods that are starting to fly around (e.g. #419 and #427 talk about upgrade-related helpers, plus there's always our plans for a registry API #154), we should start considering changes to the top-level API shape, and decide on something ASAP.

I can imagine three possibilities:

  1. document.customElements.define. Everything goes on that object. document.customElements is null for documents without a browsing context.
  2. HTMLElement.define. This makes it a bit clearer things are tied to the browsing context instead of the document. Other things can go there too. Right now the only things on there are a bunch of Node SHOUTY_CONSTANTS.
  3. Punt on the problem: stick with document.defineElement, and just be sure to block future proposals on accepting one of the above two, at which point document.defineElement becomes an alias for one of those. This might not be feasible depending on how Custom elements disconnected from a document should not be upgraded #419 goes.

@annevk @rniwa @travisleithead thoughts?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions