← Back to context

Comment by colordrops

16 days ago

No, I prefer much lighter frameworks that are closer to web standards, such as LitElement, which is a relatively light wrapper around Web Component standards. yes, they are slightly clunky, but they work great without a build step. I just edit the code and reload the page, no need to worry about a 5MB bundle. Unless you are writing code that is deployed to a million users running on Nokia brick phone browsers, it works great.

I have an Astro site that's mostly static with a couple interactive components. I recently converted the components from React to Lit and the result is so much simpler.

One of the things that was clunky in the React version was the use of setInterval. I had to write a hook in React and it just added this unnecessary layer of weirdness in how it all interacts[1]. In the Lit version, I just use setInterval normally and there's nothing extra to understand.

[1] https://overreacted.io/making-setinterval-declarative-with-r...

Another vote for Lit here.

JS frameworks were invented to deal with clunkiness of Vanilla Javascript and got bloated to include everything and the kitchen sink. All of a sudden they're 'ecosystems'.

Modern JS + Web components with the light layer of Lit on top solve at least 80% of the issues there were and are with just plain JS. Close to actual web standards and thus play nice with almost everything. By design they fit into a far more modular approach than React or Vue or Svelte.