Skip to content

feat(jsx): add fetchpriority attribute to img, link, script, and iframe - #6803

Merged
johnjenkins merged 1 commit into
stenciljs:mainfrom
Burzmalian:feat/fetchpriority-jsx-attributes
Aug 3, 2026
Merged

feat(jsx): add fetchpriority attribute to img, link, script, and iframe#6803
johnjenkins merged 1 commit into
stenciljs:mainfrom
Burzmalian:feat/fetchpriority-jsx-attributes

Conversation

@Burzmalian

Copy link
Copy Markdown
Contributor

What is the current behavior?

The JSX type declarations in stencil-public-runtime.ts do not include the standardized fetchpriority attribute for <img>, <link>, <script>, or <iframe> elements. Using it in a Stencil JSX template produces a TypeScript error.

GitHub Issue Number: #6802

What is the new behavior?

Adds fetchPriority?: 'high' | 'low' | 'auto' and fetchpriority?: 'high' | 'low' | 'auto' to the following JSXBase interfaces:

  • IframeHTMLAttributes
  • ImgHTMLAttributes
  • LinkHTMLAttributes
  • ScriptHTMLAttributes

Both camelCase and lowercase variants are added to match Stencil's existing dual-property convention (e.g. crossOrigin/crossorigin, srcSet/srcset).

Documentation

No documentation changes required — this is a type declaration update only.

Does this introduce a breaking change?

  • Yes
  • No

Testing

The change is a pure type-declaration addition with no runtime behavior. Verified by:

  • Confirming TypeScript accepts fetchpriority="high" / fetchPriority="high" on the affected elements after the change.
  • No existing tests required modification.

Other information

Add the standardized `fetchPriority`/`fetchpriority` attribute (values:
'high' | 'low' | 'auto') to the JSXBase interfaces for IframeHTMLAttributes,
ImgHTMLAttributes, LinkHTMLAttributes, and ScriptHTMLAttributes.

The `fetchpriority` attribute is now a W3C standard that supersedes the
older non-standard `importance` hint. Both camelCase and lowercase variants
are added to match Stencil's existing dual-property convention.

fixes: stenciljs#6802
@Burzmalian
Burzmalian requested a review from a team as a code owner August 3, 2026 16:44

@davidpett davidpett left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

great addition!

@johnjenkins
johnjenkins added this pull request to the merge queue Aug 3, 2026
Merged via the queue into stenciljs:main with commit 1a5bcc8 Aug 3, 2026
28 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.

3 participants