- Define a data structure that represents the data behind my UI. AKA, the “model” (in react it’s called state and props)
- Define a view as a function of that model: view(model)
- I never mutate the view directly.
- I do directly update the model which, in turn, triggers a view update. This view update is done in a smart way (by the framework) to minimize DOM mutations (i.e dom diffing).
I know that Kotlin has a nice DSL for generating html dom nodes. This looks really cool. But it only solves half the problem. I see there is a project called Reakt. But it doesn’t look very active.
So, for those of you doing client-side html programming, what patterns or frameworks are you using? I don’t want to go back to manual view updates.