Iframes, while not perfect, are pretty close though...
This post does link to a technique (new to me) to extract iframe contents:
<iframe src="/example.html" onload="this.before((this.contentDocument.body||this.contentDocument).children[0]);this.remove()"></iframe>You can do some really silly maneuvers with `window.postMessage` to communicate an expected size between the parent and frame on resize, but that's expensive and fiddly.
The host can then act as a server for the iframe client, even updating it's state or DOM in response to a message from the iframe.