Prerequisites
Describe the Feature Request
Add the standardized fetchpriority / fetchPriority attribute (values: 'high' | 'low' | 'auto') to the JSX type declarations for <img>, <link>, <script>, and <iframe> elements in stencil-public-runtime.ts.
Describe the Use Case
Developers using Stencil components that render these elements need type-safe access to fetchpriority to hint resource loading priority to the browser — e.g. marking above-the-fold hero images as fetchpriority="high" or deferring non-critical scripts as fetchpriority="low". Without the type declaration, TypeScript flags this as an error.
Describe Preferred Solution
Add both the camelCase (fetchPriority) and lowercase (fetchpriority) variants to JSXBase.IframeHTMLAttributes, JSXBase.ImgHTMLAttributes, JSXBase.LinkHTMLAttributes, and JSXBase.ScriptHTMLAttributes, following the same dual-property convention already used for crossOrigin/crossorigin, srcSet/srcset, etc.
Describe Alternatives
Consumers can currently work around this by casting to any or using // @ts-ignore, which is undesirable.
Related Code
// currently causes a TypeScript error:
<img src="hero.webp" fetchpriority="high" />
// after this change, typed correctly:
<img src="hero.webp" fetchPriority="high" />
Additional Information
Prerequisites
Describe the Feature Request
Add the standardized
fetchpriority/fetchPriorityattribute (values:'high' | 'low' | 'auto') to the JSX type declarations for<img>,<link>,<script>, and<iframe>elements instencil-public-runtime.ts.Describe the Use Case
Developers using Stencil components that render these elements need type-safe access to
fetchpriorityto hint resource loading priority to the browser — e.g. marking above-the-fold hero images asfetchpriority="high"or deferring non-critical scripts asfetchpriority="low". Without the type declaration, TypeScript flags this as an error.Describe Preferred Solution
Add both the camelCase (
fetchPriority) and lowercase (fetchpriority) variants toJSXBase.IframeHTMLAttributes,JSXBase.ImgHTMLAttributes,JSXBase.LinkHTMLAttributes, andJSXBase.ScriptHTMLAttributes, following the same dual-property convention already used forcrossOrigin/crossorigin,srcSet/srcset, etc.Describe Alternatives
Consumers can currently work around this by casting to
anyor using// @ts-ignore, which is undesirable.Related Code
Additional Information
fetchpriorityis now broadly supported across Chrome, Edge, Firefox, and Safari.importanceattribute already present in these interfaces is a predecessor;fetchpriorityis the standardized replacement butimportanceis intentionally left for backward compatibility.