mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
606 lines
58 KiB
HTML
606 lines
58 KiB
HTML
<!DOCTYPE html>
|
||
<!--[if IE]><![endif]-->
|
||
<html>
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||
<title>React | Blog</title>
|
||
<meta name="viewport" content="width=device-width">
|
||
<meta property="og:title" content="React | Blog">
|
||
<meta property="og:type" content="website">
|
||
<meta property="og:url" content="http://facebook.github.io/react/blog/index.html">
|
||
<meta property="og:image" content="http://facebook.github.io/react/img/logo_og.png">
|
||
<meta property="og:description" content="A JavaScript library for building user interfaces">
|
||
<meta property="fb:app_id" content="623268441017527">
|
||
|
||
<link rel="shortcut icon" href="/react/favicon.ico">
|
||
<link rel="alternate" type="application/rss+xml" title="React" href="http://facebook.github.io/react/feed.xml">
|
||
|
||
<link rel="stylesheet" href="/react/css/syntax.css">
|
||
<link rel="stylesheet" href="/react/css/codemirror.css">
|
||
<link rel="stylesheet" href="/react/css/react.css">
|
||
|
||
<script type="text/javascript" src="//use.typekit.net/vqa1hcx.js"></script>
|
||
<script type="text/javascript">try{Typekit.load();}catch(e){}</script>
|
||
|
||
<!--[if lte IE 8]>
|
||
<script type="text/javascript" src="/react/js/html5shiv.min.js"></script>
|
||
<script type="text/javascript" src="/react/js/es5-shim.min.js"></script>
|
||
<script type="text/javascript" src="/react/js/es5-sham.min.js"></script>
|
||
<![endif]-->
|
||
<script type="text/javascript" src="/react/js/codemirror.js"></script>
|
||
<script type="text/javascript" src="/react/js/javascript.js"></script>
|
||
<script type="text/javascript" src="/react/js/react.js"></script>
|
||
<script type="text/javascript" src="/react/js/JSXTransformer.js"></script>
|
||
<script type="text/javascript" src="/react/js/live_editor.js"></script>
|
||
<script type="text/javascript" src="/react/js/showdown.js"></script>
|
||
</head>
|
||
<body>
|
||
|
||
<div class="container">
|
||
|
||
<div class="nav-main">
|
||
<div class="wrap">
|
||
<a class="nav-home" href="/react/index.html">
|
||
<img class="nav-logo" alt="" src="/react/img/logo_small.png" width="38" height="38">
|
||
React
|
||
</a>
|
||
<ul class="nav-site">
|
||
<li><a href="/react/docs/getting-started.html">docs</a></li>
|
||
<li><a href="/react/support.html">support</a></li>
|
||
<li><a href="/react/downloads.html">download</a></li>
|
||
<li><a href="/react/blog/" class="active">blog</a></li>
|
||
<li><a href="http://github.com/facebook/react">github</a>
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
|
||
<section class="content wrap blogContent">
|
||
<div class="nav-docs nav-blog">
|
||
<div class="nav-docs-section">
|
||
<h3>Recent posts</h3>
|
||
<ul>
|
||
|
||
<li><a href="/react/blog/2014/07/28/community-roundup-20.html">Community Round-up #20</a></li>
|
||
|
||
<li><a href="/react/blog/2014/07/25/react-v0.11.1.html">React v0.11.1</a></li>
|
||
|
||
<li><a href="/react/blog/2014/07/17/react-v0.11.html">React v0.11</a></li>
|
||
|
||
<li><a href="/react/blog/2014/07/13/react-v0.11-rc1.html">React v0.11 RC</a></li>
|
||
|
||
<li><a href="/react/blog/2014/06/27/community-roundup-19.html">Community Round-up #19</a></li>
|
||
|
||
<li><a href="/react/blog/2014/05/29/one-year-of-open-source-react.html">One Year of Open-Source React</a></li>
|
||
|
||
<li><a href="/react/blog/2014/05/06/flux.html">Flux: An Application Architecture for React</a></li>
|
||
|
||
<li><a href="/react/blog/2014/04/04/reactnet.html">Use React and JSX in ASP.NET MVC</a></li>
|
||
|
||
<li><a href="/react/blog/2014/03/28/the-road-to-1.0.html">The Road to 1.0</a></li>
|
||
|
||
<li><a href="/react/blog/2014/03/21/react-v0.10.html">React v0.10</a></li>
|
||
|
||
<li><a href="/react/blog/all.html">All posts ...</a></li>
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="inner-content">
|
||
|
||
<div class="post-list-item">
|
||
<h1><a href="/react/blog/2014/07/28/community-roundup-20.html">Community Round-up #20</a></h1>
|
||
<p class="meta">July 28, 2014 by Lou Husson</p>
|
||
<hr />
|
||
<div class="post">
|
||
<p>It's an exciting time for React as there are now more commits from open source contributors than Facebook engineers! Keep up the good work :)</p>
|
||
<h2><a class="anchor" name="atom-moves-to-react"></a>Atom moves to React <a class="hash-link" href="#atom-moves-to-react">#</a></h2>
|
||
<p><a href="http://blog.atom.io/2014/07/02/moving-atom-to-react.html">Atom, GitHub's code editor, is now using React</a> to build the editing experience. They did the move in order to improve performance. By default, React helped them eliminate unnecessary reflows. Then, they were able to architecture the rendering pipeline in order to minimize repaint with hardware acceleration. This is a testament that React's architecture is viable for high performant applications.</p>
|
||
|
||
<p><a href="http://blog.atom.io/2014/07/02/moving-atom-to-react.html"><img src="http://blog.atom.io/img/posts/gpu-cursor-move.gif" style="width: 100%;" /></a></p>
|
||
<h2><a class="anchor" name="why-does-react-scale"></a>Why Does React Scale? <a class="hash-link" href="#why-does-react-scale">#</a></h2>
|
||
<p>At the last <a href="http://2014.jsconf.us/">JSConf.us</a>, Vjeux talked about the design decisions of the API that makes it scale for large number of developers. If you don't have 20 minutes, take a look at the <a href="https://speakerdeck.com/vjeux/why-does-react-scale-jsconf-2014">annotated slides</a>.</p>
|
||
|
||
<iframe width="650" height="315" src="//www.youtube.com/embed/D-ioDiacTm8" frameborder="0" allowfullscreen></iframe>
|
||
<h2><a class="anchor" name="live-editing"></a>Live Editing <a class="hash-link" href="#live-editing">#</a></h2>
|
||
<p>The best feature of React is that it provides fundations to implement concepts that were otherwise extremely hard to like server-side rendering, undo-redo, rendering to non-DOM like canvas... <a href="https://twitter.com/dan_abramov">Dan Abramov</a> got hot code reloading working with webpack in order to <a href="http://gaearon.github.io/react-hot-loader/">live edit a React project</a>!</p>
|
||
|
||
<iframe src="//player.vimeo.com/video/100010922" width="650" height="315" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
|
||
<h2><a class="anchor" name="reactintl-mixin-by-yahoo"></a>ReactIntl Mixin by Yahoo <a class="hash-link" href="#reactintl-mixin-by-yahoo">#</a></h2>
|
||
<p>There's a couple of React-related projects that recently appeared on Yahoo's GitHub. The first one is an <a href="https://github.com/yahoo/react-intl">internationalization mixin</a>. That's exciting to see them contributing.</p>
|
||
<div class="highlight"><pre><code class="javascript language-javascript" data-lang="javascript"><span class="kd">var</span> <span class="nx">MyComponent</span> <span class="o">=</span> <span class="nx">React</span><span class="p">.</span><span class="nx">createClass</span><span class="p">({</span>
|
||
<span class="nx">mixins</span><span class="o">:</span> <span class="p">[</span><span class="nx">ReactIntlMixin</span><span class="p">],</span>
|
||
<span class="nx">render</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
|
||
<span class="k">return</span> <span class="p">(</span>
|
||
<span class="o"><</span><span class="nx">div</span><span class="o">></span>
|
||
<span class="o"><</span><span class="nx">p</span><span class="o">></span><span class="p">{</span><span class="k">this</span><span class="p">.</span><span class="nx">intlDate</span><span class="p">(</span><span class="mi">1390518044403</span><span class="p">,</span> <span class="p">{</span> <span class="nx">hour</span><span class="o">:</span> <span class="s1">'numeric'</span><span class="p">,</span> <span class="nx">minute</span><span class="o">:</span> <span class="s1">'numeric'</span> <span class="p">})}</span><span class="o"><</span><span class="err">/p></span>
|
||
<span class="o"><</span><span class="nx">p</span><span class="o">></span><span class="p">{</span><span class="k">this</span><span class="p">.</span><span class="nx">intlNumber</span><span class="p">(</span><span class="mi">400</span><span class="p">,</span> <span class="p">{</span> <span class="nx">style</span><span class="o">:</span> <span class="s1">'percent'</span> <span class="p">})}</span><span class="o"><</span><span class="err">/p></span>
|
||
<span class="o"><</span><span class="err">/div></span>
|
||
<span class="p">);</span>
|
||
<span class="p">}</span>
|
||
<span class="p">});</span>
|
||
|
||
<span class="nx">React</span><span class="p">.</span><span class="nx">renderComponent</span><span class="p">(</span>
|
||
<span class="o"><</span><span class="nx">MyComponent</span> <span class="nx">locales</span><span class="o">=</span><span class="p">{[</span><span class="s1">'fr-FR'</span><span class="p">]}</span> <span class="o">/></span><span class="p">,</span>
|
||
<span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="s1">'example'</span><span class="p">)</span>
|
||
<span class="p">);</span>
|
||
</code></pre></div><h2><a class="anchor" name="thinking-and-learning-react"></a>Thinking and Learning React <a class="hash-link" href="#thinking-and-learning-react">#</a></h2>
|
||
<p>Josephine Hall, working at Ice Lab studio, used React to write a mobile-focused application. She wrote a blog post <a href="http://icelab.com.au/articles/thinking-and-learning-reactjs/">“Thinking and Learning React.js”</a> to share her experience with elements they had to use. You'll learn about Routing, dispatch, touchable component and basic animations. </p>
|
||
<h2><a class="anchor" name="london-react-meetup"></a>London React Meetup <a class="hash-link" href="#london-react-meetup">#</a></h2>
|
||
<p>If you missed the last <a href="http://www.meetup.com/London-React-User-Group/events/191406572/">London React Meetup</a>, the video is available. Lots of great content. </p>
|
||
|
||
<ul>
|
||
<li>What's new in React 0.11 and how to improve performance by guaranteeing immutability</li>
|
||
<li>State handling in React with Morearty.JS</li>
|
||
<li>React on Rails - How to use React with Ruby on Rails, to build isomorphic apps</li>
|
||
<li>Building an isomorphic, real time to do list with moped and node.js</li>
|
||
</ul>
|
||
|
||
<iframe width="650" height="315" src="//www.youtube.com/embed/CP3lvm5Ppqo" frameborder="0" allowfullscreen></iframe>
|
||
|
||
<p>On a related news, the next <a href="http://www.meetup.com/ReactJS-San-Francisco/events/195518392/">React SF Meetup</a> is going to be from Prezi: <a href="https://medium.com/prezi-engineering/how-and-why-prezi-turned-to-javascript-56e0ca57d135">“Immediate Mode on the Web: How We Implemented the Prezi Viewer in JavaScript”</a>. While not in React, their tech is really awesome and share a lot of the design principles and perf optimizations.</p>
|
||
<h2><a class="anchor" name="using-react-and-kendoui-together"></a>Using React and KendoUI Together <a class="hash-link" href="#using-react-and-kendoui-together">#</a></h2>
|
||
<p>One of the strength of React is that it plays nicely with other libraries. Jim Cowart proved it by writing a tutorial that explains how to write <a href="http://www.ifandelse.com/using-reactjs-and-kendoui-together/">React component adapters for KendoUI</a>.</p>
|
||
|
||
<figure><a href="http://www.ifandelse.com/using-reactjs-and-kendoui-together/"><img src="/react/img/blog/kendoui.png" /></a></figure>
|
||
<h2><a class="anchor" name="acorn-jsx"></a>Acorn JSX <a class="hash-link" href="#acorn-jsx">#</a></h2>
|
||
<p>Ingvar Stepanyan extended Acorn JavaScript parser to support JSX. The result is a <a href="https://github.com/RReverser/acorn-jsx">JSX parser</a> that's 1.5-2x faster than the official JSX implementation. It is an experiment and is not meant to be used for serious things. It's always a good thing to get competition on performance!</p>
|
||
<h2><a class="anchor" name="reactscriptloader"></a>ReactScriptLoader <a class="hash-link" href="#reactscriptloader">#</a></h2>
|
||
<p>Yariv Sadan created <a href="https://github.com/yariv/ReactScriptLoader">ReactScriptLoader</a> to make it easier to write components that require an external script.</p>
|
||
<div class="highlight"><pre><code class="javascript language-javascript" data-lang="javascript"><span class="kd">var</span> <span class="nx">Foo</span> <span class="o">=</span> <span class="nx">React</span><span class="p">.</span><span class="nx">createClass</span><span class="p">({</span>
|
||
<span class="nx">mixins</span><span class="o">:</span> <span class="p">[</span><span class="nx">ReactScriptLoaderMixin</span><span class="p">],</span>
|
||
<span class="nx">getScriptURL</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
|
||
<span class="k">return</span> <span class="s1">'http://d3js.org/d3.v3.min.js'</span><span class="p">;</span>
|
||
<span class="p">},</span>
|
||
<span class="nx">getInitialState</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
|
||
<span class="k">return</span> <span class="p">{</span> <span class="nx">scriptLoading</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span> <span class="nx">scriptLoadError</span><span class="o">:</span> <span class="kc">false</span> <span class="p">};</span>
|
||
<span class="p">},</span>
|
||
<span class="nx">onScriptLoaded</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
|
||
<span class="k">this</span><span class="p">.</span><span class="nx">setState</span><span class="p">({</span><span class="nx">scriptLoading</span><span class="o">:</span> <span class="kc">false</span><span class="p">});</span>
|
||
<span class="p">},</span>
|
||
<span class="nx">onScriptError</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
|
||
<span class="k">this</span><span class="p">.</span><span class="nx">setState</span><span class="p">({</span><span class="nx">scriptLoading</span><span class="o">:</span> <span class="kc">false</span><span class="p">,</span> <span class="nx">scriptLoadError</span><span class="o">:</span> <span class="kc">true</span><span class="p">});</span>
|
||
<span class="p">},</span>
|
||
<span class="nx">render</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
|
||
<span class="kd">var</span> <span class="nx">message</span> <span class="o">=</span>
|
||
<span class="k">this</span><span class="p">.</span><span class="nx">state</span><span class="p">.</span><span class="nx">scriptLoading</span> <span class="o">?</span> <span class="s1">'Loading script...'</span> <span class="o">:</span>
|
||
<span class="k">this</span><span class="p">.</span><span class="nx">state</span><span class="p">.</span><span class="nx">scriptLoadError</span> <span class="o">?</span> <span class="s1">'Loading failed'</span> <span class="o">:</span>
|
||
<span class="s1">'Loading succeeded'</span><span class="p">;</span>
|
||
<span class="k">return</span> <span class="o"><</span><span class="nx">span</span><span class="o">></span><span class="p">{</span><span class="nx">message</span><span class="p">}</span><span class="o"><</span><span class="err">/span>;</span>
|
||
<span class="p">}</span>
|
||
<span class="p">});</span>
|
||
</code></pre></div><h2><a class="anchor" name="random-tweet"></a>Random Tweet <a class="hash-link" href="#random-tweet">#</a></h2>
|
||
<blockquote class="twitter-tweet" data-conversation="none" lang="en"><p>“<a href="https://twitter.com/apphacker">@apphacker</a>: I take back the mean things I said about <a href="https://twitter.com/reactjs">@reactjs</a> I actually like it.” Summarizing the life of ReactJS in a single tweet.</p>— Jordan (@jordwalke) <a href="https://twitter.com/jordwalke/statuses/490747339607265280">July 20, 2014</a></blockquote>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
<div class="post-list-item">
|
||
<h1><a href="/react/blog/2014/07/25/react-v0.11.1.html">React v0.11.1</a></h1>
|
||
<p class="meta">July 25, 2014 by Paul O’Shannessy</p>
|
||
<hr />
|
||
<div class="post">
|
||
<p>Today we're releasing React v0.11.1 to address a few small issues. Thanks to everybody who has reported them as they've begun upgrading.</p>
|
||
|
||
<p>The first of these is the most major and resulted in a regression with the use of <code>setState</code> inside <code>componentWillMount</code> when using React on the server. These <code>setState</code> calls are batched into the initial render. A change we made to our batching code resulted in this path hitting DOM specific code when run server-side, in turn throwing an error as <code>document</code> is not defined.</p>
|
||
|
||
<p>There are several fixes we're including in v0.11.1 that are focused around the newly supported <code>event.getModifierState()</code> function. We made some adjustments to improve this cross-browser standardization.</p>
|
||
|
||
<p>The final fix we're including is to better support a workaround for some IE8 behavior. The edge-case bug we're fixing was also present in v0.9 and v0.10, so while it wasn't a short-term regression, we wanted to make sure we support IE8 to the best of our abilities.</p>
|
||
|
||
<p>We'd also like to call out a couple additional breaking changes that we failed to originally mention in the release notes for v0.11. We updated that blog post and the changelog, so we encourage you to go read about the changes around <a href="/react/blog/2014/07/17/react-v0.11.html#descriptors">Descriptors</a> and <a href="/react/blog/2014/07/17/react-v0.11.html#prop-type-validation">Prop Type Validation</a>.</p>
|
||
|
||
<p>The release is available for download from the CDN:</p>
|
||
|
||
<ul>
|
||
<li><strong>React</strong><br>
|
||
Dev build with warnings: <a href="http://fb.me/react-0.11.1.js">http://fb.me/react-0.11.1.js</a><br>
|
||
Minified build for production: <a href="http://fb.me/react-0.11.1.min.js">http://fb.me/react-0.11.1.min.js</a><br></li>
|
||
<li><strong>React with Add-Ons</strong><br>
|
||
Dev build with warnings: <a href="http://fb.me/react-with-addons-0.11.1.js">http://fb.me/react-with-addons-0.11.1.js</a><br>
|
||
Minified build for production: <a href="http://fb.me/react-with-addons-0.11.1.min.js">http://fb.me/react-with-addons-0.11.1.min.js</a><br></li>
|
||
<li><strong>In-Browser JSX transformer</strong><br>
|
||
<a href="http://fb.me/JSXTransformer-0.11.1.js">http://fb.me/JSXTransformer-0.11.1.js</a></li>
|
||
</ul>
|
||
|
||
<p>We've also published version <code>0.11.1</code> of the <code>react</code> and <code>react-tools</code> packages on npm and the <code>react</code> package on bower.</p>
|
||
|
||
<p>Please try these builds out and <a href="https://github.com/facebook/react/issues/new">file an issue on GitHub</a> if you see anything awry.</p>
|
||
<h2><a class="anchor" name="changelog"></a>Changelog <a class="hash-link" href="#changelog">#</a></h2><h3><a class="anchor" name="react-core"></a>React Core <a class="hash-link" href="#react-core">#</a></h3><h4><a class="anchor" name="bug-fixes"></a>Bug Fixes <a class="hash-link" href="#bug-fixes">#</a></h4>
|
||
<ul>
|
||
<li><code>setState</code> can be called inside <code>componentWillMount</code> in non-DOM environments</li>
|
||
<li><code>SyntheticMouseEvent.getEventModifierState</code> correctly renamed to <code>getModifierState</code></li>
|
||
<li><code>getModifierState</code> correctly returns a <code>boolean</code></li>
|
||
<li><code>getModifierState</code> is now correctly case sensitive</li>
|
||
<li>Empty Text node used in IE8 <code>innerHTML</code> workaround is now removed, fixing rerendering in certain cases</li>
|
||
</ul>
|
||
<h3><a class="anchor" name="jsxtransformer"></a>JSXTransformer <a class="hash-link" href="#jsxtransformer">#</a></h3>
|
||
<ul>
|
||
<li>Fix duplicate variable declaration (caused issues in some browsers)</li>
|
||
</ul>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
<div class="post-list-item">
|
||
<h1><a href="/react/blog/2014/07/17/react-v0.11.html">React v0.11</a></h1>
|
||
<p class="meta">July 17, 2014 by Paul O’Shannessy</p>
|
||
<hr />
|
||
<div class="post">
|
||
<p><strong>Update:</strong> We missed a few important changes in our initial post and changelog. We've updated this post with details about <a href="#descriptors">Descriptors</a> and <a href="#prop-type-validation">Prop Type Validation</a>.</p>
|
||
|
||
<hr>
|
||
|
||
<p>We're really happy to announce the availability of React v0.11. There seems to be a lot of excitement already and we appreciate everybody who gave the release candidate a try over the weekend. We made a couple small changes in response to the feedback and issues filed. We enabled the destructuring assignment transform when using <code>jsx --harmony</code>, fixed a small regression with <code>statics</code>, and made sure we actually exposed the new API we said we were shipping: <code>React.Children.count</code>.</p>
|
||
|
||
<p>This version has been cooking for a couple months now and includes a wide array of bug fixes and features. We highlighted some of the most important changes below, along with the full changelog.</p>
|
||
|
||
<p>The release is available for download from the CDN:</p>
|
||
|
||
<ul>
|
||
<li><strong>React</strong><br>
|
||
Dev build with warnings: <a href="http://fb.me/react-0.11.0.js">http://fb.me/react-0.11.0.js</a><br>
|
||
Minified build for production: <a href="http://fb.me/react-0.11.0.min.js">http://fb.me/react-0.11.0.min.js</a><br></li>
|
||
<li><strong>React with Add-Ons</strong><br>
|
||
Dev build with warnings: <a href="http://fb.me/react-with-addons-0.11.0.js">http://fb.me/react-with-addons-0.11.0.js</a><br>
|
||
Minified build for production: <a href="http://fb.me/react-with-addons-0.11.0.min.js">http://fb.me/react-with-addons-0.11.0.min.js</a><br></li>
|
||
<li><strong>In-Browser JSX transformer</strong><br>
|
||
<a href="http://fb.me/JSXTransformer-0.11.0.js">http://fb.me/JSXTransformer-0.11.0.js</a></li>
|
||
</ul>
|
||
|
||
<p>We've also published version <code>0.11.0</code> of the <code>react</code> and <code>react-tools</code> packages on npm and the <code>react</code> package on bower.</p>
|
||
|
||
<p>Please try these builds out and <a href="https://github.com/facebook/react/issues/new">file an issue on GitHub</a> if you see anything awry.</p>
|
||
<h2><a class="anchor" name="getdefaultprops"></a><code>getDefaultProps</code> <a class="hash-link" href="#getdefaultprops">#</a></h2>
|
||
<p>Starting in React 0.11, <code>getDefaultProps()</code> is called only once when <code>React.createClass()</code> is called, instead of each time a component is rendered. This means that <code>getDefaultProps()</code> can no longer vary its return value based on <code>this.props</code> and any objects will be shared across all instances. This change improves performance and will make it possible in the future to do PropTypes checks earlier in the rendering process, allowing us to give better error messages.</p>
|
||
<h2><a class="anchor" name="rendering-to-null"></a>Rendering to <code>null</code> <a class="hash-link" href="#rendering-to-null">#</a></h2>
|
||
<p>Since React's release, people have been using work arounds to "render nothing". Usually this means returning an empty <code><div/></code> or <code><span/></code>. Some people even got clever and started returning <code><noscript/></code> to avoid extraneous DOM nodes. We finally provided a "blessed" solution that allows developers to write meaningful code. Returning <code>null</code> is an explicit indication to React that you do not want anything rendered. Behind the scenes we make this work with a <code><noscript></code> element, though in the future we hope to not put anything in the document. In the mean time, <code><noscript></code> elements do not affect layout in any way, so you can feel safe using <code>null</code> today!</p>
|
||
<div class="highlight"><pre><code class="js language-js" data-lang="js"><span class="c1">// Before</span>
|
||
<span class="nx">render</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
|
||
<span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">state</span><span class="p">.</span><span class="nx">visible</span><span class="p">)</span> <span class="p">{</span>
|
||
<span class="k">return</span> <span class="o"><</span><span class="nx">span</span><span class="o">/></span><span class="p">;</span>
|
||
<span class="p">}</span>
|
||
<span class="c1">// ...</span>
|
||
<span class="p">}</span>
|
||
|
||
<span class="c1">// After</span>
|
||
<span class="nx">render</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
|
||
<span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">state</span><span class="p">.</span><span class="nx">visible</span><span class="p">)</span> <span class="p">{</span>
|
||
<span class="k">return</span> <span class="kc">null</span><span class="p">;</span>
|
||
<span class="p">}</span>
|
||
<span class="c1">// ...</span>
|
||
<span class="p">}</span>
|
||
</code></pre></div><h2><a class="anchor" name="jsx-namespacing"></a>JSX Namespacing <a class="hash-link" href="#jsx-namespacing">#</a></h2>
|
||
<p>Another feature request we've been hearing for a long time is the ability to have namespaces in JSX. Given that JSX is just JavaScript, we didn't want to use XML namespacing. Instead we opted for a standard JS approach: object property access. Instead of assigning variables to access components stored in an object (such as a component library), you can now use the component directly as <code><Namespace.Component/></code>.</p>
|
||
<div class="highlight"><pre><code class="js language-js" data-lang="js"><span class="c1">// Before</span>
|
||
<span class="kd">var</span> <span class="nx">UI</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">'UI'</span><span class="p">);</span>
|
||
<span class="kd">var</span> <span class="nx">UILayout</span> <span class="o">=</span> <span class="nx">UI</span><span class="p">.</span><span class="nx">Layout</span><span class="p">;</span>
|
||
<span class="kd">var</span> <span class="nx">UIButton</span> <span class="o">=</span> <span class="nx">UI</span><span class="p">.</span><span class="nx">Button</span><span class="p">;</span>
|
||
<span class="kd">var</span> <span class="nx">UILabel</span> <span class="o">=</span> <span class="nx">UI</span><span class="p">.</span><span class="nx">Label</span><span class="p">;</span>
|
||
|
||
<span class="nx">render</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
|
||
<span class="k">return</span> <span class="o"><</span><span class="nx">UILayout</span><span class="o">><</span><span class="nx">UIButton</span> <span class="o">/><</span><span class="nx">UILabel</span><span class="o">></span><span class="nx">text</span><span class="o"><</span><span class="err">/UILabel></UILayout>;</span>
|
||
<span class="p">}</span>
|
||
|
||
<span class="c1">// After</span>
|
||
<span class="kd">var</span> <span class="nx">UI</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">'UI'</span><span class="p">);</span>
|
||
|
||
<span class="nx">render</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
|
||
<span class="k">return</span> <span class="o"><</span><span class="nx">UI</span><span class="p">.</span><span class="nx">Layout</span><span class="o">><</span><span class="nx">UI</span><span class="p">.</span><span class="nx">Button</span> <span class="o">/><</span><span class="nx">UI</span><span class="p">.</span><span class="nx">Label</span><span class="o">></span><span class="nx">text</span><span class="o"><</span><span class="err">/UI.Label></UI.Layout>;</span>
|
||
<span class="p">}</span>
|
||
</code></pre></div><h2><a class="anchor" name="improved-keyboard-event-normalization"></a>Improved keyboard event normalization <a class="hash-link" href="#improved-keyboard-event-normalization">#</a></h2>
|
||
<p>Keyboard events now contain a normalized <code>e.key</code> value according to the <a href="http://www.w3.org/TR/DOM-Level-3-Events/#keys-special">DOM Level 3 Events spec</a>, allowing you to write simpler key handling code that works in all browsers, such as:</p>
|
||
<div class="highlight"><pre><code class="js language-js" data-lang="js"><span class="nx">handleKeyDown</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">e</span><span class="p">)</span> <span class="p">{</span>
|
||
<span class="k">if</span> <span class="p">(</span><span class="nx">e</span><span class="p">.</span><span class="nx">key</span> <span class="o">===</span> <span class="s1">'Enter'</span><span class="p">)</span> <span class="p">{</span>
|
||
<span class="c1">// Handle enter key</span>
|
||
<span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">e</span><span class="p">.</span><span class="nx">key</span> <span class="o">===</span> <span class="s1">' '</span><span class="p">)</span> <span class="p">{</span>
|
||
<span class="c1">// Handle spacebar</span>
|
||
<span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">e</span><span class="p">.</span><span class="nx">key</span> <span class="o">===</span> <span class="s1">'ArrowLeft'</span><span class="p">)</span> <span class="p">{</span>
|
||
<span class="c1">// Handle left arrow</span>
|
||
<span class="p">}</span>
|
||
<span class="p">},</span>
|
||
</code></pre></div>
|
||
<p>Keyboard and mouse events also now include a normalized <code>e.getModifierState()</code> that works consistently across browsers.</p>
|
||
<h2><a class="anchor" name="descriptors"></a>Descriptors <a class="hash-link" href="#descriptors">#</a></h2>
|
||
<p>In our <a href="http://facebook.github.io/react/blog/2014/03/21/react-v0.10.html#clone-on-mount">v0.10 release notes</a>, we called out that we were deprecating the existing behavior of the component function call (eg <code>component = MyComponent(props, ...children)</code> or <code>component = <MyComponent prop={...}/></code>). Previously that would create an instance and React would modify that internally. You could store that reference and then call functions on it (eg <code>component.setProps(...)</code>). This no longer works. <code>component</code> in the above examples will be a descriptor and not an instance that can be operated on. The v0.10 release notes provide a complete example along with a migration path. The development builds also provided warnings if you called functions on descriptors.</p>
|
||
|
||
<p>Along with this change to descriptors, <code>React.isValidComponent</code> and <code>React.PropTypes.component</code> now actually validate that the value is a descriptor. Overwhelmingly, these functions are used to validate the value of <code>MyComponent()</code>, which as mentioned is now a descriptor, not a component instance. We opted to reduce code churn and make the migration to 0.11 as easy as possible. However, we realize this is has caused some confusion and we're working to make sure we are consistent with our terminology.</p>
|
||
<h2><a class="anchor" name="prop-type-validation"></a>Prop Type Validation <a class="hash-link" href="#prop-type-validation">#</a></h2>
|
||
<p>Previously <code>React.PropTypes</code> validation worked by simply logging to the console. Internally, each validator was responsible for doing this itself. Additionally, you could write a custom validator and the expectation was that you would also simply <code>console.log</code> your error message. Very shortly into the 0.11 cycle we changed this so that our validators return (<em>not throw</em>) an <code>Error</code> object. We then log the <code>error.message</code> property in a central place in ReactCompositeComponent. Overall the result is the same, but this provides a clearer intent in validation. In addition, to better transition into our descriptor factory changes, we also currently run prop type validation twice in development builds. As a result, custom validators doing their own logging result in duplicate messages. To update, simply return an <code>Error</code> with your message instead.</p>
|
||
<h2><a class="anchor" name="changelog"></a>Changelog <a class="hash-link" href="#changelog">#</a></h2><h3><a class="anchor" name="react-core"></a>React Core <a class="hash-link" href="#react-core">#</a></h3><h4><a class="anchor" name="breaking-changes"></a>Breaking Changes <a class="hash-link" href="#breaking-changes">#</a></h4>
|
||
<ul>
|
||
<li><code>getDefaultProps()</code> is now called once per class and shared across all instances</li>
|
||
<li><code>MyComponent()</code> now returns a descriptor, not an instance</li>
|
||
<li><code>React.isValidComponent</code> and <code>React.PropTypes.component</code> validate <em>descriptors</em>, not component instances.</li>
|
||
<li>Custom <code>propType</code> validators should return an <code>Error</code> instead of logging directly</li>
|
||
</ul>
|
||
<h4><a class="anchor" name="new-features"></a>New Features <a class="hash-link" href="#new-features">#</a></h4>
|
||
<ul>
|
||
<li>Rendering to <code>null</code></li>
|
||
<li>Keyboard events include normalized <code>e.key</code> and <code>e.getModifierState()</code> properties</li>
|
||
<li>New normalized <code>onBeforeInput</code> event</li>
|
||
<li><code>React.Children.count</code> has been added as a helper for counting the number of children</li>
|
||
</ul>
|
||
<h4><a class="anchor" name="bug-fixes"></a>Bug Fixes <a class="hash-link" href="#bug-fixes">#</a></h4>
|
||
<ul>
|
||
<li>Re-renders are batched in more cases</li>
|
||
<li>Events: <code>e.view</code> properly normalized</li>
|
||
<li>Added Support for more HTML attributes (<code>coords</code>, <code>crossOrigin</code>, <code>download</code>, <code>hrefLang</code>, <code>mediaGroup</code>, <code>muted</code>, <code>scrolling</code>, <code>shape</code>, <code>srcSet</code>, <code>start</code>, <code>useMap</code>)</li>
|
||
<li>Improved SVG support
|
||
|
||
<ul>
|
||
<li>Changing <code>className</code> on a mounted SVG component now works correctly</li>
|
||
<li>Added support for elements <code>mask</code> and <code>tspan</code></li>
|
||
<li>Added support for attributes <code>dx</code>, <code>dy</code>, <code>fillOpacity</code>, <code>fontFamily</code>, <code>fontSize</code>, <code>markerEnd</code>, <code>markerMid</code>, <code>markerStart</code>, <code>opacity</code>, <code>patternContentUnits</code>, <code>patternUnits</code>, <code>preserveAspectRatio</code>, <code>strokeDasharray</code>, <code>strokeOpacity</code></li>
|
||
</ul></li>
|
||
<li>CSS property names with vendor prefixes (<code>Webkit</code>, <code>ms</code>, <code>Moz</code>, <code>O</code>) are now handled properly</li>
|
||
<li>Duplicate keys no longer cause a hard error; now a warning is logged (and only one of the children with the same key is shown)</li>
|
||
<li><code>img</code> event listeners are now unbound properly, preventing the error "Two valid but unequal nodes with the same <code>data-reactid</code>"</li>
|
||
<li>Added explicit warning when missing polyfills</li>
|
||
</ul>
|
||
<h3><a class="anchor" name="react-with-addons"></a>React With Addons <a class="hash-link" href="#react-with-addons">#</a></h3>
|
||
<ul>
|
||
<li>PureRenderMixin: a mixin which helps optimize "pure" components</li>
|
||
<li>Perf: a new set of tools to help with performance analysis</li>
|
||
<li>Update: New <code>$apply</code> command to transform values</li>
|
||
<li>TransitionGroup bug fixes with null elements, Android</li>
|
||
</ul>
|
||
<h3><a class="anchor" name="react-npm-module"></a>React NPM Module <a class="hash-link" href="#react-npm-module">#</a></h3>
|
||
<ul>
|
||
<li>Now includes the pre-built packages under <code>dist/</code>.</li>
|
||
<li><code>envify</code> is properly listed as a dependency instead of a peer dependency</li>
|
||
</ul>
|
||
<h3><a class="anchor" name="jsx"></a>JSX <a class="hash-link" href="#jsx">#</a></h3>
|
||
<ul>
|
||
<li>Added support for namespaces, eg <code><Components.Checkbox /></code></li>
|
||
<li>JSXTransformer
|
||
|
||
<ul>
|
||
<li>Enable the same <code>harmony</code> features available in the command line with <code><script type="text/jsx;harmony=true"></code></li>
|
||
<li>Scripts are downloaded in parallel for more speed. They are still executed in order (as you would expect with normal script tags)</li>
|
||
<li>Fixed a bug preventing sourcemaps from working in Firefox</li>
|
||
</ul></li>
|
||
</ul>
|
||
<h3><a class="anchor" name="react-tools-module"></a>React Tools Module <a class="hash-link" href="#react-tools-module">#</a></h3>
|
||
<ul>
|
||
<li>Improved readme with usage and API information</li>
|
||
<li>Improved ES6 transforms available with <code>--harmony</code> option</li>
|
||
<li>Added <code>--source-map-inline</code> option to the <code>jsx</code> executable</li>
|
||
<li>New <code>transformWithDetails</code> API which gives access to the raw sourcemap data</li>
|
||
</ul>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
<div class="post-list-item">
|
||
<h1><a href="/react/blog/2014/07/13/react-v0.11-rc1.html">React v0.11 RC</a></h1>
|
||
<p class="meta">July 13, 2014 by Paul O’Shannessy</p>
|
||
<hr />
|
||
<div class="post">
|
||
<p>It's that time again… we're just about ready to ship a new React release! v0.11 includes a wide array of bug fixes and features. We highlighted some of the most important changes below, along with the full changelog.</p>
|
||
|
||
<p>The release candidate is available for download from the CDN:</p>
|
||
|
||
<ul>
|
||
<li><strong>React</strong><br>
|
||
Dev build with warnings: <a href="http://fb.me/react-0.11.0-rc1.js">http://fb.me/react-0.11.0-rc1.js</a><br>
|
||
Minified build for production: <a href="http://fb.me/react-0.11.0-rc1.min.js">http://fb.me/react-0.11.0-rc1.min.js</a><br></li>
|
||
<li><strong>React with Add-Ons</strong><br>
|
||
Dev build with warnings: <a href="http://fb.me/react-with-addons-0.11.0-rc1.js">http://fb.me/react-with-addons-0.11.0-rc1.js</a><br>
|
||
Minified build for production: <a href="http://fb.me/react-with-addons-0.11.0-rc1.min.js">http://fb.me/react-with-addons-0.11.0-rc1.min.js</a><br></li>
|
||
<li><strong>In-Browser JSX transformer</strong><br>
|
||
<a href="http://fb.me/JSXTransformer-0.11.0-rc1.js">http://fb.me/JSXTransformer-0.11.0-rc1.js</a></li>
|
||
</ul>
|
||
|
||
<p>We've also published version <code>0.11.0-rc1</code> of the <code>react</code> and <code>react-tools</code> packages on npm and the <code>react</code> package on bower.</p>
|
||
|
||
<p>Please try these builds out and <a href="https://github.com/facebook/react/issues/new">file an issue on GitHub</a> if you see anything awry.</p>
|
||
<h2><a class="anchor" name="getdefaultprops"></a><code>getDefaultProps</code> <a class="hash-link" href="#getdefaultprops">#</a></h2>
|
||
<p>Starting in React 0.11, <code>getDefaultProps()</code> is called only once when <code>React.createClass()</code> is called, instead of each time a component is rendered. This means that <code>getDefaultProps()</code> can no longer vary its return value based on <code>this.props</code> and any objects will be shared across all instances. This change improves performance and will make it possible in the future to do PropTypes checks earlier in the rendering process, allowing us to give better error messages.</p>
|
||
<h2><a class="anchor" name="rendering-to-null"></a>Rendering to <code>null</code> <a class="hash-link" href="#rendering-to-null">#</a></h2>
|
||
<p>Since React's release, people have been using work arounds to "render nothing". Usually this means returning an empty <code><div/></code> or <code><span/></code>. Some people even got clever and started returning <code><noscript/></code> to avoid extraneous DOM nodes. We finally provided a "blessed" solution that allows developers to write meaningful code. Returning <code>null</code> is an explicit indication to React that you do not want anything rendered. Behind the scenes we make this work with a <code><noscript></code> element, though in the future we hope to not put anything in the document. In the mean time, <code><noscript></code> elements do not affect layout in any way, so you can feel safe using <code>null</code> today!</p>
|
||
<div class="highlight"><pre><code class="js language-js" data-lang="js"><span class="c1">// Before</span>
|
||
<span class="nx">render</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
|
||
<span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">state</span><span class="p">.</span><span class="nx">visible</span><span class="p">)</span> <span class="p">{</span>
|
||
<span class="k">return</span> <span class="o"><</span><span class="nx">span</span><span class="o">/></span><span class="p">;</span>
|
||
<span class="p">}</span>
|
||
<span class="c1">// ...</span>
|
||
<span class="p">}</span>
|
||
|
||
<span class="c1">// After</span>
|
||
<span class="nx">render</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
|
||
<span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">state</span><span class="p">.</span><span class="nx">visible</span><span class="p">)</span> <span class="p">{</span>
|
||
<span class="k">return</span> <span class="kc">null</span><span class="p">;</span>
|
||
<span class="p">}</span>
|
||
<span class="c1">// ...</span>
|
||
<span class="p">}</span>
|
||
</code></pre></div><h2><a class="anchor" name="jsx-namespacing"></a>JSX Namespacing <a class="hash-link" href="#jsx-namespacing">#</a></h2>
|
||
<p>Another feature request we've been hearing for a long time is the ability to have namespaces in JSX. Given that JSX is just JavaScript, we didn't want to use XML namespacing. Instead we opted for a standard JS approach: object property access. Instead of assigning variables to access components stored in an object (such as a component library), you can now use the component directly as <code><Namespace.Component/></code>.</p>
|
||
<div class="highlight"><pre><code class="js language-js" data-lang="js"><span class="c1">// Before</span>
|
||
<span class="kd">var</span> <span class="nx">UI</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">'UI'</span><span class="p">);</span>
|
||
<span class="kd">var</span> <span class="nx">UILayout</span> <span class="o">=</span> <span class="nx">UI</span><span class="p">.</span><span class="nx">Layout</span><span class="p">;</span>
|
||
<span class="kd">var</span> <span class="nx">UIButton</span> <span class="o">=</span> <span class="nx">UI</span><span class="p">.</span><span class="nx">Button</span><span class="p">;</span>
|
||
<span class="kd">var</span> <span class="nx">UILabel</span> <span class="o">=</span> <span class="nx">UI</span><span class="p">.</span><span class="nx">Label</span><span class="p">;</span>
|
||
|
||
<span class="nx">render</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
|
||
<span class="k">return</span> <span class="o"><</span><span class="nx">UILayout</span><span class="o">><</span><span class="nx">UIButton</span> <span class="o">/><</span><span class="nx">UILabel</span><span class="o">></span><span class="nx">text</span><span class="o"><</span><span class="err">/UILabel></UILayout>;</span>
|
||
<span class="p">}</span>
|
||
|
||
<span class="c1">// After</span>
|
||
<span class="kd">var</span> <span class="nx">UI</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">'UI'</span><span class="p">);</span>
|
||
|
||
<span class="nx">render</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
|
||
<span class="k">return</span> <span class="o"><</span><span class="nx">UI</span><span class="p">.</span><span class="nx">Layout</span><span class="o">><</span><span class="nx">UI</span><span class="p">.</span><span class="nx">Button</span> <span class="o">/><</span><span class="nx">UI</span><span class="p">.</span><span class="nx">Label</span><span class="o">></span><span class="nx">text</span><span class="o"><</span><span class="err">/UI.Label></UI.Layout>;</span>
|
||
<span class="p">}</span>
|
||
</code></pre></div><h2><a class="anchor" name="improved-keyboard-event-normalization"></a>Improved keyboard event normalization <a class="hash-link" href="#improved-keyboard-event-normalization">#</a></h2>
|
||
<p>Keyboard events now contain a normalized <code>e.key</code> value according to the <a href="http://www.w3.org/TR/DOM-Level-3-Events/#keys-special">DOM Level 3 Events spec</a>, allowing you to write simpler key handling code that works in all browsers, such as:</p>
|
||
<div class="highlight"><pre><code class="js language-js" data-lang="js"><span class="nx">handleKeyDown</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">e</span><span class="p">)</span> <span class="p">{</span>
|
||
<span class="k">if</span> <span class="p">(</span><span class="nx">e</span><span class="p">.</span><span class="nx">key</span> <span class="o">===</span> <span class="s1">'Enter'</span><span class="p">)</span> <span class="p">{</span>
|
||
<span class="c1">// Handle enter key</span>
|
||
<span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">e</span><span class="p">.</span><span class="nx">key</span> <span class="o">===</span> <span class="s1">' '</span><span class="p">)</span> <span class="p">{</span>
|
||
<span class="c1">// Handle spacebar</span>
|
||
<span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">e</span><span class="p">.</span><span class="nx">key</span> <span class="o">===</span> <span class="s1">'ArrowLeft'</span><span class="p">)</span> <span class="p">{</span>
|
||
<span class="c1">// Handle left arrow</span>
|
||
<span class="p">}</span>
|
||
<span class="p">},</span>
|
||
</code></pre></div>
|
||
<p>Keyboard and mouse events also now include a normalized <code>e.getModifierState()</code> that works consistently across browsers.</p>
|
||
<h2><a class="anchor" name="changelog"></a>Changelog <a class="hash-link" href="#changelog">#</a></h2><h3><a class="anchor" name="react-core"></a>React Core <a class="hash-link" href="#react-core">#</a></h3><h4><a class="anchor" name="breaking-changes"></a>Breaking Changes <a class="hash-link" href="#breaking-changes">#</a></h4>
|
||
<ul>
|
||
<li><code>getDefaultProps()</code> is now called once per class and shared across all instances</li>
|
||
</ul>
|
||
<h4><a class="anchor" name="new-features"></a>New Features <a class="hash-link" href="#new-features">#</a></h4>
|
||
<ul>
|
||
<li>Rendering to <code>null</code></li>
|
||
<li>Keyboard events include normalized <code>e.key</code> and <code>e.getModifierState()</code> properties</li>
|
||
<li>New normalized <code>onBeforeInput</code> event</li>
|
||
<li><code>React.Children.count</code> has been added as a helper for counting the number of children</li>
|
||
</ul>
|
||
<h4><a class="anchor" name="bug-fixes"></a>Bug Fixes <a class="hash-link" href="#bug-fixes">#</a></h4>
|
||
<ul>
|
||
<li>Re-renders are batched in more cases</li>
|
||
<li>Events: <code>e.view</code> properly normalized</li>
|
||
<li>Added Support for more HTML attributes (<code>coords</code>, <code>crossOrigin</code>, <code>download</code>, <code>hrefLang</code>, <code>mediaGroup</code>, <code>muted</code>, <code>scrolling</code>, <code>shape</code>, <code>srcSet</code>, <code>start</code>, <code>useMap</code>)</li>
|
||
<li>Improved SVG support
|
||
|
||
<ul>
|
||
<li>Changing <code>className</code> on a mounted SVG component now works correctly</li>
|
||
<li>Added support for elements <code>mask</code> and <code>tspan</code></li>
|
||
<li>Added support for attributes <code>dx</code>, <code>dy</code>, <code>fillOpacity</code>, <code>fontFamily</code>, <code>fontSize</code>, <code>markerEnd</code>, <code>markerMid</code>, <code>markerStart</code>, <code>opacity</code>, <code>patternContentUnits</code>, <code>patternUnits</code>, <code>preserveAspectRatio</code>, <code>strokeDasharray</code>, <code>strokeOpacity</code></li>
|
||
</ul></li>
|
||
<li>CSS property names with vendor prefixes (<code>Webkit</code>, <code>ms</code>, <code>Moz</code>, <code>O</code>) are now handled properly</li>
|
||
<li>Duplicate keys no longer cause a hard error; now a warning is logged (and only one of the children with the same key is shown)</li>
|
||
<li><code>img</code> event listeners are now unbound properly, preventing the error "Two valid but unequal nodes with the same <code>data-reactid</code>"</li>
|
||
<li>Added explicit warning when missing polyfills</li>
|
||
</ul>
|
||
<h3><a class="anchor" name="react-with-addons"></a>React With Addons <a class="hash-link" href="#react-with-addons">#</a></h3>
|
||
<ul>
|
||
<li>PureRenderMixin</li>
|
||
<li>Perf: a new set of tools to help with performance analysis</li>
|
||
<li>Update: New <code>$apply</code> command to transform values</li>
|
||
<li>TransitionGroup bug fixes with null elements, Android</li>
|
||
</ul>
|
||
<h3><a class="anchor" name="react-npm-module"></a>React NPM Module <a class="hash-link" href="#react-npm-module">#</a></h3>
|
||
<ul>
|
||
<li>Now includes the pre-built packages under <code>dist/</code>.</li>
|
||
<li><code>envify</code> is properly listed as a dependency instead of a peer dependency</li>
|
||
</ul>
|
||
<h3><a class="anchor" name="jsx"></a>JSX <a class="hash-link" href="#jsx">#</a></h3>
|
||
<ul>
|
||
<li>Added support for namespaces, eg <code><Components.Checkbox /></code></li>
|
||
<li>JSXTransformer
|
||
|
||
<ul>
|
||
<li>Enable the same <code>harmony</code> features available in the command line with <code><script type="text/jsx;harmony=true"></code></li>
|
||
<li>Scripts are downloaded in parallel for more speed. They are still executed in order (as you would expect with normal script tags)</li>
|
||
<li>Fixed a bug preventing sourcemaps from working in Firefox</li>
|
||
</ul></li>
|
||
</ul>
|
||
<h3><a class="anchor" name="react-tools-module"></a>React Tools Module <a class="hash-link" href="#react-tools-module">#</a></h3>
|
||
<ul>
|
||
<li>Improved readme with usage and API information</li>
|
||
<li>Improved ES6 transforms available with <code>--harmony</code> option</li>
|
||
<li>Added <code>--source-map-inline</code> option to the <code>jsx</code> executable</li>
|
||
<li>New <code>transformWithDetails</code> API which gives access to the raw sourcemap data</li>
|
||
</ul>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
<div class="post-list-item">
|
||
<h1><a href="/react/blog/2014/06/27/community-roundup-19.html">Community Round-up #19</a></h1>
|
||
<p class="meta">June 27, 2014 by Cheng Lou</p>
|
||
<hr />
|
||
<div class="post">
|
||
<h2><a class="anchor" name="react-meetups"></a>React Meetups! <a class="hash-link" href="#react-meetups">#</a></h2>
|
||
<p>Ever wanted to find developers who also share the same interest in React than you? Recently, there has been a React Meetup in <a href="http://www.meetup.com/ReactJS-San-Francisco/">San Francisco</a> (courtesy of <a href="http://www.telmate.com">Telmate</a>), and one in <a href="http://www.meetup.com/London-React-User-Group/">London</a> (courtesy of <a href="http://www.meetup.com/London-React-User-Group/members/105837542/">Stuart Harris</a>, <a href="http://www.meetup.com/London-React-User-Group/members/15509971/">Cain Ullah</a> and <a href="http://www.meetup.com/London-React-User-Group/members/137058242/">Zoe Merchant</a>). These two events have been big successes; a second one in London is <a href="http://www.meetup.com/London-React-User-Group/events/191406572/">already planned</a>.</p>
|
||
|
||
<p>If you don't live near San Francisco or London, why not start one in your community?</p>
|
||
<h2><a class="anchor" name="complementary-tools"></a>Complementary Tools <a class="hash-link" href="#complementary-tools">#</a></h2>
|
||
<p>In case you haven't seen it, we've consolidated the tooling solution around React on <a href="https://github.com/facebook/react/wiki/Complementary-Tools">this wiki page</a>. Some of the notable recent entries include:</p>
|
||
|
||
<ul>
|
||
<li><p><a href="https://github.com/rpflorence">Ryan Florence</a> and <a href="https://github.com/mjackson">Michael Jackson</a>'s <a href="https://github.com/rpflorence/react-nested-router">react-nested-router</a>, which is a translation of the Ember router API to React.</p></li>
|
||
<li><p><a href="https://github.com/stevoland">Stephen J. Collings</a>'s <a href="https://github.com/react-bootstrap/react-bootstrap">react-bootstrap</a>, which wraps the popular framework with a bit of React goodness. The <a href="http://react-bootstrap.github.io/components.html">website</a> features live-editable demos.</p></li>
|
||
<li><p><a href="https://github.com/andreypopp">Andrey Popp</a>'s <a href="https://github.com/andreypopp/react-quickstart">react-quickstart</a>, which gives you a quick template for server-side rendering and routing, among other features.</p></li>
|
||
</ul>
|
||
|
||
<p>These are some of the links that often pop up on the #reactjs IRC channel. If you made something that you think deserves to be shown on the wiki, feel free to add it!</p>
|
||
<h2><a class="anchor" name="react-in-interesting-places"></a>React in Interesting Places <a class="hash-link" href="#react-in-interesting-places">#</a></h2>
|
||
<p>The core concepts React themselves is something very valuable that the community is exploring and pushing further. A year ago, we wouldn't have imagined something like <a href="http://rigsomelight.com">Bruce Hauman</a>'s <a href="http://rigsomelight.com/2014/05/01/interactive-programming-flappy-bird-clojurescript.html">Flappy Bird ClojureScript port</a>, whose interactive programming has been made possible through React:</p>
|
||
|
||
<iframe width="560" height="315" src="//www.youtube.com/embed/KZjFVdU8VLI" frameborder="0" allowfullscreen></iframe>
|
||
|
||
<p>And don't forget <a href="https://github.com/petehunt">Pete Hunt</a>'s Wolfenstein 3D rendering engine in React (<a href="https://github.com/petehunt/wolfenstein3D-react/blob/master/js/renderer.js#L183">source code</a>). While it's nearly a year old, it's still a nice demo.</p>
|
||
|
||
<p><a href="http://www.petehunt.net/wolfenstein3D-react/wolf3d.html"><img src="/react/img/blog/wolfenstein_react.png" alt=""></a></p>
|
||
|
||
<p>Give us a shoutout on IRC or <a href="https://groups.google.com/forum/#!forum/reactjs">React Google Groups</a> if you've used React in some Interesting places.</p>
|
||
<h2><a class="anchor" name="even-more-people-using-react"></a>Even More People Using React <a class="hash-link" href="#even-more-people-using-react">#</a></h2><h3><a class="anchor" name="prismatic"></a>Prismatic <a class="hash-link" href="#prismatic">#</a></h3>
|
||
<p><a href="http://getprismatic.com/home">Prismatic</a> recently shrank their codebase fivefold with the help of React and its popular ClojureScript wrapper, <a href="https://github.com/swannodette/om">Om</a>. They detailed their very positive experience <a href="http://blog.getprismatic.com/om-sweet-om-high-functional-frontend-engineering-with-clojurescript-and-react/">here</a>.</p>
|
||
|
||
<blockquote>
|
||
<p>Finally, the state is normalized: each piece of information is represented in a single place. Since React ensures consistency between the DOM and the application data, the programmer can focus on ensuring that the state properly stays up to date in response to user input. If the application state is normalized, then this consistency is guaranteed by definition, completely avoiding the possibility of an entire class of common bugs.</p>
|
||
</blockquote>
|
||
<h3><a class="anchor" name="adobe-brackets"></a>Adobe Brackets <a class="hash-link" href="#adobe-brackets">#</a></h3>
|
||
<p><a href="http://www.kevindangoor.com">Kevin Dangoor</a> works on <a href="http://brackets.io/?lang=en">Brackets</a>, the open-source code editor. After writing <a href="http://www.kevindangoor.com/2014/05/simplifying-code-with-react/">his first impression on React</a>, he followed up with another insightful <a href="http://www.kevindangoor.com/2014/05/react-in-brackets/">article</a> on how to gradually make the code transition, how to preserve the editor's good parts, and how to tune Brackets' tooling around JSX.</p>
|
||
|
||
<blockquote>
|
||
<p>We don’t need to switch to React everywhere, all at once. It’s not a framework that imposes anything on the application structure. [...] Easy, iterative adoption is definitely something in React’s favor for us.</p>
|
||
</blockquote>
|
||
<h3><a class="anchor" name="storehouse"></a>Storehouse <a class="hash-link" href="#storehouse">#</a></h3>
|
||
<p><a href="https://www.storehouse.co">Storehouse</a> (Apple Design Award 2014)'s web presence is build with React. Here's <a href="https://www.storehouse.co/stories/y2ad-mexico-city-clouds">an example story</a>. Congratulations on the award!</p>
|
||
<h3><a class="anchor" name="vim-awesome"></a>Vim Awesome <a class="hash-link" href="#vim-awesome">#</a></h3>
|
||
<p><a href="http://vimawesome.com">Vim Awesome</a>, an open-source Vim plugins directory built on React, was just launched. Be sure to <a href="https://github.com/divad12/vim-awesome">check out the source code</a> if you're curious to see an example of how to build a small single-page React app.</p>
|
||
<h2><a class="anchor" name="random-tweets"></a>Random Tweets <a class="hash-link" href="#random-tweets">#</a></h2>
|
||
<blockquote class="twitter-tweet" lang="en"><p>Spent 12 hours so far with <a href="https://twitter.com/hashtag/reactjs?src=hash">#reactjs</a>. Spent another 2 wondering why we've been doing JS frameworks wrong until now. React makes me happy.</p>— Paul Irwin (@paulirwin) <a href="https://twitter.com/paulirwin/statuses/481263947589242882">June 24, 2014</a></blockquote>
|
||
|
||
</div>
|
||
</div>
|
||
|
||
|
||
<div class="pagination">
|
||
|
||
|
||
<a href="/react/blog/page2/" class="next">
|
||
Next Page »
|
||
</a>
|
||
|
||
</div>
|
||
</div>
|
||
</section>
|
||
|
||
|
||
<footer class="wrap">
|
||
<div class="left">
|
||
A Facebook & Instagram collaboration.<br>
|
||
<a href="/react/acknowledgements.html">Acknowledgements</a>
|
||
</div>
|
||
<div class="right">© 2014 Facebook Inc.</div>
|
||
</footer>
|
||
</div>
|
||
<div id="fb-root"></div>
|
||
|
||
<script>
|
||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||
ga('create', 'UA-41298772-1', 'facebook.github.io');
|
||
ga('send', 'pageview');
|
||
|
||
!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");
|
||
|
||
(function(d, s, id) {
|
||
var js, fjs = d.getElementsByTagName(s)[0];
|
||
if (d.getElementById(id)) return;
|
||
js = d.createElement(s); js.id = id;
|
||
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=623268441017527";
|
||
fjs.parentNode.insertBefore(js, fjs);
|
||
}(document, 'script', 'facebook-jssdk'));
|
||
</script>
|
||
</body>
|
||
</html>
|