Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit the meaning of "custom element" to not include is #26524

Merged
merged 7 commits into from
Mar 30, 2023

Commits on Mar 30, 2023

  1. Reuse setValueForAttribute for custom properties

    Makes it clearer what the subtle difference is.
    Only do this when the flag is on.
    Otherwise, use setValueForAttribute directly
    sebmarkbage committed Mar 30, 2023
    Configuration menu
    Copy the full SHA
    dbaf987 View commit details
    Browse the repository at this point in the history
  2. Inline createX functions into createInstance in HostConfig

    We don't need the hoistable type to use `is` since that's not supported.
    sebmarkbage committed Mar 30, 2023
    Configuration menu
    Copy the full SHA
    63119e7 View commit details
    Browse the repository at this point in the history
  3. Simplify custom element logic for warnings

    Since we know the namespace in this context, we don't need the special
    list of SVG/MathML tags that have dashes in them.
    
    Any `is` should also have a known type and use lower case for the type tag
    so it's irrelevant for this check.
    sebmarkbage committed Mar 30, 2023
    Configuration menu
    Copy the full SHA
    99daab9 View commit details
    Browse the repository at this point in the history
  4. Warn for updating the is prop in DEV

    This can only be specified once and is really technically part of the key
    just like the tag name. We just don't have a way to model that in React
    so we warn.
    sebmarkbage committed Mar 30, 2023
    Configuration menu
    Copy the full SHA
    c25c735 View commit details
    Browse the repository at this point in the history
  5. Rename isCustomComponent to isCustomElement

    That's the technical term.
    sebmarkbage committed Mar 30, 2023
    Configuration menu
    Copy the full SHA
    a09a9ca View commit details
    Browse the repository at this point in the history
  6. Limit the meaning of "custom element" to not include is

    Effectively this means that you can't use custom properties/events, other
    than the ones React knows about on `is` extensions.
    
    This is unfortunate but there's too many paths that are forked in
    inconsistent ways. I think the solution is to let all React elements set
    unknown properties in the same way as this flag but that's a bigger change
    than this flag implies.
    
    Since `is` is not universally supported yet anyway, this doesn't seem like
    a huge loss.
    
    Attributes still work.
    sebmarkbage committed Mar 30, 2023
    Configuration menu
    Copy the full SHA
    3499590 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    d4e2063 View commit details
    Browse the repository at this point in the history