React Hot Loader: Tweak React Components in Real Time
This is amazing stuff, thanks Dan! Hopefully it is the beginning of the end of refresh-driven-development.If you are a web developer (front-end/back-end), and you haven't switched to React yet, take this for a spin, and read "Facebook just taught us all how to build websites" (https://medium.com/@ericflo/facebook-just-taught-us-all-how-...), and watch 'React - Rethinking Best Practices' by Pete Hunt (https://www.youtube.com/watch?v=DgVS-zXgMTk).The distinction between the back-end and front-end is a product of the complexity introduced by the web with its 'worse is better' mix of badly integrated tools. It made building user interfaces a dark art with all its quirks:- a layouting system that had an active vendetta against humans- Javascript with all its deficiencies- Connascence introduced by Server  Client communication (Server Model  API View  JS Model  JS View)- declarative views that were ill-suited for web-apps (logic-less templates, what a lie!)- cross-browser incompatibilities- difficulty in implementing client-side routing- immature developer toolingBut worst of them all was DOM mutation and spaghetti code, which was in reality a fundamental deficiency of the development model itself, and not because web developers the world over were being deliberately irresponsible.React is changing all that with the help of ES6. It simplifies web development both in concept and in practice. In a few years, building UIs would be just another part of writing software, and competent Full-Stack developers would cease to remain unicorns.Here are a few things that React approaches differently that makes all the difference:- templates are a bad idea. views are constructed imperatively, not declared. (plug: http://www.jasimabasheer.com/posts/on-react.html)- the basic unit of a front-end system is a 'component'. A component knows how it is rendered (HTML), how it is styled (CSS), how it behaves (JS), and has explicit knowledge of the data it handles (states and props).- everything should be programmable: even HTML and CSS. (https://speakerdeck.com/vjeux/react-css-in-js)The React team seems to be looking at what makes web development actually hard and are thinking outside ill-advised conventional wisdom (like separation of concerns. whose concerns anyway?). For example, Relay (https://gist.github.com/wincent/598fa75e22bdfa44cf47?), removes the need for writing custom API end-points for each of our components. A component already knows the data it needs, but today we leak that info across the component hierarchy and to the server, creating a lot of accidental complexity.Another example is Webpack (http://webpack.github.io/), which changes asset management on the web by making it completely programmable. All your static assets should have the same bundling conveniences that your JS has. Webpack also makes react-hot-loader possible with Hot Module Replacement.React seems to have finally figured out the right direction to take the web to. Exciting times.