And so in that sense, the answer is web components. I know everyone hates the API but it was intentionally designed to be a low level thing to build a developer experience on top of and the best implementation of that right now is Lit. It’s also a pleasure to use and incredibly lightweight and designed to become even more lightweight overtime as new capabilities come to the web like signals in JavaScript or talk of native templating etc.
There is another option that I really like for certain kinds of applications which is Flutter which might sound contradictory to my original point because it skips the idea of the DOM entirely and brings its own rendering engine to a canvas element.
But it’s set to be the first serious Wasm and WebGPU based UI library on the web and has no problems spitting out 120fps (this is before even they have actually added WebGPU support and their newest rendering engine to the mix by the way) while keeping its rendering engine to I think about 1.5-2mb in size. It also gets you a single codebase that will run literally anywhere as an AOT compiled app.
That’s to say nothing of Dart itself which I cannot even begin to describe what a huge improvement it is over JavaScript and Typescript. If you haven’t tried it yet, do yourself a favour.
I’m just making the point that JavaScript and the DOM are no longer the only players in town and when you’re not trying to mix abstractions of a document markup language and an application a whole lot of problems just disappear like does this look different in different browsers or can I use this new feature etc.. it just works… everywhere… on the web.. on a desktop.. on a phone or an IoT device.