Skip to content

Check if tag is already in the window.customElements registry on top of checking config ignoredElements #8855

Open
@halybee

Description

@halybee

What problem does this feature solve?

When Vue is mounting, the function isUnknownElement is called and checks, among others, whether the element tag is in the list of ignoredElements. In the context of an app that uses multiple web components, we don't want to manually add every new component's tag to the ignoredElements list. Maintaining that list could quickly become a headache. If the isUnknownElement also checks the custom elements registry, it could figure out that the element in question is not necessarily unknown.

What does the proposed API look like?

The API would stay the same, but on top of checking for config.ignoredElements in the function isUnknownElement, we would also check if window.customElements.get(vnode.tag) is defined or not. If it is defined, then we return false.

I am happy to submit a pull request, I just wanted to discuss this first to make sure there aren't design constraints to adding something like this.

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