Rendering the whole DOM tree (instead of VDOMs) is a fast process. The slow part is attaching (committing) elements to the doc. For example, I have a test of 20,000 elements which takes <30ms to render, while attaching them takes 120ms.
Since the performance is mainly bound to the commit phase, with a DOM merging library, or hopefully, if we get a native API such as `document.replaceChildren(...App(), { merge: true })`, this approach could be better.
Caveats:
Although it restores focus, that's not the only thing we need to preserve, we also need to preserve scroll position and cursor position.
So to work around that, I still have to step out fully declarative, by just replacing the part that changed. For example, here I had to do manually mutate the DOM:
I don't think the issue is lack of features, because audio context and canvas2d are pretty good for making things shiny and nice. The issue is pretty much the rest of the DOM that has quirks everywhere if you want to use it that way. CSS3D as a scene graph is also kind of half baked, and not really integrated well with animations, and well, also too painful when it comes to scheduling and timing and chaining any transition.
SVG animations are also only half-ass implemented among browsers, so that's not really a reliable alternative.
What I liked about the Macromedia suite was the integration cross-IDE, where dreamweaver worked really great together with Flash and vice versa, and where flash was able to load HTML content, just in a more animated manner.
I mean, this was when XHR and AJAX was the "modern" thing in web browsers. Adobe could have dominated the mobile market if they would have decided to make it an open standard. Flash was really a decade ahead of its time.
another trick is adding speculation rules on MPA sites. so when you hover over a link the page gets prerendered. For example, my initial page takes ~80ms, but navigating to other pages take 20ms
IOW, I can serve the website statically. So no iframe is needed for dynamic parts, or allowing the cookie from a subdomain on the www.