Balancing DX and Web Standards:
My Experience with Astro and Lit
Does the DX suffer if you only work with web standards? The big frameworks provide very good IDE support, build tools, dev server. It seems to work “simply”. In reality, however, this experience depends on many individual tools.
I am currently working on an internal project that does not require a framework at all. I use Lit with JavaScript. And even though I can do without a build environment completely with this form of development, it was a bit too tricky.
I needed a bundler. Also to reduce the code to be delivered with tree shaking. esbuild does a great job here. Even if you want to work with TypeScript. However, since I am implementing an MPA, I had to decide whether to implement all templating in web components or write a lot of HTML multiple times.
I have now decided on a different approach that allows me to be very productive. I create the basic structure with Astro. Not only do I have excellent HTML templating, but I also have a build environment for JavaScript and (S)CSS. Dev server with automatic reload included.
The only thing I’m missing here is the persistent state, as I’m used to when developing with Vue. But it’s now up to me to teach my application this ability.
It feels like it was done right 15+ years ago. However, browsers now support it with all the modern options, so even SPAs no longer always offer a significant advantage.