of specific ways in which a thermodynamic system may be arranged, commonly understood as a measure of disorder. * Entropy - Wikipedia, the free encyclopedia https://en.wikipedia.org/wiki/Entropy
yourself (DRY)? When, how and how often update DOM? How to update DOM fast? Where should application state and models settle? How to communicate between your components/modules? How to communicate with server? Where should communication logic settle? How the system will evolve over the time?
on client side only • DOM is accessible at this moment • Good point for 3d party libs integration componentDidMount() { PersonasStore.listen(this._onChange); PersonasActions.fetch(); }
the state • But will complicate things if used just as helpers // PureRenderMixin.js export default { shouldComponentUpdate(nextProps, nextState) { return !shallowEqual(this.props, nextProps) || !shallowEqual(this.state, nextState); } }; // PersonasApp.js const PersonasApp = React.createClass({ mixins: [PureRenderMixin], render() { /… } }); Mixins
data-reactid=".0.1.0"> 10 personas </p> <p data-reactid=".0.1.1"> Double-click to edit a persona </p> </footer> SEO Friendly - Isomorphic Render Will NOT rerender on client string renderToStaticMarkup(ReactElement element) <footer> <p> 10 personas </p> <p> Double-click to edit a persona </p> </footer>
Automatically mocks dependencies for you when running your tests • Allows you to test asynchronous code synchronously • Runs your tests with a fake DOM implementation (via jsdom) so that your tests can run on the command line • Runs tests in parallel processes so that they finish sooner - unfortunately we experienced issues with performance Jest
on mocking with sinon and proxyquire • Your beloved chai assertion library, with sinon-chai plugin • Also runs tests with a fake DOM implementation (via jsdom) so that your tests can run on the command line • And more...
dom and immutable data rocks! • Automatic rerender when data changes - less headaches • Components based architecture - very well maintainable and easy to test • SEO friendly - built-in server-side rendering support (isomorphic apps) • Straightforward one-way direction app data flow with Flux - must have for complex apps working with data • Easy to start with - developers start writing their components quite fast
so you might need to reinvent and do from scratch many things, e.g your components and controls library • React is not full MVC framework - it’s V library first - so you have to think about controller and model, but that means it’s easy to integrate it as just View to your existing apps • Some learning curve might be required to do it in a right way - but it’s quite easy to start use it out of the box • Be careful with performance on mobile devices - it’s not really about React itself but about your surrounding code
block .my-element__sub-element - there is a element (the 2 underscores denote sub elements) .my-element__sub-elelement—highlighted - there might be a modifier e.g. (the 2 hyphens denote a modifier state