ARCHIVE FILE
Reactive programming at JFokus
JFokus, 3 February 2015. The deck on disk is called Making apps with React. The title slide says Reactive programming in JavaScript with React.js.
Forget about established truths. Forget about fat controllers, fat models and thin views. Forget, in fact, about views, models, controllers, observers, templates. We don't need that shape of an application just because the last five years of JavaScript frameworks sold it.
MVC was Angular, Backbone, Ember, Knockout. Component-based was Polymer, Meteor, and then this other thing from Facebook. React 0.12.2, in writing. Lightweight virtual DOM. Powerful views. Easy data flow. An app is components. They are encapsulated enough that reuse, testing, and separation of concerns stop being slogans and start being the size of the file you are in.
The middle of the deck is code. Enough talk. Hallo verden. A button that flips its own label. A box that follows the mouse. Inline CSS when the state changes, when a div should hide, when the UI is the interaction. Testing is a slide of its own, because a component is already a unit.
I had given a Norwegian version of the same argument at JavaZone the autumn before. Stockholm got the English cut, a newer React, and the same bet: you do not have to keep the DOM in your head if you are willing to describe the whole screen again.