Skip to content

feat(jsx): add global translate attribute to HTMLAttributes - #6808

Merged
johnjenkins merged 4 commits into
stenciljs:mainfrom
erik-gullberg:feat/jsx-translate-attribute
Aug 4, 2026
Merged

feat(jsx): add global translate attribute to HTMLAttributes#6808
johnjenkins merged 4 commits into
stenciljs:mainfrom
erik-gullberg:feat/jsx-translate-attribute

Conversation

@erik-gullberg

@erik-gullberg erik-gullberg commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

What is the current behavior?

Stencil's JSX typings (JSXBase.HTMLAttributes) include the standard global HTML attributes such as dir, lang, hidden, spellcheck, and draggable, but omit the global translate attribute.

As a result, <p translate="no">…</p> fails to type-check in a Stencil component, forcing consumers to work around it by spreading an untyped object.

GitHub Issue Number: #6807

What is the new behavior?

Closes #6807

Adds translate to JSXBase.HTMLAttributes so it is available on every native and custom element, consistent with the other global HTML attributes already present:

translate?: 'yes' | 'no' | (string & {});

Documentation

N/A — this mirrors the existing global HTML attributes already documented via the type definitions.

Does this introduce a breaking change?

  • Yes
  • No

Purely additive to an interface; existing code continues to type-check.

Testing

These JSX attribute typings are validated by TypeScript at compile time and have no dedicated runtime unit test (the same is true for the sibling global attributes like spellcheck, dir, and lang). Verified that:

  • The change compiles.
  • prettier --check passes for the modified file.

@erik-gullberg
erik-gullberg marked this pull request as ready for review August 4, 2026 09:14
@erik-gullberg
erik-gullberg requested a review from a team as a code owner August 4, 2026 09:14

@johnjenkins johnjenkins left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's just make this comment a bit less verbose :)

Comment thread src/declarations/stencil-public-runtime.ts Outdated
Co-authored-by: John Jenkins <johnljenkins@Hotmail.com>
@johnjenkins
johnjenkins enabled auto-merge August 4, 2026 11:33
@johnjenkins
johnjenkins added this pull request to the merge queue Aug 4, 2026
Merged via the queue into stenciljs:main with commit 1626295 Aug 4, 2026
28 checks passed
@erik-gullberg

Copy link
Copy Markdown
Contributor Author

Thank you! @johnjenkins

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.

feat: add global translate attribute to JSX HTMLAttributes typings

2 participants