Skip to content

Move HTML/ARIA property/attribute reflection from ssr-compiler to ssr-runtime #4641

Open
@nolanlawson

Description

@nolanlawson

Right now the property/attribute reflection in the ssr- packages is a bit hairy. I don't think that we need to sniff at runtime which props are present in the component (title, ariaLabel, etc.) – we can just move the known lists of global HTML props / ARIA props to ssr-runtime and put them all on a shared prototype (or similar mechanism). This will simplify the SSR compiler code quite a bit.

Another small bug: calling

this.ariaLabel = undefined
this.title = undefined

(etc)

should result in the corresponding attributes being removed, same as setting null. This is just how HTML IDL attribute reflection works. Currently this is busted for ARIA properties because @lwc/aria-reflection doesn't handle undefined correctly for backwards compat.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions