Files
react/feed.xml
T
Vjeux c4a2717796 fabiomcosta adding warning about the lack of support for onScroll on IE8 … 8615ade
philix	Add jsx-requirejs-plugin to the tooling-integration page	978a8f5
philix	Remove the require-jsx plugin from the tooling-integration page …	e23e627
spicyj	Mention react-art where we talk about SVG	13c211a
spicyj	Fix typo	3afe6de
passy	Add gulp-react to Helpful OSS Projects …	8ef2cec
xixixao	Document displayName	ee90857
Daniel15	Add link to HTML to JSX converter to “JSX In Depth” page	5cbc727
Daniel15	Change “not allowed” back to “discouraged” since you technically *can… …	ea41991
vjeux	Community Round-up #14	658aa45
2014-01-06 18:17:14 +01:00

708 lines
92 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>React</title>
<description>A JavaScript library for building user interfaces</description>
<link>http://facebook.github.io/react</link>
<atom:link href="http://facebook.github.io/react/feed.xml" rel="self" type="application/rss+xml" />
<item>
<title>Community Round-up #14</title>
<description>&lt;p&gt;The theme of this first round-up of 2014 is integration. I&amp;#39;ve tried to assemble a list of articles and projects that use React in various environments.&lt;/p&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;react-baseline&quot;&gt;&lt;/a&gt;React Baseline &lt;a class=&quot;hash-link&quot; href=&quot;#react-baseline&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;React is only one-piece of your web application stack. &lt;a href=&quot;https://github.com/intabulas&quot;&gt;Mark Lussier&lt;/a&gt; shared his baseline stack that uses React along with Grunt, Browserify, Bower, Zepto, Director and Sass. This should help you get started using React for a new project.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;As I do more projects with ReactJS I started to extract a baseline to use when starting new projects. This is very opinionated and I change my opinion from time to time. This is by no ways perfect and in your opinion most likely wrong :).. which is why I love github&lt;/p&gt;
&lt;p&gt;I encourage you to fork, and make it right and submit a pull request!&lt;/p&gt;
&lt;p&gt;My current opinion is using tools like Grunt, Browserify, Bower and mutiple grunt plugins to get the job done. I also opted for Zepto over jQuery and the Flatiron Project&amp;#39;s Director when I need a router. Oh and for the last little bit of tech that makes you mad, I am in the SASS camp when it comes to stylesheets&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/intabulas/reactjs-baseline&quot;&gt;Check it out on GitHub...&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;animal-sounds&quot;&gt;&lt;/a&gt;Animal Sounds &lt;a class=&quot;hash-link&quot; href=&quot;#animal-sounds&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;http://joshduck.com/&quot;&gt;Josh Duck&lt;/a&gt; used React in order to build a Windows 8 tablet app. This is a good example of a touch app written in React.
&lt;figure&gt;&lt;a href=&quot;http://apps.microsoft.com/windows/en-us/app/baby-play-animal-sounds/9280825c-2ed9-41c0-ba38-aa9a5b890bb9&quot;&gt;&lt;img src=&quot;/react/img/blog/animal-sounds.jpg&quot; alt=&quot;&quot;&gt;&lt;/a&gt;&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://apps.microsoft.com/windows/en-us/app/baby-play-animal-sounds/9280825c-2ed9-41c0-ba38-aa9a5b890bb9&quot;&gt;Download the app...&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;react-rails-tutorial&quot;&gt;&lt;/a&gt;React Rails Tutorial &lt;a class=&quot;hash-link&quot; href=&quot;#react-rails-tutorial&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;http://selem.im&quot;&gt;Selem Delul&lt;/a&gt; bundled the &lt;a href=&quot;http://facebook.github.io/react/docs/tutorial.html&quot;&gt;React Tutorial&lt;/a&gt; into a rails app. This is a good example on how to get started with a rails project.&lt;/p&gt;
&lt;blockquote&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;text language-text&quot; data-lang=&quot;text&quot;&gt;git clone https://github.com/necrodome/react-rails-tutorial
cd react-rails-tutorial
bundle install
rake db:migrate
rails s
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Then visit http://localhost:3000/app to see the React application that is explained in the React Tutorial. Try opening multiple tabs!&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/necrodome/react-rails-tutorial&quot;&gt;View on GitHub...&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;mixing-with-backbone&quot;&gt;&lt;/a&gt;Mixing with Backbone &lt;a class=&quot;hash-link&quot; href=&quot;#mixing-with-backbone&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;http://eldar.djafarov.com/&quot;&gt;Eldar Djafarov&lt;/a&gt; implemented a mixin to link Backbone models to React state and a small abstraction to write two-way binding on-top.&lt;/p&gt;
&lt;iframe width=&quot;100%&quot; height=&quot;300&quot; src=&quot;http://jsfiddle.net/djkojb/qZf48/13/embedded/&quot; allowfullscreen=&quot;allowfullscreen&quot; frameborder=&quot;0&quot;&gt;&lt;/iframe&gt;
&lt;p&gt;&lt;a href=&quot;http://eldar.djafarov.com/2013/11/reactjs-mixing-with-backbone/&quot;&gt;Check out the blog post...&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;react-infinite-scroll&quot;&gt;&lt;/a&gt;React Infinite Scroll &lt;a class=&quot;hash-link&quot; href=&quot;#react-infinite-scroll&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://twitter.com/guillaumervls&quot;&gt;Guillaume Rivals&lt;/a&gt; implemented an InfiniteScroll component. This is a good example of a React component that has a simple yet powerful API.&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;javascript language-javascript&quot; data-lang=&quot;javascript&quot;&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;InfiniteScroll&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;pageStart&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;loadMore&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;loadFunc&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;hasMore&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;loader&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;className&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;loader&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;Loading&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;/div&amp;gt;}&amp;gt;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;items&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// &amp;lt;-- This is the &amp;quot;stuff&amp;quot; you want to load&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;/InfiniteScroll&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/guillaumervls/react-infinite-scroll&quot;&gt;Try it out on GitHub!&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;web-components-style&quot;&gt;&lt;/a&gt;Web Components Style &lt;a class=&quot;hash-link&quot; href=&quot;#web-components-style&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;http://subtlegradient.com/&quot;&gt;Thomas Aylott&lt;/a&gt; implemented an API that looks like Web Components but using React underneath.&lt;/p&gt;
&lt;iframe width=&quot;100%&quot; height=&quot;300&quot; src=&quot;http://jsfiddle.net/SubtleGradient/ue2Aa/embedded/html,js,result&quot; allowfullscreen=&quot;allowfullscreen&quot; frameborder=&quot;0&quot;&gt;&lt;/iframe&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;react-vs-angular&quot;&gt;&lt;/a&gt;React vs Angular &lt;a class=&quot;hash-link&quot; href=&quot;#react-vs-angular&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;React is often compared with Angular. &lt;a href=&quot;http://skulbuny.com/2013/10/31/react-vs-angular/&quot;&gt;Pete Hunt&lt;/a&gt; wrote an opinionated post on the subject.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;First of all I think its important to evaluate technologies on objective rather than subjective features. “It feels nicer” or “its cleaner” arent valid reasons: performance, modularity, community size and ease of testing / integration with other tools are.&lt;/p&gt;
&lt;p&gt;Ive done a lot of work benchmarking, building apps, and reading the code of Angular to try to come up with a reasonable comparison between their ways of doing things.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://skulbuny.com/2013/10/31/react-vs-angular/&quot;&gt;Read the full post...&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;random-tweet&quot;&gt;&lt;/a&gt;Random Tweet &lt;a class=&quot;hash-link&quot; href=&quot;#random-tweet&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;figure&gt;&lt;blockquote class=&quot;twitter-tweet&quot; lang=&quot;en&quot;&gt;&lt;p&gt;Really intrigued by React.js. I&amp;#39;ve looked at all JS frameworks, and excepting &lt;a href=&quot;https://twitter.com/serenadejs&quot;&gt;@serenadejs&lt;/a&gt; this is the first one which makes sense to me.&lt;/p&gt;&amp;mdash; Jonas Nicklas (@jonicklas) &lt;a href=&quot;https://twitter.com/jonicklas/statuses/412640708755869696&quot;&gt;December 16, 2013&lt;/a&gt;&lt;/blockquote&gt;&lt;/figure&gt;
</description>
<pubDate>2014-01-06T00:00:00+01:00</pubDate>
<link>http://facebook.github.io/react/blog/2014/01/06/community-roundup-14.html</link>
<guid isPermaLink="true">http://facebook.github.io/react/blog/2014/01/06/community-roundup-14.html</guid>
</item>
<item>
<title>React Chrome Developer Tools</title>
<description>&lt;p&gt;With the new year, we thought you&amp;#39;d enjoy some new tools for debugging React code. Today we&amp;#39;re releasing the &lt;a href=&quot;https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi&quot;&gt;React Developer Tools&lt;/a&gt;, an extension to the Chrome Developer Tools. &lt;a href=&quot;https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi&quot;&gt;Download them from the Chrome Web Store&lt;/a&gt;.&lt;/p&gt;
&lt;figure&gt;&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;//www.youtube.com/embed/Cey7BS6dE0M&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;&lt;/figure&gt;
&lt;p&gt;You will get a new tab titled &amp;quot;React&amp;quot; in your Chrome DevTools. This tab shows you a list of the root React Components that are rendered on the page as well as the subcomponents that each root renders.&lt;/p&gt;
&lt;p&gt;Selecting a Component in this tab allows you to view and edit its props and state in the panel on the right. In the breadcrumbs at the bottom, you can inspect the selected Component, the Component that created it, the Component that created that one, and so on.&lt;/p&gt;
&lt;p&gt;When you inspect a DOM element using the regular Elements tab, you can switch over to the React tab and the corresponding Component will be automatically selected. The Component will also be automatically selected if you have a breakpoint within its render phase. This allows you to step through the render tree and see how one Component affects another one.
&lt;figure&gt;&lt;a href=&quot;https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi&quot;&gt;&lt;img src=&quot;/react/img/blog/react-dev-tools.jpg&quot; alt=&quot;&quot;&gt;&lt;/a&gt;&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;We hope these tools will help your team better understand your component hierarchy and track down bugs. We&amp;#39;re very excited about this initial launch and appreciate any feedback you may have. As always, we also accept &lt;a href=&quot;https://github.com/facebook/react-devtools&quot;&gt;pull requests on GitHub&lt;/a&gt;.&lt;/p&gt;
</description>
<pubDate>2014-01-02T00:00:00+01:00</pubDate>
<link>http://facebook.github.io/react/blog/2014/01/02/react-chrome-developer-tools.html</link>
<guid isPermaLink="true">http://facebook.github.io/react/blog/2014/01/02/react-chrome-developer-tools.html</guid>
</item>
<item>
<title>Community Round-up #13</title>
<description>&lt;p&gt;Happy holidays! This blog post is a little-late Christmas present for all the React users. Hopefully it will inspire you to write awesome web apps in 2014!&lt;/p&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;react-touch&quot;&gt;&lt;/a&gt;React Touch &lt;a class=&quot;hash-link&quot; href=&quot;#react-touch&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;http://www.petehunt.net/&quot;&gt;Pete Hunt&lt;/a&gt; wrote three demos showing that React can be used to run 60fps native-like experiences on mobile web. A frosted glass effect, an image gallery with 3d animations and an infinite scroll view.&lt;/p&gt;
&lt;figure&gt;&lt;iframe src=&quot;//player.vimeo.com/video/79659941&quot; width=&quot;220&quot; height=&quot;400&quot; frameborder=&quot;0&quot; webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;&lt;/figure&gt;
&lt;p&gt;&lt;a href=&quot;http://petehunt.github.io/react-touch/&quot;&gt;Try out the demos!&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;introduction-to-react&quot;&gt;&lt;/a&gt;Introduction to React &lt;a class=&quot;hash-link&quot; href=&quot;#introduction-to-react&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;http://www.phpied.com/&quot;&gt;Stoyan Stefanov&lt;/a&gt; talked at Joe Dev On Tech about React. He goes over all the features of the library and ends with a concrete example.&lt;/p&gt;
&lt;figure&gt;&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;//www.youtube.com/embed/SMMRJif5QW0&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;&lt;/figure&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;jsx-e4x-the-good-parts&quot;&gt;&lt;/a&gt;JSX: E4X The Good Parts &lt;a class=&quot;hash-link&quot; href=&quot;#jsx-e4x-the-good-parts&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;JSX is often compared to the now defunct E4X, &lt;a href=&quot;http://blog.vjeux.com/&quot;&gt;Vjeux&lt;/a&gt; went over all the E4X features and explained how JSX is different and hopefully doesn&amp;#39;t repeat the same mistakes.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;E4X (ECMAScript for XML) is a Javascript syntax extension and a runtime to manipulate XML. It was promoted by Mozilla but failed to become mainstream and is now deprecated. JSX was inspired by E4X. In this article, I&amp;#39;m going to go over all the features of E4X and explain the design decisions behind JSX.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Historical Context&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;E4X has been created in 2002 by John Schneider. This was the golden age of XML where it was being used for everything: data, configuration files, code, interfaces (DOM) ... E4X was first implemented inside of Rhino, a Javascript implementation from Mozilla written in Java.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://blog.vjeux.com/2013/javascript/jsx-e4x-the-good-parts.html&quot;&gt;Continue reading ...&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;react--socket.io&quot;&gt;&lt;/a&gt;React + Socket.io &lt;a class=&quot;hash-link&quot; href=&quot;#react--socket.io&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;http://enome.be/nl&quot;&gt;Geert Pasteels&lt;/a&gt; made a small experiment with Socket.io. He wrote a very small mixin that synchronizes React state with the server. Just include this mixin to your React component and it is now live!&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;javascript language-javascript&quot; data-lang=&quot;javascript&quot;&gt;&lt;span class=&quot;nx&quot;&gt;changeHandler&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;_&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;isEqual&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;state&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;state&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;path&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;===&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;path&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;setState&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;data&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;state&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;componentDidMount&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;path&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;utils&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;nodePath&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;root&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;socket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;component-change&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;changeHandler&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;componentWillUpdate&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;props&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;state&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;socket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;emit&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;component-change&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;path&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;path&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;state&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;state&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;componentWillUnmount&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;socket&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;removeListener&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;component-change&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;change&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/Enome/react.io&quot;&gt;Check it out on GitHub...&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;cssobjectify&quot;&gt;&lt;/a&gt;cssobjectify &lt;a class=&quot;hash-link&quot; href=&quot;#cssobjectify&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;http://andreypopp.com/&quot;&gt;Andrey Popp&lt;/a&gt; implemented a source transform that takes a CSS file and converts it to JSON. This integrates pretty nicely with React.&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;javascript language-javascript&quot; data-lang=&quot;javascript&quot;&gt;&lt;span class=&quot;cm&quot;&gt;/* style.css */&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;MyComponent&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;font&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;12&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;red&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;cm&quot;&gt;/* myapp.js */&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;React&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;react-tools/build/modules/React&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Styles&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;./styles.css&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;MyComponent&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;React&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;createClass&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;render&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;Styles&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;MyComponent&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;Hello&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;world&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;!&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;/div&amp;gt;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/andreypopp/cssobjectify&quot;&gt;Check it out on GitHub...&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;ngreact&quot;&gt;&lt;/a&gt;ngReact &lt;a class=&quot;hash-link&quot; href=&quot;#ngreact&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;http://davidandsuzi.com/&quot;&gt;David Chang&lt;/a&gt; working at &lt;a href=&quot;http://www.hasoffers.com/&quot;&gt;HasOffer&lt;/a&gt; wanted to speed up his Angular app and replaced Angular primitives by React at different layers. When using React naively it is 67% faster, but when combining it with angular&amp;#39;s transclusion it is 450% slower.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Rendering this takes 803ms for 10 iterations, hovering around 35 and 55ms for each data reload (that&amp;#39;s 67% faster). You&amp;#39;ll notice that the first load takes a little longer than successive loads, and the second load REALLY struggles - here, it&amp;#39;s 433ms, which is more than half of the total time!
&lt;figure&gt;&lt;a href=&quot;http://davidandsuzi.com/ngreact-react-components-in-angular/&quot;&gt;&lt;img src=&quot;/react/img/blog/ngreact.png&quot; alt=&quot;&quot;&gt;&lt;/a&gt;&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://davidandsuzi.com/ngreact-react-components-in-angular/&quot;&gt;Read the full article...&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;vim-jsx&quot;&gt;&lt;/a&gt;vim-jsx &lt;a class=&quot;hash-link&quot; href=&quot;#vim-jsx&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/mxw&quot;&gt;Max Wang&lt;/a&gt; made a vim syntax highlighting and indentation plugin for vim.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Syntax highlighting and indenting for JSX. JSX is a JavaScript syntax transformer which translates inline XML document fragments into JavaScript objects. It was developed by Facebook alongside React.&lt;/p&gt;
&lt;p&gt;This bundle requires pangloss&amp;#39;s &lt;a href=&quot;https://github.com/pangloss/vim-javascript&quot;&gt;vim-javascript&lt;/a&gt; syntax highlighting.&lt;/p&gt;
&lt;p&gt;Vim support for inline XML in JS is remarkably similar to the same for PHP.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/mxw/vim-jsx&quot;&gt;View on GitHub...&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;random-tweet&quot;&gt;&lt;/a&gt;Random Tweet &lt;a class=&quot;hash-link&quot; href=&quot;#random-tweet&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;center&gt;&lt;blockquote class=&quot;twitter-tweet&quot; lang=&quot;en&quot;&gt;&lt;p&gt;I may be starting to get annoying with this, but ReactJS is really exciting. I truly feel the virtual DOM is a game changer.&lt;/p&gt;&amp;mdash; Eric Florenzano (@ericflo) &lt;a href=&quot;https://twitter.com/ericflo/statuses/413842834974732288&quot;&gt;December 20, 2013&lt;/a&gt;&lt;/blockquote&gt;&lt;/center&gt;&lt;/p&gt;
</description>
<pubDate>2013-12-30T00:00:00+01:00</pubDate>
<link>http://facebook.github.io/react/blog/2013/12/30/community-roundup-13.html</link>
<guid isPermaLink="true">http://facebook.github.io/react/blog/2013/12/30/community-roundup-13.html</guid>
</item>
<item>
<title>Community Round-up #12</title>
<description>&lt;p&gt;React got featured on the front-page of Hacker News thanks to the Om library. If you try it out for the first time, take a look at the &lt;a href=&quot;/react/docs/getting-started.html&quot;&gt;docs&lt;/a&gt; and do not hesitate to ask questions on the &lt;a href=&quot;http://groups.google.com/group/reactjs&quot;&gt;Google Group&lt;/a&gt;, &lt;a href=&quot;irc://chat.freenode.net/reactjs&quot;&gt;IRC&lt;/a&gt; or &lt;a href=&quot;http://stackoverflow.com/questions/tagged/reactjs&quot;&gt;Stack Overflow&lt;/a&gt;. We are trying our best to help you out!&lt;/p&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;the-future-of-javascript-mvc&quot;&gt;&lt;/a&gt;The Future of Javascript MVC &lt;a class=&quot;hash-link&quot; href=&quot;#the-future-of-javascript-mvc&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;http://swannodette.github.io/&quot;&gt;David Nolen&lt;/a&gt; announced Om, a thin wrapper on-top of React in ClojureScript. It stands out by only using immutable data structures. This unlocks the ability to write a very efficient &lt;a href=&quot;http://facebook.github.io/react/docs/component-specs.html#updating-shouldcomponentupdate&quot;&gt;shouldComponentUpdate&lt;/a&gt; and get huge performance improvements on some tasks.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;We&amp;#39;ve known this for some time over here in the ClojureScript corner of the world - all of our collections are immutable and modeled directly on the original Clojure versions written in Java. Modern JavaScript engines have now been tuned to the point that it&amp;#39;s no longer uncommon to see collection performance within 2.5X of the Java Virtual Machine.&lt;/p&gt;
&lt;p&gt;Wait, wait, wait. What does the performance of persistent data structures have to do with the future of JavaScript MVCs?&lt;/p&gt;
&lt;p&gt;A whole lot.
&lt;figure&gt;&lt;a href=&quot;http://swannodette.github.io/2013/12/17/the-future-of-javascript-mvcs/&quot;&gt;&lt;img src=&quot;/react/img/blog/om-backbone.png&quot; alt=&quot;&quot;&gt;&lt;/a&gt;&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://swannodette.github.io/2013/12/17/the-future-of-javascript-mvcs/&quot;&gt;Read the full article...&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;scroll-position-with-react&quot;&gt;&lt;/a&gt;Scroll Position with React &lt;a class=&quot;hash-link&quot; href=&quot;#scroll-position-with-react&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Managing the scroll position when new content is inserted is usually very tricky to get right. &lt;a href=&quot;http://blog.vjeux.com/&quot;&gt;Vjeux&lt;/a&gt; discovered that &lt;a href=&quot;http://facebook.github.io/react/docs/component-specs.html#updating-componentwillupdate&quot;&gt;componentWillUpdate&lt;/a&gt; and &lt;a href=&quot;http://facebook.github.io/react/docs/component-specs.html#updating-componentdidupdate&quot;&gt;componentDidUpdate&lt;/a&gt; were triggered exactly at the right time to manage the scroll position.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;We can check the scroll position before the component has updated with componentWillUpdate and scroll if necessary at componentDidUpdate&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;text language-text&quot; data-lang=&quot;text&quot;&gt;componentWillUpdate: function() {
var node = this.getDOMNode();
this.shouldScrollBottom =
(node.scrollTop + node.offsetHeight) === node.scrollHeight;
},
componentDidUpdate: function() {
if (this.shouldScrollBottom) {
var node = this.getDOMNode();
node.scrollTop = node.scrollHeight
}
},
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href=&quot;http://blog.vjeux.com/2013/javascript/scroll-position-with-react.html&quot;&gt;Check out the blog article...&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;lights-out&quot;&gt;&lt;/a&gt;Lights Out &lt;a class=&quot;hash-link&quot; href=&quot;#lights-out&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;React declarative approach is well suited to write games. &lt;a href=&quot;https://github.com/chenglou&quot;&gt;Cheng Lou&lt;/a&gt; wrote the famous Lights Out game in React. It&amp;#39;s a good example of use of &lt;a href=&quot;http://facebook.github.io/react/docs/animation.html&quot;&gt;TransitionGroup&lt;/a&gt; to implement animations.
&lt;figure&gt;&lt;a href=&quot;http://chenglou.github.io/react-lights-out/&quot;&gt;&lt;img src=&quot;/react/img/blog/lights-out.png&quot; alt=&quot;&quot;&gt;&lt;/a&gt;&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://chenglou.github.io/react-lights-out/&quot;&gt;Try it out!&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;reactive-table-bookmarklet&quot;&gt;&lt;/a&gt;Reactive Table Bookmarklet &lt;a class=&quot;hash-link&quot; href=&quot;#reactive-table-bookmarklet&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;http://www.phpied.com/&quot;&gt;Stoyan Stefanov&lt;/a&gt; wrote a bookmarklet to process tables on the internet. It adds a little &amp;quot;pop&amp;quot; button that expands to a full-screen view with sorting, editing and export to csv and json.
&lt;figure&gt;&lt;a href=&quot;http://www.phpied.com/reactivetable-bookmarklet/&quot;&gt;&lt;img src=&quot;/react/img/blog/reactive-bookmarklet.png&quot; alt=&quot;&quot;&gt;&lt;/a&gt;&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.phpied.com/reactivetable-bookmarklet/&quot;&gt;Check out the blog post...&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;montagejs-tutorial-in-react&quot;&gt;&lt;/a&gt;MontageJS Tutorial in React &lt;a class=&quot;hash-link&quot; href=&quot;#montagejs-tutorial-in-react&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://twitter.com/ssorallen&quot;&gt;Ross Allen&lt;/a&gt; implemented &lt;a href=&quot;http://montagejs.org/&quot;&gt;MontageJS&lt;/a&gt;&amp;#39;s &lt;a href=&quot;http://montagejs.org/docs/tutorial-reddit-client-with-montagejs.html&quot;&gt;Reddit tutorial&lt;/a&gt; in React. This is a good opportunity to compare the philosophies of the two libraries.&lt;/p&gt;
&lt;iframe width=&quot;100%&quot; height=&quot;300&quot; src=&quot;http://jsfiddle.net/ssorallen/fEsYt/embedded/result,html,js&quot; allowfullscreen=&quot;allowfullscreen&quot; frameborder=&quot;0&quot;&gt;&lt;/iframe&gt;
&lt;p&gt;&lt;a href=&quot;http://jsfiddle.net/ssorallen/fEsYt/&quot;&gt;View the source on JSFiddle...&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;writing-good-react-components&quot;&gt;&lt;/a&gt;Writing Good React Components &lt;a class=&quot;hash-link&quot; href=&quot;#writing-good-react-components&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;http://blog.whn.se/&quot;&gt;William Högman Rudenmalm&lt;/a&gt; wrote an article on how to write good React components. This is full of good advice.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The idea of dividing software into smaller parts or components is hardly new - It is the essance of good software. The same principles that apply to software in general apply to building React components. That doesnt mean that writing good React components is just about applying general rules.&lt;/p&gt;
&lt;p&gt;The web offers a unique set of challenges, which React offers interesting solutions to. First and foremost among these solutions is the what is called the Mock DOM. Rather than having user code interface with the DOM in a direct fashion, as is the case with most DOM manipulation libraries.&lt;/p&gt;
&lt;p&gt;You build a model of how you want the DOM end up like. React then inserts this model into the DOM. This is very useful for updates because React simply compares the model or mock DOM against the actual DOM, and then only updates based on the difference between the two states.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://blog.whn.se/post/69621609605/writing-good-react-components&quot;&gt;Read the full article ...&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;hoodie-react-todomvc&quot;&gt;&lt;/a&gt;Hoodie React TodoMVC &lt;a class=&quot;hash-link&quot; href=&quot;#hoodie-react-todomvc&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;http://svenlito.com/&quot;&gt;Sven Lito&lt;/a&gt; integrated the React TodoMVC example within an &lt;a href=&quot;http://hood.ie/&quot;&gt;Hoodie&lt;/a&gt; web app environment. This should let you get started using Hoodie and React.&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;text language-text&quot; data-lang=&quot;text&quot;&gt;hoodie new todomvc -t &amp;quot;hoodiehq/hoodie-react-todomvc&amp;quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/hoodiehq/hoodie-react-todomvc&quot;&gt;Check out on GitHub...&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;jsx-compiler&quot;&gt;&lt;/a&gt;JSX Compiler &lt;a class=&quot;hash-link&quot; href=&quot;#jsx-compiler&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Ever wanted to have a quick way to see what a JSX tag would be converted to? &lt;a href=&quot;http://www.yungsters.com/&quot;&gt;Tim Yung&lt;/a&gt; made a page for it.
&lt;figure&gt;&lt;a href=&quot;http://facebook.github.io/react/jsx-compiler.html&quot;&gt;&lt;img src=&quot;/react/img/blog/jsx-compiler.png&quot; alt=&quot;&quot;&gt;&lt;/a&gt;&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://facebook.github.io/react/jsx-compiler.html&quot;&gt;Try it out!&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;random-tweet&quot;&gt;&lt;/a&gt;Random Tweet &lt;a class=&quot;hash-link&quot; href=&quot;#random-tweet&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;center&gt;&lt;blockquote class=&quot;twitter-tweet&quot; lang=&quot;en&quot;&gt;&lt;p&gt;.&lt;a href=&quot;https://twitter.com/jordwalke&quot;&gt;@jordwalke&lt;/a&gt; lays down some truth &lt;a href=&quot;http://t.co/AXAn0UlUe3&quot;&gt;http://t.co/AXAn0UlUe3&lt;/a&gt;, optimizing your JS application shouldn&amp;#39;t force you to rewrite so much code &lt;a href=&quot;https://twitter.com/search?q=%23reactjs&amp;amp;src=hash&quot;&gt;#reactjs&lt;/a&gt;&lt;/p&gt;&amp;mdash; David Nolen (@swannodette) &lt;a href=&quot;https://twitter.com/swannodette/statuses/413780079249215488&quot;&gt;December 19, 2013&lt;/a&gt;&lt;/blockquote&gt;&lt;/center&gt;&lt;/p&gt;
</description>
<pubDate>2013-12-23T00:00:00+01:00</pubDate>
<link>http://facebook.github.io/react/blog/2013/12/23/community-roundup-12.html</link>
<guid isPermaLink="true">http://facebook.github.io/react/blog/2013/12/23/community-roundup-12.html</guid>
</item>
<item>
<title>React v0.8</title>
<description>&lt;p&gt;I&amp;#39;ll start by answering the obvious question:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;What happened to 0.6 and 0.7?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;It&amp;#39;s become increasingly obvious since our launch in May that people want to use React on the server. With the server-side rendering abilities, that&amp;#39;s a perfect fit. However using the same copy of React on the server and then packaging it up for the client is surprisingly a harder problem. People have been using our &lt;code&gt;react-tools&lt;/code&gt; module which includes React, but when browserifying that ends up packaging all of &lt;code&gt;esprima&lt;/code&gt; and some other dependencies that aren&amp;#39;t needed on the client. So we wanted to make this whole experience better.&lt;/p&gt;
&lt;p&gt;We talked with &lt;a href=&quot;https://github.com/jeffbski&quot;&gt;Jeff Barczewski&lt;/a&gt; who was the owner of the &lt;code&gt;react&lt;/code&gt; module on npm. He was kind enough to transition ownership to us and release his package under a different name: &lt;code&gt;autoflow&lt;/code&gt;. I encourage you to &lt;a href=&quot;https://github.com/jeffbski/autoflow&quot;&gt;check it out&lt;/a&gt; if you&amp;#39;re writing a lot of asynchronous code. In order to not break all of &lt;code&gt;react&lt;/code&gt;&amp;#39;s current users of 0.7.x, we decided to bump our version to 0.8 and skip the issue entirely. We&amp;#39;re also including a warning if you use our &lt;code&gt;react&lt;/code&gt; module like you would use the previous package.&lt;/p&gt;
&lt;p&gt;In order to make the transition to 0.8 for our current users as painless as possible, we decided to make 0.8 primarily a bug fix release on top of 0.5. No public APIs were changed (even if they were already marked as deprecated). We haven&amp;#39;t added any of the new features we have in master, though we did take the opportunity to pull in some improvements to internals.&lt;/p&gt;
&lt;p&gt;We hope that by releasing &lt;code&gt;react&lt;/code&gt; on npm, we will enable a new set of uses that have been otherwise difficult. All feedback is welcome!&lt;/p&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;changelog&quot;&gt;&lt;/a&gt;Changelog &lt;a class=&quot;hash-link&quot; href=&quot;#changelog&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3&gt;&lt;a class=&quot;anchor&quot; name=&quot;react&quot;&gt;&lt;/a&gt;React &lt;a class=&quot;hash-link&quot; href=&quot;#react&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Added support for more attributes:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;rows&lt;/code&gt; &amp;amp; &lt;code&gt;cols&lt;/code&gt; for &lt;code&gt;&amp;lt;textarea&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;defer&lt;/code&gt; &amp;amp; &lt;code&gt;async&lt;/code&gt; for &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;loop&lt;/code&gt; for &lt;code&gt;&amp;lt;audio&amp;gt;&lt;/code&gt; &amp;amp; &lt;code&gt;&amp;lt;video&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;autoCorrect&lt;/code&gt; for form fields (a non-standard attribute only supported by mobile WebKit)&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;Improved error messages&lt;/li&gt;
&lt;li&gt;Fixed Selection events in IE11&lt;/li&gt;
&lt;li&gt;Added &lt;code&gt;onContextMenu&lt;/code&gt; events&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;&lt;a class=&quot;anchor&quot; name=&quot;react-with-addons&quot;&gt;&lt;/a&gt;React with Addons &lt;a class=&quot;hash-link&quot; href=&quot;#react-with-addons&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Fixed bugs with TransitionGroup when children were undefined&lt;/li&gt;
&lt;li&gt;Added support for &lt;code&gt;onTransition&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;&lt;a class=&quot;anchor&quot; name=&quot;react-tools&quot;&gt;&lt;/a&gt;react-tools &lt;a class=&quot;hash-link&quot; href=&quot;#react-tools&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Upgraded &lt;code&gt;jstransform&lt;/code&gt; and &lt;code&gt;esprima-fb&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;&lt;a class=&quot;anchor&quot; name=&quot;jsxtransformer&quot;&gt;&lt;/a&gt;JSXTransformer &lt;a class=&quot;hash-link&quot; href=&quot;#jsxtransformer&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Added support for use in IE8&lt;/li&gt;
&lt;li&gt;Upgraded browserify, which reduced file size by ~65KB (16KB gzipped)&lt;/li&gt;
&lt;/ul&gt;
</description>
<pubDate>2013-12-19T00:00:00+01:00</pubDate>
<link>http://facebook.github.io/react/blog/2013/12/19/react-v0.8.0.html</link>
<guid isPermaLink="true">http://facebook.github.io/react/blog/2013/12/19/react-v0.8.0.html</guid>
</item>
<item>
<title>React v0.5.2, v0.4.2</title>
<description>&lt;p&gt;Today we&amp;#39;re releasing an update to address a potential XSS vulnerability that can arise when using user data as a &lt;code&gt;key&lt;/code&gt;. Typically &amp;quot;safe&amp;quot; data is used for a &lt;code&gt;key&lt;/code&gt;, for example, an id from your database, or a unique hash. However there are cases where it may be reasonable to use user generated content. A carefully crafted piece of content could result in arbitrary JS execution. While we make a very concerted effort to ensure all text is escaped before inserting it into the DOM, we missed one case. Immediately following the discovery of this vulnerability, we performed an audit to ensure we this was the only such vulnerability.&lt;/p&gt;
&lt;p&gt;This only affects v0.5.x and v0.4.x. Versions in the 0.3.x family are unaffected.&lt;/p&gt;
&lt;p&gt;Updated versions are available for immediate download via npm, bower, and on our &lt;a href=&quot;http://facebook.github.io/react/downloads.html&quot;&gt;download page&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;We take security very seriously at Facebook. For most of our products, users don&amp;#39;t need to know that a security issue has been fixed. But with libraries like React, we need to make sure developers using React have access to fixes to keep their users safe.&lt;/p&gt;
&lt;p&gt;While we&amp;#39;ve encouraged responsible disclosure as part of &lt;a href=&quot;https://www.facebook.com/whitehat/&quot;&gt;Facebook&amp;#39;s whitehat bounty program&lt;/a&gt; since we launched, we don&amp;#39;t have a good process for notifying our users. Hopefully we don&amp;#39;t need to use it, but moving forward we&amp;#39;ll set up a little bit more process to ensure the safety of our users. Ember.js has &lt;a href=&quot;http://emberjs.com/security/&quot;&gt;an excellent policy&lt;/a&gt; which we may use as our model.&lt;/p&gt;
&lt;p&gt;You can learn more about the vulnerability discussed here: &lt;a href=&quot;https://groups.google.com/forum/#!topic/reactjs/OIqxlB2aGfU&quot;&gt;CVE-2013-7035&lt;/a&gt;.&lt;/p&gt;
</description>
<pubDate>2013-12-18T00:00:00+01:00</pubDate>
<link>http://facebook.github.io/react/blog/2013/12/18/react-v0.5.2-v0.4.2.html</link>
<guid isPermaLink="true">http://facebook.github.io/react/blog/2013/12/18/react-v0.5.2-v0.4.2.html</guid>
</item>
<item>
<title>Community Round-up #11</title>
<description>&lt;p&gt;This round-up is the proof that React has taken off from its Facebook&amp;#39;s root: it features three in-depth presentations of React done by external people. This is awesome, keep them coming!&lt;/p&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;super-vanjs-2013-talk&quot;&gt;&lt;/a&gt;Super VanJS 2013 Talk &lt;a class=&quot;hash-link&quot; href=&quot;#super-vanjs-2013-talk&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/steveluscher&quot;&gt;Steve Luscher&lt;/a&gt; working at &lt;a href=&quot;https://leanpub.com/&quot;&gt;LeanPub&lt;/a&gt; made a 30 min talk at &lt;a href=&quot;https://twitter.com/vanjs&quot;&gt;Super VanJS&lt;/a&gt;. He does a remarkable job at explaining why React is so fast with very exciting demos using the HTML5 Audio API.&lt;/p&gt;
&lt;figure&gt;&lt;iframe width=&quot;600&quot; height=&quot;338&quot; src=&quot;//www.youtube.com/embed/1OeXsL5mr4g&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;&lt;/figure&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;react-tips&quot;&gt;&lt;/a&gt;React Tips &lt;a class=&quot;hash-link&quot; href=&quot;#react-tips&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;http://connormcsheffrey.com/&quot;&gt;Connor McSheffrey&lt;/a&gt; and &lt;a href=&quot;https://github.com/chenglou&quot;&gt;Cheng Lou&lt;/a&gt; added a new section to the documentation. It&amp;#39;s a list of small tips that you will probably find useful while working on React. Since each article is very small and focused, we &lt;a href=&quot;http://facebook.github.io/react/tips/introduction.html&quot;&gt;encourage you to contribute&lt;/a&gt;!&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://facebook.github.io/react/tips/inline-styles.html&quot;&gt;Inline Styles&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://facebook.github.io/react/tips/if-else-in-JSX.html&quot;&gt;If-Else in JSX&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://facebook.github.io/react/tips/self-closing-tag.html&quot;&gt;Self-Closing Tag&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://facebook.github.io/react/tips/maximum-number-of-jsx-root-nodes.html&quot;&gt;Maximum Number of JSX Root Nodes&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://facebook.github.io/react/tips/style-props-value-px.html&quot;&gt;Shorthand for Specifying Pixel Values in style props&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://facebook.github.io/react/tips/children-props-type.html&quot;&gt;Type of the Children props&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://facebook.github.io/react/tips/controlled-input-null-value.html&quot;&gt;Value of null for Controlled Input&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://facebook.github.io/react/tips/componentWillReceiveProps-not-triggered-after-mounting.html&quot;&gt;&lt;code&gt;componentWillReceiveProps&lt;/code&gt; Not Triggered After Mounting&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://facebook.github.io/react/tips/props-in-getInitialState-as-anti-pattern.html&quot;&gt;Props in getInitialState Is an Anti-Pattern&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://facebook.github.io/react/tips/dom-event-listeners.html&quot;&gt;DOM Event Listeners in a Component&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://facebook.github.io/react/tips/initial-ajax.html&quot;&gt;Load Initial Data via AJAX&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://facebook.github.io/react/tips/false-in-jsx.html&quot;&gt;False in JSX&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;intro-to-the-react-framework&quot;&gt;&lt;/a&gt;Intro to the React Framework &lt;a class=&quot;hash-link&quot; href=&quot;#intro-to-the-react-framework&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;http://blog.pixelingene.com/&quot;&gt;Pavan Podila&lt;/a&gt; wrote an in-depth introduction to React on TutsPlus. This is definitively worth reading.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Within a component-tree, data should always flow down. A parent-component should set the props of a child-component to pass any data from the parent to the child. This is termed as the Owner-Owned pair. On the other hand user-events (mouse, keyboard, touches) will always bubble up from the child all the way to the root component, unless handled in between.
&lt;figure&gt;&lt;a href=&quot;http://dev.tutsplus.com/tutorials/intro-to-the-react-framework--net-35660&quot;&gt;&lt;img src=&quot;/react/img/blog/tutsplus.png&quot; alt=&quot;&quot;&gt;&lt;/a&gt;&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://dev.tutsplus.com/tutorials/intro-to-the-react-framework--net-35660&quot;&gt;Read the full article ...&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;140-characters-textarea&quot;&gt;&lt;/a&gt;140-characters textarea &lt;a class=&quot;hash-link&quot; href=&quot;#140-characters-textarea&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/brainkim&quot;&gt;Brian Kim&lt;/a&gt; wrote a small textarea component that gradually turns red as you reach the 140-characters limit. Because he only changes the background color, React is smart enough not to mess with the text selection.&lt;/p&gt;
&lt;p data-height=&quot;178&quot; data-theme-id=&quot;0&quot; data-slug-hash=&quot;FECGb&quot; data-user=&quot;brainkim&quot; data-default-tab=&quot;result&quot; class='codepen'&gt;See the Pen &lt;a href='http://codepen.io/brainkim/pen/FECGb'&gt;FECGb&lt;/a&gt; by Brian Kim (&lt;a href='http://codepen.io/brainkim'&gt;@brainkim&lt;/a&gt;) on &lt;a href='http://codepen.io'&gt;CodePen&lt;/a&gt;&lt;/p&gt;
&lt;script async src=&quot;//codepen.io/assets/embed/ei.js&quot;&gt;&lt;/script&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;genesis-skeleton&quot;&gt;&lt;/a&gt;Genesis Skeleton &lt;a class=&quot;hash-link&quot; href=&quot;#genesis-skeleton&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;http://ericclemmons.github.io/&quot;&gt;Eric Clemmons&lt;/a&gt; is working on a &amp;quot;Modern, opinionated, full-stack starter kit for rapid, streamlined application development&amp;quot;. The version 0.4.0 has just been released and has first-class support for React.
&lt;figure&gt;&lt;a href=&quot;http://genesis-skeleton.com/&quot;&gt;&lt;img src=&quot;/react/img/blog/genesis_skeleton.png&quot; alt=&quot;&quot;&gt;&lt;/a&gt;&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;agflow-talk&quot;&gt;&lt;/a&gt;AgFlow Talk &lt;a class=&quot;hash-link&quot; href=&quot;#agflow-talk&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;http://rz.scale-it.pl/&quot;&gt;Robert Zaremba&lt;/a&gt; working on &lt;a href=&quot;http://www.agflow.com/&quot;&gt;AgFlow&lt;/a&gt; recently talked in Poland about React.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In a nutshell, I presented why we chose React among other available options (ember.js, angular, backbone ...) in AgFlow, where Im leading an application development.&lt;/p&gt;
&lt;p&gt;During the talk a wanted to highlight that React is not about implementing a Model, but a way to construct visible components with some state. React is simple. It is super simple, you can learn it in 1h. On the other hand what is model? Which functionality it should provide? React does one thing and does it the best (for me)!&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://rz.scale-it.pl/2013/10/20/frontend_components_in_react.html&quot;&gt;Read the full article...&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;figure&gt;&lt;iframe src=&quot;https://docs.google.com/presentation/d/1JSFbjCuuexwOHCeHWBMNRIJdyfD2Z0ZQwX65WOWkfaI/embed?start=false&quot; frameborder=&quot;0&quot; width=&quot;600&quot; height=&quot;468&quot; allowfullscreen=&quot;true&quot; mozallowfullscreen=&quot;true&quot; webkitallowfullscreen=&quot;true&quot;&gt; &lt;/iframe&gt;&lt;/figure&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;jsx&quot;&gt;&lt;/a&gt;JSX &lt;a class=&quot;hash-link&quot; href=&quot;#jsx&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;http://tck.io/&quot;&gt;Todd Kennedy&lt;/a&gt; working at Cond&amp;eacute; Nast wrote &lt;a href=&quot;https://github.com/CondeNast/JSXHint&quot;&gt;JSXHint&lt;/a&gt; and explains in a blog post his perspective on JSX.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Lets start with the elephant in the room: JSX?
Is this some sort of template language? Specifically no. This might have been the first big stumbling block. What looks like to be a templating language is actually an in-line DSL that gets transpiled directly into JavaScript by the JSX transpiler.&lt;/p&gt;
&lt;p&gt;Creating elements in memory is quick -- copying those elements into the DOM is where the slowness occurs. This is due to a variety of issues, most namely reflow/paint. Changing the items in the DOM causes the browser to re-paint the display, apply styles, etc. We want to keep those operations to an absolute minimum, especially if we&amp;#39;re dealing with something that needs to update the DOM frequently.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://tck.io/posts/jsxhint_and_react.html&quot;&gt;Read the full article...&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;photo-gallery&quot;&gt;&lt;/a&gt;Photo Gallery &lt;a class=&quot;hash-link&quot; href=&quot;#photo-gallery&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;http://miekd.com/&quot;&gt;Maykel Loomans&lt;/a&gt;, designer at Instagram, wrote a gallery for photos he shot using React.
&lt;figure&gt;&lt;a href=&quot;http://photos.miekd.com/xoxo2013/&quot;&gt;&lt;img src=&quot;/react/img/blog/xoxo2013.png&quot; alt=&quot;&quot;&gt;&lt;/a&gt;&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;random-tweet&quot;&gt;&lt;/a&gt;Random Tweet &lt;a class=&quot;hash-link&quot; href=&quot;#random-tweet&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;img src=&quot;/react/img/blog/steve_reverse.gif&quot; style=&quot;float: right;&quot; /&gt;
&lt;div style=&quot;width: 320px;&quot;&gt;&lt;blockquote class=&quot;twitter-tweet&quot;&gt;&lt;p&gt;I think this reversed gif of Steve Urkel best describes my changing emotions towards the React Lib &lt;a href=&quot;http://t.co/JoX0XqSXX3&quot;&gt;http://t.co/JoX0XqSXX3&lt;/a&gt;&lt;/p&gt;&amp;mdash; Ryan Seddon (@ryanseddon) &lt;a href=&quot;https://twitter.com/ryanseddon/statuses/398572848802852864&quot;&gt;November 7, 2013&lt;/a&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;/p&gt;
</description>
<pubDate>2013-11-18T00:00:00+01:00</pubDate>
<link>http://facebook.github.io/react/blog/2013/11/18/community-roundup-11.html</link>
<guid isPermaLink="true">http://facebook.github.io/react/blog/2013/11/18/community-roundup-11.html</guid>
</item>
<item>
<title>Community Round-up #10</title>
<description>&lt;p&gt;This is the 10th round-up already and React has come quite far since it was open sourced. Almost all new web projects at Khan Academy, Facebook, and Instagram are being developed using React. React has been deployed in a variety of contexts: a Chrome extension, a Windows 8 application, mobile websites, and desktop websites supporting Internet Explorer 8! Language-wise, React is not only being used within JavaScript but also CoffeeScript and ClojureScript.&lt;/p&gt;
&lt;p&gt;The best part is that no drastic changes have been required to support all those use cases. Most of the efforts were targeted at polishing edge cases, performance improvements, and documentation.&lt;/p&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;khan-academy---officially-moving-to-react&quot;&gt;&lt;/a&gt;Khan Academy - Officially moving to React &lt;a class=&quot;hash-link&quot; href=&quot;#khan-academy---officially-moving-to-react&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;http://joelburget.com/&quot;&gt;Joel Burget&lt;/a&gt; announced at Hack Reactor that new front-end code at Khan Academy should be written in React!&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;How did we get the rest of the team to adopt React? Using interns as an attack vector! Most full-time devs had already been working on their existing projects for a while and weren&amp;#39;t looking to try something new at the time, but our class of summer interns was just arriving. For whatever reason, a lot of them decided to try React for their projects. Then mentors became exposed through code reviews or otherwise touching the new code. In this way React knowledge diffused to almost the whole team over the summer.&lt;/p&gt;
&lt;p&gt;Since the first React checkin on June 5, we&amp;#39;ve somehow managed to accumulate 23500 lines of jsx (React-flavored js) code. Which is terrifying in a way - that&amp;#39;s a lot of code - but also really exciting that it was picked up so quickly.&lt;/p&gt;
&lt;p&gt;We held three meetings about how we should proceed with React. At the first two we decided to continue experimenting with React and deferred a final decision on whether to adopt it. At the third we adopted the policy that new code should be written in React.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m excited that we were able to start nudging code quality forward. However, we still have a lot of work to do! One of the selling points of this transition is adopting a uniform frontend style. We&amp;#39;re trying to upgrade all the code from (really old) pure jQuery and (regular old) Backbone views / Handlebars to shiny React. At the moment all we&amp;#39;ve done is introduce more fragmentation. We won&amp;#39;t be gratuitously updating working code (if it ain&amp;#39;t broke, don&amp;#39;t fix it), but are seeking out parts of the codebase where we can shoot two birds with one stone by rewriting in React while fixing bugs or adding functionality.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://joelburget.com/backbone-to-react/&quot;&gt;Read the full article&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;react-rethinking-best-practices&quot;&gt;&lt;/a&gt;React: Rethinking best practices &lt;a class=&quot;hash-link&quot; href=&quot;#react-rethinking-best-practices&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;http://www.petehunt.net/&quot;&gt;Pete Hunt&lt;/a&gt;&amp;#39;s talk at JSConf EU 2013 is now available in video.&lt;/p&gt;
&lt;figure&gt;&lt;iframe width=&quot;600&quot; height=&quot;370&quot; src=&quot;//www.youtube.com/embed/x7cQ3mrcKaY&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;&lt;/figure&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;server-side-react-with-php&quot;&gt;&lt;/a&gt;Server-side React with PHP &lt;a class=&quot;hash-link&quot; href=&quot;#server-side-react-with-php&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;http://www.phpied.com/&quot;&gt;Stoyan Stefanov&lt;/a&gt;&amp;#39;s series of articles on React has two new entries on how to execute React on the server to generate the initial page load.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;This post is an initial hack to have React components render server-side in PHP.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Problem: Build web UIs&lt;/li&gt;
&lt;li&gt;Solution: React&lt;/li&gt;
&lt;li&gt;Problem: UI built in JS is anti-SEO (assuming search engines are still noscript) and bad for perceived performance (blank page till JS arrives)&lt;/li&gt;
&lt;li&gt;Solution: &lt;a href=&quot;https://github.com/facebook/react-page&quot;&gt;React page&lt;/a&gt; to render the first view&lt;/li&gt;
&lt;li&gt;Problem: Can&amp;#39;t host node.js apps / I have tons of PHP code&lt;/li&gt;
&lt;li&gt;Solution: Use PHP then!&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href=&quot;http://www.phpied.com/server-side-react-with-php/&quot;&gt;&lt;strong&gt;Read part 1 ...&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.phpied.com/server-side-react-with-php-part-2/&quot;&gt;&lt;strong&gt;Read part 2 ...&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Rendered markup on the server:
&lt;figure&gt;&lt;a href=&quot;http://www.phpied.com/server-side-react-with-php-part-2/&quot;&gt;&lt;img src=&quot;/react/img/blog/react-php.png&quot; alt=&quot;&quot;&gt;&lt;/a&gt;&lt;/figure&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;todomvc-benchmarks&quot;&gt;&lt;/a&gt;TodoMVC Benchmarks &lt;a class=&quot;hash-link&quot; href=&quot;#todomvc-benchmarks&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Webkit has a &lt;a href=&quot;https://github.com/WebKit/webkit/tree/master/PerformanceTests/DoYouEvenBench&quot;&gt;TodoMVC Benchmark&lt;/a&gt; that compares different frameworks. They recently included React and here are the results (average of 10 runs in Chrome 30):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;AngularJS:&lt;/strong&gt; 4043ms&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;AngularJSPerf:&lt;/strong&gt; 3227ms&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;BackboneJS:&lt;/strong&gt; 1874ms&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;EmberJS:&lt;/strong&gt; 6822ms&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;jQuery:&lt;/strong&gt; 14628ms&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;React:&lt;/strong&gt; 2864ms&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;VanillaJS:&lt;/strong&gt; 5567ms&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href=&quot;http://www.petehunt.net/react/tastejs/benchmark.html&quot;&gt;Try it yourself!&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Please don&amp;#39;t take those numbers too seriously, they only reflect one very specific use case and are testing code that wasn&amp;#39;t written with performance in mind.&lt;/p&gt;
&lt;p&gt;Even though React scores as one of the fastest frameworks in the benchmark, the React code is simple and idiomatic. The only performance tweak used is the following function:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;javascript language-javascript&quot; data-lang=&quot;javascript&quot;&gt;&lt;span class=&quot;cm&quot;&gt;/**&lt;/span&gt;
&lt;span class=&quot;cm&quot;&gt; * This is a completely optional performance enhancement that you can implement&lt;/span&gt;
&lt;span class=&quot;cm&quot;&gt; * on any React component. If you were to delete this method the app would still&lt;/span&gt;
&lt;span class=&quot;cm&quot;&gt; * work correctly (and still be very performant!), we just use it as an example&lt;/span&gt;
&lt;span class=&quot;cm&quot;&gt; * of how little code it takes to get an order of magnitude performance improvement.&lt;/span&gt;
&lt;span class=&quot;cm&quot;&gt; */&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;shouldComponentUpdate&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;nextProps&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;nextState&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;nextProps&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;todo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;!==&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;props&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;todo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;id&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;||&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;nextProps&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;todo&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;!==&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;props&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;todo&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;||&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;nextProps&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;editing&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;!==&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;props&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;editing&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;||&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;nextState&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;editText&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;!==&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;state&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;editText&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;By default, React &amp;quot;re-renders&amp;quot; all the components when anything changes. This is usually fast enough that you don&amp;#39;t need to care. However, you can provide a function that can tell whether there will be any change based on the previous and next states and props. If it is faster than re-rendering the component, then you get a performance improvement.&lt;/p&gt;
&lt;p&gt;The fact that you can control when components are rendered is a very important characteristic of React as it gives you control over its performance. We are going to talk more about performance in the future, stay tuned.&lt;/p&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;guess-the-filter&quot;&gt;&lt;/a&gt;Guess the filter &lt;a class=&quot;hash-link&quot; href=&quot;#guess-the-filter&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;http://conr.me&quot;&gt;Connor McSheffrey&lt;/a&gt; implemented a small game using React. The goal is to guess which filter has been used to create the Instagram photo.
&lt;figure&gt;&lt;a href=&quot;http://guessthefilter.com/&quot;&gt;&lt;img src=&quot;/react/img/blog/guess_filter.jpg&quot; alt=&quot;&quot;&gt;&lt;/a&gt;&lt;/figure&gt;&lt;/p&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;react-vs-fruitmachine&quot;&gt;&lt;/a&gt;React vs FruitMachine &lt;a class=&quot;hash-link&quot; href=&quot;#react-vs-fruitmachine&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;http://trib.tv/&quot;&gt;Andrew Betts&lt;/a&gt;, director of the &lt;a href=&quot;http://labs.ft.com/&quot;&gt;Financial Times Labs&lt;/a&gt;, posted an article comparing &lt;a href=&quot;https://github.com/ftlabs/fruitmachine&quot;&gt;FruitMachine&lt;/a&gt; and React.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Eerily similar, no? Maybe Facebook was inspired by Fruit Machine (after all, we got there first), but more likely, it just shows that this is a pretty decent way to solve the problem, and great minds think alike. We&amp;#39;re graduating to a third phase in the evolution of web best practice - from intermingling of markup, style and behaviour, through a phase in which those concerns became ever more separated and encapsulated, and finally to a model where we can do that separation at a component level. Developments like Web Components show the direction the web community is moving, and frameworks like React and Fruit Machine are in fact not a lot more than polyfills for that promised behaviour to come.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://labs.ft.com/2013/10/client-side-layout-engines-react-vs-fruitmachine/&quot;&gt;Read the full article...&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Even though we weren&amp;#39;t inspired by FruitMachine (React has been used in production since before FruitMachine was open sourced), it&amp;#39;s great to see similar technologies emerging and becoming popular.&lt;/p&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;react-brunch&quot;&gt;&lt;/a&gt;React Brunch &lt;a class=&quot;hash-link&quot; href=&quot;#react-brunch&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;http://elucidata.net/&quot;&gt;Matthew McCray&lt;/a&gt; implemented &lt;a href=&quot;https://npmjs.org/package/react-brunch&quot;&gt;react-brunch&lt;/a&gt;, a JSX compilation step for &lt;a href=&quot;http://brunch.io/&quot;&gt;Brunch&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Adds React support to brunch by automatically compiling &lt;code&gt;*.jsx&lt;/code&gt; files.&lt;/p&gt;
&lt;p&gt;You can configure react-brunch to automatically insert a react header (&lt;code&gt;/** @jsx React.DOM */&lt;/code&gt;) into all &lt;code&gt;*.jsx&lt;/code&gt; files. Disabled by default.&lt;/p&gt;
&lt;p&gt;Install the plugin via npm with &lt;code&gt;npm install --save react-brunch&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://npmjs.org/package/react-brunch&quot;&gt;Read more...&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;random-tweet&quot;&gt;&lt;/a&gt;Random Tweet &lt;a class=&quot;hash-link&quot; href=&quot;#random-tweet&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;I&amp;#39;m going to start adding a tweet at the end of each round-up. We&amp;#39;ll start with this one:&lt;/p&gt;
&lt;blockquote class=&quot;twitter-tweet&quot;&gt;&lt;p&gt;This weekend &lt;a href=&quot;https://twitter.com/search?q=%23angular&amp;amp;src=hash&quot;&gt;#angular&lt;/a&gt; died for me. Meet new king &lt;a href=&quot;https://twitter.com/search?q=%23reactjs&amp;amp;src=hash&quot;&gt;#reactjs&lt;/a&gt;&lt;/p&gt;&amp;mdash; Eldar Djafarov &amp;#x30C3; (@edjafarov) &lt;a href=&quot;https://twitter.com/edjafarov/statuses/397033796710961152&quot;&gt;November 3, 2013&lt;/a&gt;&lt;/blockquote&gt;
</description>
<pubDate>2013-11-06T00:00:00+01:00</pubDate>
<link>http://facebook.github.io/react/blog/2013/11/06/community-roundup-10.html</link>
<guid isPermaLink="true">http://facebook.github.io/react/blog/2013/11/06/community-roundup-10.html</guid>
</item>
<item>
<title>Thinking in React</title>
<description>&lt;p&gt;React is, in my opinion, the premier way to build big, fast Web apps with JavaScript. It&amp;#39;s scaled very well for us at Facebook and Instagram.&lt;/p&gt;
&lt;p&gt;One of the many great parts of React is how it makes you think about apps as you build them. In this post I&amp;#39;ll walk you through the thought process of building a searchable product data table using React.&lt;/p&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;start-with-a-mock&quot;&gt;&lt;/a&gt;Start with a mock &lt;a class=&quot;hash-link&quot; href=&quot;#start-with-a-mock&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Imagine that we already have a JSON API and a mock from our designer. Our designer apparently isn&amp;#39;t very good because the mock looks like this:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/react/img/blog/thinking-in-react-mock.png&quot; alt=&quot;Mockup&quot;&gt;&lt;/p&gt;
&lt;p&gt;Our JSON API returns some data that looks like this:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;text language-text&quot; data-lang=&quot;text&quot;&gt;[
{category: &amp;quot;Sporting Goods&amp;quot;, price: &amp;quot;$49.99&amp;quot;, stocked: true, name: &amp;quot;Football&amp;quot;},
{category: &amp;quot;Sporting Goods&amp;quot;, price: &amp;quot;$9.99&amp;quot;, stocked: true, name: &amp;quot;Baseball&amp;quot;},
{category: &amp;quot;Sporting Goods&amp;quot;, price: &amp;quot;$29.99&amp;quot;, stocked: false, name: &amp;quot;Basketball&amp;quot;},
{category: &amp;quot;Electronics&amp;quot;, price: &amp;quot;$99.99&amp;quot;, stocked: true, name: &amp;quot;iPod Touch&amp;quot;},
{category: &amp;quot;Electronics&amp;quot;, price: &amp;quot;$399.99&amp;quot;, stocked: false, name: &amp;quot;iPhone 5&amp;quot;},
{category: &amp;quot;Electronics&amp;quot;, price: &amp;quot;$199.99&amp;quot;, stocked: true, name: &amp;quot;Nexus 7&amp;quot;}
];
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;step-1-break-the-ui-into-a-component-hierarchy&quot;&gt;&lt;/a&gt;Step 1: break the UI into a component hierarchy &lt;a class=&quot;hash-link&quot; href=&quot;#step-1-break-the-ui-into-a-component-hierarchy&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The first thing you&amp;#39;ll want to do is to draw boxes around every component (and subcomponent) in the mock and give them all names. If you&amp;#39;re working with a designer they may have already done this, so go talk to them! Their Photoshop layer names may end up being the names of your React components!&lt;/p&gt;
&lt;p&gt;But how do you know what should be its own component? Just use the same techniques for deciding if you should create a new function or object. One such technique is the &lt;a href=&quot;http://en.wikipedia.org/wiki/Single_responsibility_principle&quot;&gt;single responsibility principle&lt;/a&gt;, that is, a component should ideally only do one thing. If it ends up growing it should be decomposed into smaller subcomponents.&lt;/p&gt;
&lt;p&gt;Since you&amp;#39;re often displaying a JSON data model to a user, you&amp;#39;ll find that if your model was built correctly your UI (and therefore your component structure) will map nicely onto it. That&amp;#39;s because user interfaces and data models tend to adhere to the same &lt;em&gt;information architecture&lt;/em&gt; which means the work of separating your UI into components is often trivial. Just break it up into components that represent exactly one piece of your data model.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/react/img/blog/thinking-in-react-components.png&quot; alt=&quot;Component diagram&quot;&gt;&lt;/p&gt;
&lt;p&gt;You&amp;#39;ll see here that we have five components in our simple app. I&amp;#39;ve italicized the data each component represents.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;FilterableProductTable&lt;/code&gt; (orange):&lt;/strong&gt; contains the entirety of the example&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;SearchBar&lt;/code&gt; (blue):&lt;/strong&gt; receives all &lt;em&gt;user input&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;ProductTable&lt;/code&gt; (green):&lt;/strong&gt; displays and filters the &lt;em&gt;data collection&lt;/em&gt; based on &lt;em&gt;user input&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;ProductCategoryRow&lt;/code&gt; (turquoise):&lt;/strong&gt; displays a heading for each &lt;em&gt;category&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;ProductRow&lt;/code&gt; (red):&lt;/strong&gt; displays a row for each &lt;em&gt;product&lt;/em&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If you look at &lt;code&gt;ProductTable&lt;/code&gt; you&amp;#39;ll see that the table header (containing the &amp;quot;Name&amp;quot; and &amp;quot;Price&amp;quot; labels) isn&amp;#39;t its own component. This is a matter of preference and there&amp;#39;s an argument to be made either way. For this example I left it as part of &lt;code&gt;ProductTable&lt;/code&gt; because it is part of rendering the &lt;em&gt;data collection&lt;/em&gt; which is &lt;code&gt;ProductTable&lt;/code&gt;&amp;#39;s responsibility. However if this header grows to be complex (i.e. if we were to add affordances for sorting) it would certainly make sense to make this its own &lt;code&gt;ProductTableHeader&lt;/code&gt; component.&lt;/p&gt;
&lt;p&gt;Now that we&amp;#39;ve identified the components in our mock, let&amp;#39;s arrange them into a hierarchy. This is easy. Components that appear within another component in the mock should appear as a child in the hierarchy:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;FilterableProductTable&lt;/code&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;SearchBar&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ProductTable&lt;/code&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;ProductCategoryRow&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ProductRow&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;step-2-build-a-static-version-in-react&quot;&gt;&lt;/a&gt;Step 2: Build a static version in React &lt;a class=&quot;hash-link&quot; href=&quot;#step-2-build-a-static-version-in-react&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;iframe width=&quot;100%&quot; height=&quot;300&quot; src=&quot;http://jsfiddle.net/6wQMG/embedded/&quot; allowfullscreen=&quot;allowfullscreen&quot; frameborder=&quot;0&quot;&gt;&lt;/iframe&gt;
&lt;p&gt;Now that you have your component hierarchy it&amp;#39;s time to start implementing your app. The easiest way is to build a version that takes your data model and renders the UI but has no interactivity. It&amp;#39;s easiest to decouple these processes because building building a static version requires a lot of typing and no thinking, and adding interactivity requires a lot of thinking and not a lot of typing. We&amp;#39;ll see why.&lt;/p&gt;
&lt;p&gt;To build a static version of your app that renders your data model you&amp;#39;ll want to build components that reuse other components and pass data using &lt;em&gt;props&lt;/em&gt;. &lt;em&gt;props&lt;/em&gt; are a way of passing data from parent to child. If you&amp;#39;re familiar with the concept of &lt;em&gt;state&lt;/em&gt;, &lt;strong&gt;don&amp;#39;t use state at all&lt;/strong&gt; to build this static version. State is reserved only for interactivity, that is, data that changes over time. Since this is a static version of the app you don&amp;#39;t need it.&lt;/p&gt;
&lt;p&gt;You can build top-down or bottom-up. That is, you can either start with building the components higher up in the hierarchy (i.e. starting with &lt;code&gt;FilterableProductTable&lt;/code&gt;) or with the ones lower in it (&lt;code&gt;ProductRow&lt;/code&gt;). In simpler examples it&amp;#39;s usually easier to go top-down and on larger projects it&amp;#39;s easier to go bottom-up and write tests as you build.&lt;/p&gt;
&lt;p&gt;At the end of this step you&amp;#39;ll have a library of reusable components that render your data model. The components will only have &lt;code&gt;render()&lt;/code&gt; methods since this is a static version of your app. The component at the top of the hierarchy (&lt;code&gt;FilterableProductTable&lt;/code&gt;) will take your data model as a prop. If you make a change to your underlying data model and call &lt;code&gt;renderComponent()&lt;/code&gt; again the UI will be updated. It&amp;#39;s easy to see how your UI is updated and where to make changes since there&amp;#39;s nothing complicated going on since React&amp;#39;s &lt;strong&gt;one-way data flow&lt;/strong&gt; (also called &lt;em&gt;one-way binding&lt;/em&gt;) keeps everything modular, easy to reason about, and fast.&lt;/p&gt;
&lt;p&gt;Simply refer to the &lt;a href=&quot;http://facebook.github.io/react/docs/&quot;&gt;React docs&lt;/a&gt; if you need help executing this step.&lt;/p&gt;
&lt;h3&gt;&lt;a class=&quot;anchor&quot; name=&quot;a-brief-interlude-props-vs-state&quot;&gt;&lt;/a&gt;A brief interlude: props vs state &lt;a class=&quot;hash-link&quot; href=&quot;#a-brief-interlude-props-vs-state&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;There are two types of &amp;quot;model&amp;quot; data in React: props and state. It&amp;#39;s important to understand the distinction between the two; skim &lt;a href=&quot;http://facebook.github.io/react/docs/interactivity-and-dynamic-uis.html&quot;&gt;the official React docs&lt;/a&gt; if you aren&amp;#39;t sure what the difference is.&lt;/p&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;step-3-identify-the-minimal-but-complete-representation-of-ui-state&quot;&gt;&lt;/a&gt;Step 3: Identify the minimal (but complete) representation of UI state &lt;a class=&quot;hash-link&quot; href=&quot;#step-3-identify-the-minimal-but-complete-representation-of-ui-state&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;To make your UI interactive you need to be able to trigger changes to your underlying data model. React makes this easy with &lt;strong&gt;state&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;To build your app correctly you first need to think of the minimal set of mutable state that your app needs. The key here is DRY: &lt;em&gt;Don&amp;#39;t Repeat Yourself&lt;/em&gt;. Figure out what the absolute minimal representation of the state of your application needs to be and compute everything else you need on-demand. For example, if you&amp;#39;re building a TODO list, just keep an array of the TODO items around; don&amp;#39;t keep a separate state variable for the count. Instead, when you want to render the TODO count simply take the length of the TODO items array.&lt;/p&gt;
&lt;p&gt;Think of all of the pieces of data in our example application. We have:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The original list of products&lt;/li&gt;
&lt;li&gt;The search text the user has entered&lt;/li&gt;
&lt;li&gt;The value of the checkbox&lt;/li&gt;
&lt;li&gt;The filtered list of products&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Let&amp;#39;s go through each one and figure out which one is state. Simply ask three questions about each piece of data:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Is it passed in from a parent via props? If so, it probably isn&amp;#39;t state.&lt;/li&gt;
&lt;li&gt;Does it change over time? If not, it probably isn&amp;#39;t state.&lt;/li&gt;
&lt;li&gt;Can you compute it based on any other state or props in your component? If so, it&amp;#39;s not state.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The original list of products is passed in as props, so that&amp;#39;s not state. The search text and the checkbox seem to be state since they change over time and can&amp;#39;t be computed from anything. And finally, the filtered list of products isn&amp;#39;t state because it can be computed by combining the original list of products with the search text and value of the checkbox.&lt;/p&gt;
&lt;p&gt;So finally, our state is:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The search text the user has entered&lt;/li&gt;
&lt;li&gt;The value of the checkbox&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;step-4-identify-where-your-state-should-live&quot;&gt;&lt;/a&gt;Step 4: Identify where your state should live &lt;a class=&quot;hash-link&quot; href=&quot;#step-4-identify-where-your-state-should-live&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;iframe width=&quot;100%&quot; height=&quot;300&quot; src=&quot;http://jsfiddle.net/QvHnx/embedded/&quot; allowfullscreen=&quot;allowfullscreen&quot; frameborder=&quot;0&quot;&gt;&lt;/iframe&gt;
&lt;p&gt;OK, so we&amp;#39;ve identified what the minimal set of app state is. Next we need to identify which component mutates, or &lt;em&gt;owns&lt;/em&gt;, this state.&lt;/p&gt;
&lt;p&gt;Remember: React is all about one-way data flow down the component hierarchy. It may not be immediately clear which component should own what state. &lt;strong&gt;This is often the most challenging part for newcomers to understand,&lt;/strong&gt; so follow these steps to figure it out:&lt;/p&gt;
&lt;p&gt;For each piece of state in your application:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Identify every component that renders something based on that state.&lt;/li&gt;
&lt;li&gt;Find a common owner component (a single component above all the components that need the state in the hierarchy).&lt;/li&gt;
&lt;li&gt;Either the common owner or another component higher up in the hierarchy should own the state.&lt;/li&gt;
&lt;li&gt;If you can&amp;#39;t find a component where it makes sense to own the state, create a new component simply for holding the state and add it somewhere in the hierarchy above the common owner component.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Let&amp;#39;s run through this strategy for our application:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;ProductTable&lt;/code&gt; needs to filter the product list based on state and &lt;code&gt;SearchBar&lt;/code&gt; needs to display the search text and checked state.&lt;/li&gt;
&lt;li&gt;The common owner component is &lt;code&gt;FilterableProductTable&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;It conceptually makes sense for the filter text and checked value to live in &lt;code&gt;FilterableProductTable&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Cool, so we&amp;#39;ve decided that our state lives in &lt;code&gt;FilterableProductTable&lt;/code&gt;. First, add a &lt;code&gt;getInitialState()&lt;/code&gt; method to &lt;code&gt;FilterableProductTable&lt;/code&gt; that returns &lt;code&gt;{filterText: &amp;#39;&amp;#39;, inStockOnly: false}&lt;/code&gt; to reflect the initial state of your application. Then pass &lt;code&gt;filterText&lt;/code&gt; and &lt;code&gt;inStockOnly&lt;/code&gt; to &lt;code&gt;ProductTable&lt;/code&gt; and &lt;code&gt;SearchBar&lt;/code&gt; as a prop. Finally, use these props to filter the rows in &lt;code&gt;ProductTable&lt;/code&gt; and set the values of the form fields in &lt;code&gt;SearchBar&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;You can start seeing how your application will behave: set &lt;code&gt;filterText&lt;/code&gt; to &lt;code&gt;&amp;quot;ball&amp;quot;&lt;/code&gt; and refresh your app. You&amp;#39;ll see the data table is updated correctly.&lt;/p&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;step-5-add-inverse-data-flow&quot;&gt;&lt;/a&gt;Step 5: Add inverse data flow &lt;a class=&quot;hash-link&quot; href=&quot;#step-5-add-inverse-data-flow&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;iframe width=&quot;100%&quot; height=&quot;300&quot; src=&quot;http://jsfiddle.net/3Vs3Q/embedded/&quot; allowfullscreen=&quot;allowfullscreen&quot; frameborder=&quot;0&quot;&gt;&lt;/iframe&gt;
&lt;p&gt;So far we&amp;#39;ve built an app that renders correctly as a function of props and state flowing down the hierarchy. Now it&amp;#39;s time to support data flowing the other way: the form components deep in the hierarchy need to update the state in &lt;code&gt;FilterableProductTable&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;React makes this data flow explicit to make it easy to understand how your program works, but it does require a little more typing than traditional two-way data binding. React provides an add-on called &lt;code&gt;ReactLink&lt;/code&gt; to make this pattern as convenient as two-way binding, but for the purpose of this post we&amp;#39;ll keep everything explicit.&lt;/p&gt;
&lt;p&gt;If you try to type or check the box in the current version of the example you&amp;#39;ll see that React ignores your input. This is intentional, as we&amp;#39;ve set the &lt;code&gt;value&lt;/code&gt; prop of the &lt;code&gt;input&lt;/code&gt; to always be equal to the &lt;code&gt;state&lt;/code&gt; passed in from &lt;code&gt;FilterableProductTable&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Let&amp;#39;s think about what we want to happen. We want to make sure that whenever the user changes the form we update the state to reflect the user input. Since components should only update their own state, &lt;code&gt;FilterableProductTable&lt;/code&gt; will pass a callback to &lt;code&gt;SearchBar&lt;/code&gt; that will fire whenever the state should be updated. We can use the &lt;code&gt;onChange&lt;/code&gt; event on the inputs to be notified of it. And the callback passed by &lt;code&gt;FilterableProductTable&lt;/code&gt; will call &lt;code&gt;setState()&lt;/code&gt; and the app will be updated.&lt;/p&gt;
&lt;p&gt;Though this sounds like a lot it&amp;#39;s really just a few lines of code. And it&amp;#39;s really explicit how your data is flowing throughout the app.&lt;/p&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;and-thats-it&quot;&gt;&lt;/a&gt;And that&amp;#39;s it &lt;a class=&quot;hash-link&quot; href=&quot;#and-thats-it&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Hopefully this gives you an idea of how to think about building components and applications with React. While it may be a little more typing than you&amp;#39;re used to, remember that code is read far more than it&amp;#39;s written, and it&amp;#39;s extremely easy to read this modular, explicit code. As you start to build large libraries of components you&amp;#39;ll appreciate this explicitness and modularity, and with code reuse your lines of code will start to shrink :)&lt;/p&gt;
</description>
<pubDate>2013-11-05T00:00:00+01:00</pubDate>
<link>http://facebook.github.io/react/blog/2013/11/05/thinking-in-react.html</link>
<guid isPermaLink="true">http://facebook.github.io/react/blog/2013/11/05/thinking-in-react.html</guid>
</item>
<item>
<title>React v0.5.1</title>
<description>&lt;p&gt;This release focuses on fixing some small bugs that have been uncovered over the past two weeks. I would like to thank everybody involved, specifically members of the community who fixed half of the issues found. Thanks to &lt;a href=&quot;https://github.com/spicyj&quot;&gt;Ben Alpert&lt;/a&gt;, &lt;a href=&quot;https://github.com/andreypopp&quot;&gt;Andrey Popp&lt;/a&gt;, and &lt;a href=&quot;https://github.com/lrowe&quot;&gt;Laurence Rowe&lt;/a&gt; for their contributions!&lt;/p&gt;
&lt;h2&gt;&lt;a class=&quot;anchor&quot; name=&quot;changelog&quot;&gt;&lt;/a&gt;Changelog &lt;a class=&quot;hash-link&quot; href=&quot;#changelog&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;&lt;h3&gt;&lt;a class=&quot;anchor&quot; name=&quot;react&quot;&gt;&lt;/a&gt;React &lt;a class=&quot;hash-link&quot; href=&quot;#react&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Fixed bug with &lt;code&gt;&amp;lt;input type=&amp;quot;range&amp;quot;&amp;gt;&lt;/code&gt; and selection events.&lt;/li&gt;
&lt;li&gt;Fixed bug with selection and focus.&lt;/li&gt;
&lt;li&gt;Made it possible to unmount components from the document root.&lt;/li&gt;
&lt;li&gt;Fixed bug for &lt;code&gt;disabled&lt;/code&gt; attribute handling on non-&lt;code&gt;&amp;lt;input&amp;gt;&lt;/code&gt; elements.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;&lt;a class=&quot;anchor&quot; name=&quot;react-with-addons&quot;&gt;&lt;/a&gt;React with Addons &lt;a class=&quot;hash-link&quot; href=&quot;#react-with-addons&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Fixed bug with transition and animation event detection.&lt;/li&gt;
&lt;/ul&gt;
</description>
<pubDate>2013-10-29T00:00:00+01:00</pubDate>
<link>http://facebook.github.io/react/blog/2013/10/29/react-v0-5-1.html</link>
<guid isPermaLink="true">http://facebook.github.io/react/blog/2013/10/29/react-v0-5-1.html</guid>
</item>
</channel>
</rss>