mastodon.gamedev.place is one of the many independent Mastodon servers you can use to participate in the fediverse.
Mastodon server focused on game development and related topics.

Server stats:

5.7K
active users

Joni Korpi

Slowly drafting a blog post about making web apps without big frameworks, but honestly the summary is:

1. Write super simple JS, using basic functions and built-in data types.
2. Make your functions write to the DOM with `lit-html` (not the same thing as `lit`).
3. Re-run your functions in response to events with a "signals" style library, like`reactively`.
4. Get more events from your DOM with Resize/IntersectionObserver.

Performant, robust, and learnable.

The most important thing here is your code stays loose and open to change, allowing for creativity. Using a big framework instead would constrain the code, making it hard to change.

@jonikorpi I think one of the points you rather want to make is that frameworks never stay the same.

Current Angular is nothing like it was 10 years ago.

React has totally changed it's course four times already, and if you count in NextJS that is even more major enforced refactors within just a couple of years.

But vanilla JS? It works the same as 10 years ago, nothing has forced it to change. Of course you might want to refactor the code, but you don't have to.

@merri Well… depends on the framework! Specifically React still supports its ancient class components. They almost never remove anything. And old versions of every framework are still available and usable thanks to semantic versioning anyway.

So I don’t feel updating to a new major framework version is very different from refactoring JS code to use a new JS feature/paradigm. 🤷

@jonikorpi one counterpoint I’d make that is a benefit for larger teams: frameworks tend to be well documented, so working within those constraints makes it easier for a whole team to stay consistent

@armstrong Documentation is good for lit-html, but definitely lacking in most signals libraries! I'm hoping it'll improve soon, since they might even be getting standardised: github.com/tc39/proposal-signa

@armstrong @jonikorpi I don't work in big teams, but even in smaller projects I find that large frameworks often offer multiple ways of doing one thing, and anything big enough is going to need documentation from the team that built it, regardless of how they built it.

Depending on smaller libraries and on the very well documented standard APIs may actually work out better from that POV?

@teleclimber @armstrong This has also been my experience! Especially with React there are so many subtle footguns, which _are_ documented, but almost no one reads the entire docs, or manages to remember them all.

@jonikorpi I look forward to reading this. I was just realizing how much time I spend debugging reactivity issues in my numerous Vue apps. The gears in my head are turning. I want to try something new.

@jonikorpi You might be interested in @baldur 's course "Uncluttered" (no longer for sale, but maybe he'll send you a copy of you ask?) that covers making web sites/apps using import maps and the browser instead of Node and a giant tooling dependency tree. Lots of good ideas in there.