We simply use a Custom Element that extends the <iframe>, and use its contentDocument to look for an element whose class is .partial.content.
Then, in our Custom Element, we simply set this.outerHTML to the target content's outerHTML, which replaces the <iframe>.
This is excellent as we now have a means in frontend technology to effectively have partials/includes – a long-awaited solution to a frustration many developers have endured over, arguably, more than two decades.
However, while initially small, there is some degree of overhead for this implementation as every site across The Web that wants partials must repeat this same Custom Element, making adoption less likely and increasing entropy right out of the gates. As the solution scales, that entropy only increases.
Additionally, this approach is likely to stall out in scalability as the Custom Element, will necessarily bear assumptions about the partial that the Custom Element, itself, should not be aware of; that is, Content/Pathological Coupling where the outer module must know the internal workings of the internal one. Even simple assumptions about styling begin to embellish our scalability issues where we will need stronger & stronger and more & more clever conventions that will increase our entropy and demand more heed in how we reuse this component.
What if there was a way we could do this without having to leverage a Custom Element at all? What if there was a pure W3C-based, standard way to accomplish this without any boilerplate whatsoever?
There is a better way. We aim to disclose this secret, openly, for all to use freely in a pure W3C standard which documents and benchmarks as many aspects as possible for its adoption with formal Gang of Four style specifications. With your help, this code repository will serve as the official, publicly accessible Open Standard, free for anybody to use. And we promise there is way more in store. Please help us evolve The Web and facilitate an Open Internet.