-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add missing fetchpriority property to img on html element #8099
Comments
You need to provide a REPL. And GitHub issues aren't the right place for support questions like this. Please ask on StackOverflow or in our Discord chat room. |
@baseballyama this isn't really a support question in that way.
Line 695 in 967e9f5
I don't really know how to do a REPL for this because the svelte.dev/repl does not report any issue, but svelte-check does. Here is the svelte-check error from my SvelteKit project:
All you need to do is add |
@bdougherty is correct. This isn't a "tech support" issue. References: |
The Svelte docs have a section on Enhancing built-in DOM types. Based off that section, I would expect this workaround to work, but it does not: declare namespace svelteHTML {
interface HTMLImgAttributes {
fetchpriority: "auto" | "low" | "high" | null | undefined
}
} |
Only chromium support it in the stable release. I don't think it is "have pretty good browser support". Typescript also doesn't have it in their DOM definition. We have an issue with it in the language tools repo. But I declined it because only chromium support it. Although it has been nearly a year since then, The situation is basically the same. |
Around 67% of traffic can use it already, so it would still be useful in the cases where it works. Safari has it behind a flag too. On the other hand, this issue might be resolved by having better documentation on how to extend element types, as it seems most people fail while doing so. |
Agreed. https://www.sveltelab.dev/x81qkcafntbqgd5 shows that the documented method for extending built-in types does not work. (Or that the documentation is insufficiently clear for how to add attributes to one element type.) |
Make sure you're putting the declaration in |
Is this something that you guys want getting fixed? People in the discord are asking for first tasks so I was looking for issues with the "good first issue" tag and I found this, but based on the conversation it sounds like you want to wait so I'm unsure about recommending they work on it. |
TS has absolved me of my crimes against it by my use of an //src/ambient.d.ts
declare module '@some/npm-package-you-are-using';
declare module '*.gql'; // if you like standalone GraphQL files, just a tip
declare namespace svelteHTML {
interface HTMLAttributes<T> {
fetchpriority?: 'auto' | 'low' | 'high';
}
} |
Fixes #8099 --------- Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
Describe the problem
Here the bug:
Describe the proposed solution
Just add the missing peace? 😆
Alternatives considered
I actually don't have enough knowledge to think of an alternative solution 🥹. Hope anyone can help.
Importance
would make my life easier
The text was updated successfully, but these errors were encountered: