frontend • Existing front-end tech stack: • Angular.js + Knockout.js • We still have a lot of issues with performance and code organisation • Can React help? Yes!
• Fresh state every time but not interactive Why is it hard to manage the states? • Client-side two-way binding • Angular.js, Ember.js, Knockout • Interactive but complex to manage the states
• speed (cut down initial loading time) • We used phantomJS to simulate a browser and generate the static site in old architecture • With React.js, we can use Rails + execjs + node.js to render
it because it’s easier to understand. • The core of React.js is to to allow: • UI = f(states) • write declarative code that manages application state and DOM together!!
data, display differently: f(states) = UI • Functional programming: pure function • UI as idempotent, composable functions • Data flow from top to bottom
• Use Flux! • Eschew unidirectional data flow • Immutable.js is a must • Force you to think about unidirectional data flow • High performant and reliable React application
• Use Flux! • Eschew unidirectional data flow • Immutable.js is a must • Force you to think about unidirectional data flow • High performant and reliable React application