The viability of JS frameworks on mobile by Henrik Joreteg

In notebook:
Article Notes
Created at:
2016-02-03
Updated:
2016-02-03
Tags:
Performance libraries JavaScript React jQuery
The viability of JS frameworks on mobile

Part 1. Most JS frameworks are too heavy for mobile

They take too much time to download, too much time to parse, and are too slow to run. There are hundreds of millions of underpowered Android devices connected to slow mobile networks. Don't expect progress in hardware technology to resolve the framework problem for you.

Refers to Jeff Atwood's study: Jeff Atwood’s recent post
And the Filament Groups experiment on TODO MVC: published some research last December

Part 2. With cheap re-rendering (React) you can greatly reduce the complexity

First, in most frameworks such as Backbone, Ember, Angular or Ampersand there's a great complexity ("black magic") to "properly bind state to the UI". It's done through models, collections, messaging
This requires a lot of code and lot of memory, calculations, GC, DOM manipulation.

Second, the virtual dom diffing (e.g. React) let's you very cheaply re-render the UI. This lets you throw away most of the binding complexities: no need for: class system, event system, templating system, custom observable types, DOM library like jQuery

The idea is that the state of the application is just a JSON-like structure made of objects and arrays. No need for models, collections, etc. Then you use mutator functions to change the state and re-render each time the mutator function is done.

Points to Redux as a good implementation of this pattern.