On "why can't html alone do includes"
A few thoughts. Some of which are cross-domain issues.
the big one is that a block of html isn't just html. if it was, hey, great, no problem. render it and move on.
but a block of html (like in a web-component or a react component) can contain css and scripts and meta tags and the like. each of these needs rules for when it runs and applies, and as such each also needs to be handled by CSP CORS rules in some manner, even if on the same domain.
Granted, none of these rules existed X years ago when this could have been implemented where security concerns would have just addressed the fact that it would have been there.
But now the security concerns are SO large that it is just unfeasible to address them all.
that's one thing the JS solutions all are kind of stuck, trying to handle that security concern as best they can give or take not knowing when the browser is going to reject something.
Second is yes this affects rendering, particularly if the included html has a meta tag that changes the device-width. Synchronous processing would work albeit with a risk of slowdown much like how a script tag without defer freezes the render while waiting for the load. but if async, do we have a 'loading' tag to show what it had before it is loaded?
now in all of that, when does "ready" fire? when does "on document load" fire? do we need a new event for "document ready AND all the other crap is loaded, too"?
Now throw in the next step: what happens in when the html included by the "
And finally the curse: recursion. X includes Y includes X and the loop is infinite. yeah code could be done to test for X...but if Y doesn't include X but rather, through a script, includes X?date=new Date().milliseconds - so there's no way for the browser to cache it?
yeah, thoughts. None of them positive, really, and all leading to the idea that the server should just handle this, or web-components that are clearly restricted in what they can include.