Ryan Florence -
While developing Remix I've been pouring over HTML specs like I never have before. One big takeaway is that we don't have to take ourselves too seriously seeking the perfect API.
Do your best, but if something feels a little weird, it's okay! HTML is wildly successful and your weird API can be too.
<link> element. That thing is WEIRD.
It downloads and applies stylesheets
<link rel="stylesheet" href="/styles.css">
It defines website icons
<link rel="icon" href="/favicon-32.png" sizes="32x32">
It preloads resources to be used soon
<link rel="preload" href="/banner.png" as="image">
It preloads modules too, flatten those import waterfalls!
<link rel="modulepreload" href="/chunk-12131.js">
It can make a cross-origin fetch and put the result in the browser cache for later!
<link rel="prefetch" href="https://pokeapi.co/api/v2/pokemon/ditto" as="fetch" crossorigin="anonymous" >
The thing is weird. Most the attributes don't even make sense unless combined with some other attribute, a bunch make no sense together, and you rarely need more than two or three!
So, you know, do your best, but ship weird stuff. Some of the most successful things are weird.