Skip to content

feat(jsx): attr: / prop: prefixes#6575

Merged
johnjenkins merged 17 commits intomainfrom
jsx-attr-prop
Feb 1, 2026
Merged

feat(jsx): attr: / prop: prefixes#6575
johnjenkins merged 17 commits intomainfrom
jsx-attr-prop

Conversation

@johnjenkins
Copy link
Contributor

@johnjenkins johnjenkins commented Jan 30, 2026

What is the current behavior?

Devs cannot choose if and when to set an attribute (ele.setAttribute('something', 'value')) or a property (ele.myProp) within Stencil's JSX.

Instead, Stencil uses slightly opaque heuristics about when to do either.

What is the new behavior?

Devs can now explicitly set attributes or properties on components via attr:* or prop:* on jsx tags.

Additionally

  • Stencil IntrinsicTypes generated for components are explicitly typed with attr:* and prop:* on those decorated @Prop() members that are naturally able to have an attribute.
  • Component types for properties that are required - (e.g. @Prop() something!: string;) - accept either attr:* or prop:* variants (e.g. attr:someting or prop:something)

Documentation

Does this introduce a breaking change?

  • Yes
  • No

Testing

Other information

@johnjenkins johnjenkins requested a review from a team as a code owner January 30, 2026 16:17
@johnjenkins johnjenkins merged commit aa599da into main Feb 1, 2026
69 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant