2 ms·
I've used a few light weight frameworks (e.g. re-dom, which is pretty nice) and recently a kotlin-js framework called fritz2. My observation is that even "heavy
by jillesvangurp 6y ago
I've used a few light weight frameworks (e.g. re-dom, which is pretty nice) and recently a kotlin-js framework called fritz2. My observation is that even "heavy" frameworks like react are not all that complicated or particularly big. The reality is that most websites don't actually pull in a lot of external code in any case even if they do include a framework. There are a lot of build time dependencies but not a lot that ends up running in a browser with typical frameworks like react, vue, angular, etc.
So, the difference between using a framework and not using a framework in terms of the amount of code you need to write is not that large. Mostly frameworks are just about getting you to structure your code in a particular way. In react's case most of what it does is getting you to generate html via their templating language and having a thin DOM facade to make DOM updates less of a PITA to manage. That thin DOM facade is very easy to replace with something else. E.g. the re-dom code base is tiny and most of it is just some best practices around using the DOM api. React is a bit more elaborate in what it does but most of that is strictly speaking just nice to have and not really required with modern browsers.
Fritz2 is a Kotlin framework that emulates a lot of good stuff in other frameworks. It uses a Kotlin DSLs instead of templates, Kotlin's co-routines and StateFlows for managing state and handling events. Otherwise, it works more or less directly against the DOM. Seems to work and scale fine.