DEV Community

Discussion on: Understanding Transitional JavaScript Apps

Collapse
 
andrew_march_b968a4edb028 profile image
Andrew March

Why don’t we abandon the DOM altogether? Let’s be realistic we are no longer building “documents”. Why don’t we see more frameworks that use canvas or wasm to draw pixels? I feel like if developers pushed forward this way, away from the DOM, the browsers would follow suit and speed up the canvas API, or otherwise accommodate the shift. It feels like we are building entire sky scrapers out of chewing gum and popsicle sticks. It’s fun, don’t get me wrong, and something like Qwik is incredibly impressive, but it’s getting to be a very VERY strange way to show pixels to a user. Frameworks can draw and scale text, adjust layout responsively, scroll, navigate, listen for events, and do the rest of the small handful of things we actually rely on the DOM for today. If these tasks were in the framework, we could modify how it works to taste, and not be stuck with a black box DOM to work around. Arguably less fun, but certainly more productive.

Collapse
 
andrew_march_b968a4edb028 profile image
Andrew March

here's a fun one I made over a few weeks in Deno. I just wrote a custom JSX Factory, and went from there. I was able to build text inputs, scrolling, and animations without loosing too much sleep over it. Canvas can handle it (just barely), and this completely redraws everything on every render.
github.com/marchingband/jdom/