Skip to content

Problem with mdc.componenets.customElements implementation #481

@Ariges770

Description

@Ariges770

Some time ago, I made a PR which added the ability for MDC to ignore custom elements.

As part of my PR, I included the ability to add a function to the isCustomElement which mirrors how you ignore a custom element in Vue. However, this ability was substituted with a new key mdc.componenets.customElements which is an array of tags which will be ignored MDC.

Problem

While the addition of the updated feature is a much appreciated improvement, when using MathJax CHTML, many custom elements (over 1400 elements) are injected and being able to include a catch all function to ignore all of them is much more readable and easier to implement.
Furthermore, the warning provided when using custom elements which aren't ignored by MDC indicates that the problem can be resolved through the isCustomElement variable which can somewhat mislead devs who see this for the first time.

[Vue warn]: Failed to resolve component: mjax-col                                                   
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.

Proposal

While I understand my proposed PR may not be a viable approach, I would appreciate if the ability to define a function to ignore custom elements was added as it can help handle a large number of custom elements with a simple catch all function which is extremely useful in the case of MathJax.

If such a solution is not possible, I can try and develop and publish a function which will generate every possible tag used by MathJax, which is not trivial as Mathjax doesn't clearly state which elements they use and the css is dynamically generated. However, I still believe that the user should receive some form of warning if they use a custom element which isn't recognised by MDC, telling them how to fix it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions