Update to latest master, including blog posts

This commit is contained in:
Paul O’Shannessy
2013-06-05 09:08:04 -07:00
parent d06a7ef606
commit 4346b10363
22 changed files with 595 additions and 19 deletions
+101
View File
@@ -0,0 +1,101 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>React | JSFiddle Integration</title>
<meta name="viewport" content="width=device-width">
<meta property="og:title" content="React | JSFiddle Integration" />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://facebook.github.io/react/blog/2013/06/02/jsfiddle-integration.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" />
<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/react.css">
<link rel="stylesheet" href="/react/css/syntax.css">
<link rel="stylesheet" href="/react/css/codemirror.css">
<script type="text/javascript" src="//use.typekit.net/vqa1hcx.js"></script>
<script type="text/javascript">try{Typekit.load();}catch(e){}</script>
<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.min.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">
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>
<!-- <iframe src="http://ghbtns.com/github&#45;btn.html?user=facebook&#38;repo=react.js&#38;type=fork"allowtransparency="true" frameborder="0" scrolling="0" width="62" height="20"></iframe> -->
</div>
</div>
<section class="content wrap documentationContent">
<div class="nav-docs">
<div class="nav-docs-section">
<h3>Recent posts</h3>
<ul>
<li><a href="/react/blog/2013/06/05/why-react.html">Why did we build React?</a></li>
<li><a href="/react/blog/2013/06/02/jsfiddle-integration.html" class="active">JSFiddle Integration</a></li>
</ul>
</div>
</div>
<div class="inner-content">
<h1>JSFiddle Integration</h1>
<p class="meta">June 2, 2013 by Christopher Chedeau</p>
<hr>
<div class="post">
<p><a href="http://jsfiddle.net">JSFiddle</a> just announced support for React. This is an exciting news as it makes collaboration on snippets of code a lot easier. You can play around this <strong><a href="http://jsfiddle.net/vjeux/kb3gN/">base React JSFiddle</a></strong>, fork it and share it! A <a href="http://jsfiddle.net/vjeux/VkebS/">fiddle without JSX</a> is also available.</p>
<blockquote class="twitter-tweet" align="center"><p>React (by Facebook) is now available on JSFiddle. <a href="http://t.co/wNQf9JPv5u" title="http://facebook.github.io/react/">facebook.github.io/react/</a></p>&mdash; JSFiddle (@jsfiddle) <a href="https://twitter.com/jsfiddle/status/341114115781177344">June 2, 2013</a></blockquote>
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
</div>
</div>
</section>
<footer class="wrap">
<div class="left">A Facebook &amp; Instagram collaboration.</div>
<div class="right">&copy; 2013 Facebook Inc.</div>
</footer>
</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');
</script>
</body>
</html>
+187
View File
@@ -0,0 +1,187 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>React | Why did we build React?</title>
<meta name="viewport" content="width=device-width">
<meta property="og:title" content="React | Why did we build React?" />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://facebook.github.io/react/blog/2013/06/05/why-react.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" />
<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/react.css">
<link rel="stylesheet" href="/react/css/syntax.css">
<link rel="stylesheet" href="/react/css/codemirror.css">
<script type="text/javascript" src="//use.typekit.net/vqa1hcx.js"></script>
<script type="text/javascript">try{Typekit.load();}catch(e){}</script>
<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.min.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">
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>
<!-- <iframe src="http://ghbtns.com/github&#45;btn.html?user=facebook&#38;repo=react.js&#38;type=fork"allowtransparency="true" frameborder="0" scrolling="0" width="62" height="20"></iframe> -->
</div>
</div>
<section class="content wrap documentationContent">
<div class="nav-docs">
<div class="nav-docs-section">
<h3>Recent posts</h3>
<ul>
<li><a href="/react/blog/2013/06/05/why-react.html" class="active">Why did we build React?</a></li>
<li><a href="/react/blog/2013/06/02/jsfiddle-integration.html">JSFiddle Integration</a></li>
</ul>
</div>
</div>
<div class="inner-content">
<h1>Why did we build React?</h1>
<p class="meta">June 5, 2013 by Pete Hunt</p>
<hr>
<div class="post">
<p>There are a lot of JavaScript MVC frameworks out there. Why did we build React
and why would you want to use it?</p>
<h2>React isn&#39;t an MVC framework.</h2>
<p>React is a library for building composable user interfaces. It encourages
the creation of reusable UI components which present data that changes over
time.</p>
<h2>React doesn&#39;t use templates.</h2>
<p>Traditionally, web application UIs are built using templates or HTML directives.
These templates dictate the full set of abstractions that you are allowed to use
to build your UI.</p>
<p>React approaches building user interfaces differently by breaking them into
<strong>components</strong>. This means React uses JavaScript to generate markup, which we
see as an advantage over templates for a few reasons:</p>
<ul>
<li><strong>JavaScript is a flexible, powerful programming language</strong> with the ability
to build abstractions. This is incredibly important in large applications.</li>
<li>By unifying your markup with it&#39;s corresponding view logic, React can actually
make views <strong>easier to extend and maintain</strong>.</li>
<li>By baking an understanding of markup and content into JavaScript, there&#39;s
<strong>no manual string concatenation</strong> and therefore less surface area for XSS
vulnerabilities.</li>
</ul>
<p>We&#39;ve also created <a href="facebook.github.io/react/docs/syntax.html">JSX</a>, an optional
syntax extension, in case you prefer the readability of HTML to raw JavaScript.</p>
<h2>Reactive updates are dead simple.</h2>
<p>React really shines when your data changes over time.</p>
<p>In a traditional JavaScript application, you need to look at what data changed
and imperatively make changes to the DOM to keep it up-to-date. Even AngularJS,
which provides a declarative interface via directives and data binding <a href="http://docs.angularjs.org/guide/directive#reasonsbehindthecompilelinkseparation">requires
a linking function to manually update DOM nodes</a>.</p>
<p>React takes a different approach.</p>
<p>When your component is first initialized, the <code>render</code> method is called,
generating a lightweight representation of your view. From that representation,
a string of markup is produced, and injected into the document. When your data
changes, the <code>render</code> method is called again. In order to perform updates as
efficiently as possible, we diff the return value from the previous call to
<code>render</code> with the new one, and generate a minimal set of changes to be applied
to the DOM.</p>
<blockquote>
<p>The data returned from <code>render</code> is neither a string nor a DOM node -- it&#39;s a
lightweight description of what the DOM should look like.</p>
</blockquote>
<p>We call this process <strong>reconciliation</strong>. Check out
<a href="http://jsfiddle.net/fv6RD/3/">this jsFiddle</a> to see an example of
reconciliation in action.</p>
<p>Because this re-render is so fast (around 1ms for TodoMVC), the developer
doesn&#39;t need to explicitly specify data bindings. We&#39;ve found this approach
makes it easier to build apps.</p>
<h2>HTML is just the beginning.</h2>
<p>Because React has its own lightweight representation of the document, we can do
some pretty cool things with it:</p>
<ul>
<li>Facebook has dynamic charts that render to <code>&lt;canvas&gt;</code> instead of HTML.</li>
<li>Instagram is a &quot;single page&quot; web app built entirely with React and
<code>Backbone.Router</code>. Designers regularly contribute React code with JSX.</li>
<li>We&#39;ve built internal prototypes that run React apps in a web worker and use
React to drive <strong>native iOS views</strong> via an Objective-C bridge.</li>
<li>You can run React
<a href="http://github.com/petehunt/react-server-rendering">on the server</a>
for SEO, performance, code sharing and overall flexibility.</li>
<li>Events behave in a consistent, standards-compliant way in all browsers
(including IE8) and automatically use
<a href="http://davidwalsh.name/event-delegate">event delegation</a>.</li>
</ul>
<p>Head on over to
<a href="http://facebook.github.io/react">facebook.github.io/react</a> to check
out what we have built. Our documentation is geared towards building
apps with the framework, but if you are interested in the
nuts and bolts
<a href="http://facebook.github.io/react/support.html">get in touch</a> with us!</p>
<p>Thanks for reading!</p>
</div>
</div>
</section>
<footer class="wrap">
<div class="left">A Facebook &amp; Instagram collaboration.</div>
<div class="right">&copy; 2013 Facebook Inc.</div>
</footer>
</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');
</script>
</body>
</html>
+124
View File
@@ -0,0 +1,124 @@
<!DOCTYPE html>
<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" />
<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/react.css">
<link rel="stylesheet" href="/react/css/syntax.css">
<link rel="stylesheet" href="/react/css/codemirror.css">
<script type="text/javascript" src="//use.typekit.net/vqa1hcx.js"></script>
<script type="text/javascript">try{Typekit.load();}catch(e){}</script>
<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.min.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">
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>
<!-- <iframe src="http://ghbtns.com/github&#45;btn.html?user=facebook&#38;repo=react.js&#38;type=fork"allowtransparency="true" frameborder="0" scrolling="0" width="62" height="20"></iframe> -->
</div>
</div>
<section class="content wrap documentationContent">
<div class="nav-docs">
<div class="nav-docs-section">
<h3>Recent posts</h3>
<ul>
<li><a href="/react/blog/2013/06/05/why-react.html">Why did we build React?</a></li>
<li><a href="/react/blog/2013/06/02/jsfiddle-integration.html">JSFiddle Integration</a></li>
</ul>
</div>
</div>
<div class="inner-content">
<div class="post-list-item">
<h1><a href="/react/blog/2013/06/05/why-react.html">Why did we build React?</a></h1>
<p class="meta">June 5, 2013 by Pete Hunt</p>
<hr>
<div class="post">
<p>There are a lot of JavaScript MVC frameworks out there. Why did we build React
and why would you want to use it?</p>
<p>
<a href="/react/blog/2013/06/05/why-react.html">Continue Reading &rarr;</a>
</p>
</div>
</div>
<div class="post-list-item">
<h1><a href="/react/blog/2013/06/02/jsfiddle-integration.html">JSFiddle Integration</a></h1>
<p class="meta">June 2, 2013 by Christopher Chedeau</p>
<hr>
<div class="post">
<p><a href="http://jsfiddle.net">JSFiddle</a> just announced support for React. This is an exciting news as it makes collaboration on snippets of code a lot easier. You can play around this <strong><a href="http://jsfiddle.net/vjeux/kb3gN/">base React JSFiddle</a></strong>, fork it and share it! A <a href="http://jsfiddle.net/vjeux/VkebS/">fiddle without JSX</a> is also available.</p>
<p>
<a href="/react/blog/2013/06/02/jsfiddle-integration.html">Continue Reading &rarr;</a>
</p>
</div>
</div>
</div>
</section>
<footer class="wrap">
<div class="left">A Facebook &amp; Instagram collaboration.</div>
<div class="right">&copy; 2013 Facebook Inc.</div>
</footer>
</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');
</script>
</body>
</html>
+1 -1
View File
File diff suppressed because one or more lines are too long
+2
View File
@@ -12,6 +12,7 @@
<meta property="og:description" content="A JavaScript library for building user interfaces" />
<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/react.css">
<link rel="stylesheet" href="/react/css/syntax.css">
@@ -41,6 +42,7 @@
<li><a href="/react/docs/getting-started.html" class="active">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/">blog</a></li>
<li><a href="http://github.com/facebook/react">github</a>
</ul>
<!-- <iframe src="http://ghbtns.com/github&#45;btn.html?user=facebook&#38;repo=react.js&#38;type=fork"allowtransparency="true" frameborder="0" scrolling="0" width="62" height="20"></iframe> -->
+2
View File
@@ -12,6 +12,7 @@
<meta property="og:description" content="A JavaScript library for building user interfaces" />
<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/react.css">
<link rel="stylesheet" href="/react/css/syntax.css">
@@ -41,6 +42,7 @@
<li><a href="/react/docs/getting-started.html" class="active">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/">blog</a></li>
<li><a href="http://github.com/facebook/react">github</a>
</ul>
<!-- <iframe src="http://ghbtns.com/github&#45;btn.html?user=facebook&#38;repo=react.js&#38;type=fork"allowtransparency="true" frameborder="0" scrolling="0" width="62" height="20"></iframe> -->
+2
View File
@@ -12,6 +12,7 @@
<meta property="og:description" content="A JavaScript library for building user interfaces" />
<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/react.css">
<link rel="stylesheet" href="/react/css/syntax.css">
@@ -41,6 +42,7 @@
<li><a href="/react/docs/getting-started.html" class="active">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/">blog</a></li>
<li><a href="http://github.com/facebook/react">github</a>
</ul>
<!-- <iframe src="http://ghbtns.com/github&#45;btn.html?user=facebook&#38;repo=react.js&#38;type=fork"allowtransparency="true" frameborder="0" scrolling="0" width="62" height="20"></iframe> -->
+2
View File
@@ -12,6 +12,7 @@
<meta property="og:description" content="A JavaScript library for building user interfaces" />
<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/react.css">
<link rel="stylesheet" href="/react/css/syntax.css">
@@ -41,6 +42,7 @@
<li><a href="/react/docs/getting-started.html" class="active">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/">blog</a></li>
<li><a href="http://github.com/facebook/react">github</a>
</ul>
<!-- <iframe src="http://ghbtns.com/github&#45;btn.html?user=facebook&#38;repo=react.js&#38;type=fork"allowtransparency="true" frameborder="0" scrolling="0" width="62" height="20"></iframe> -->
+2
View File
@@ -12,6 +12,7 @@
<meta property="og:description" content="A JavaScript library for building user interfaces" />
<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/react.css">
<link rel="stylesheet" href="/react/css/syntax.css">
@@ -41,6 +42,7 @@
<li><a href="/react/docs/getting-started.html" class="active">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/">blog</a></li>
<li><a href="http://github.com/facebook/react">github</a>
</ul>
<!-- <iframe src="http://ghbtns.com/github&#45;btn.html?user=facebook&#38;repo=react.js&#38;type=fork"allowtransparency="true" frameborder="0" scrolling="0" width="62" height="20"></iframe> -->
+2
View File
@@ -12,6 +12,7 @@
<meta property="og:description" content="A JavaScript library for building user interfaces" />
<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/react.css">
<link rel="stylesheet" href="/react/css/syntax.css">
@@ -41,6 +42,7 @@
<li><a href="/react/docs/getting-started.html" class="active">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/">blog</a></li>
<li><a href="http://github.com/facebook/react">github</a>
</ul>
<!-- <iframe src="http://ghbtns.com/github&#45;btn.html?user=facebook&#38;repo=react.js&#38;type=fork"allowtransparency="true" frameborder="0" scrolling="0" width="62" height="20"></iframe> -->
+2
View File
@@ -12,6 +12,7 @@
<meta property="og:description" content="A JavaScript library for building user interfaces" />
<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/react.css">
<link rel="stylesheet" href="/react/css/syntax.css">
@@ -41,6 +42,7 @@
<li><a href="/react/docs/getting-started.html" class="active">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/">blog</a></li>
<li><a href="http://github.com/facebook/react">github</a>
</ul>
<!-- <iframe src="http://ghbtns.com/github&#45;btn.html?user=facebook&#38;repo=react.js&#38;type=fork"allowtransparency="true" frameborder="0" scrolling="0" width="62" height="20"></iframe> -->
+14 -3
View File
@@ -12,6 +12,7 @@
<meta property="og:description" content="A JavaScript library for building user interfaces" />
<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/react.css">
<link rel="stylesheet" href="/react/css/syntax.css">
@@ -41,6 +42,7 @@
<li><a href="/react/docs/getting-started.html" class="active">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/">blog</a></li>
<li><a href="http://github.com/facebook/react">github</a>
</ul>
<!-- <iframe src="http://ghbtns.com/github&#45;btn.html?user=facebook&#38;repo=react.js&#38;type=fork"allowtransparency="true" frameborder="0" scrolling="0" width="62" height="20"></iframe> -->
@@ -79,7 +81,18 @@
<div class="inner-content">
<h1>Getting Started</h1>
<div class="subHeader"></div>
<p>Download the starter kit to get started.</p>
<h2>JSFiddle</h2>
<p>The easiest way to start hacking on React is using the following JSFiddle Hello Worlds</p>
<ul>
<li><strong><a href="http://jsfiddle.net/vjeux/kb3gN/">React JSFiddle</a></strong></li>
<li><a href="http://jsfiddle.net/vjeux/VkebS/">React JSFiddle without JSX</a></li>
</ul>
<h2>Starter Kit</h2>
<p>Download the starter kit to get started.</p>
<div class="buttons-unit downloads">
<a href="/react/downloads/react-0.3.2.zip" class="button">
@@ -87,8 +100,6 @@
</a>
</div>
<h2>Hello, world!</h2>
<p>In the root directory of the starter kit, create a <code>helloworld.html</code> with the following contents.</p>
<div class="highlight"><pre><code class="html language-html" data-lang="html"><span class="cp">&lt;!DOCTYPE html&gt;</span>
<span class="nt">&lt;html&gt;</span>
+2
View File
@@ -12,6 +12,7 @@
<meta property="og:description" content="A JavaScript library for building user interfaces" />
<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/react.css">
<link rel="stylesheet" href="/react/css/syntax.css">
@@ -41,6 +42,7 @@
<li><a href="/react/docs/getting-started.html" class="active">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/">blog</a></li>
<li><a href="http://github.com/facebook/react">github</a>
</ul>
<!-- <iframe src="http://ghbtns.com/github&#45;btn.html?user=facebook&#38;repo=react.js&#38;type=fork"allowtransparency="true" frameborder="0" scrolling="0" width="62" height="20"></iframe> -->
+2
View File
@@ -12,6 +12,7 @@
<meta property="og:description" content="A JavaScript library for building user interfaces" />
<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/react.css">
<link rel="stylesheet" href="/react/css/syntax.css">
@@ -41,6 +42,7 @@
<li><a href="/react/docs/getting-started.html" class="active">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/">blog</a></li>
<li><a href="http://github.com/facebook/react">github</a>
</ul>
<!-- <iframe src="http://ghbtns.com/github&#45;btn.html?user=facebook&#38;repo=react.js&#38;type=fork"allowtransparency="true" frameborder="0" scrolling="0" width="62" height="20"></iframe> -->
+6 -4
View File
@@ -12,6 +12,7 @@
<meta property="og:description" content="A JavaScript library for building user interfaces" />
<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/react.css">
<link rel="stylesheet" href="/react/css/syntax.css">
@@ -41,6 +42,7 @@
<li><a href="/react/docs/getting-started.html" class="active">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/">blog</a></li>
<li><a href="http://github.com/facebook/react">github</a>
</ul>
<!-- <iframe src="http://ghbtns.com/github&#45;btn.html?user=facebook&#38;repo=react.js&#38;type=fork"allowtransparency="true" frameborder="0" scrolling="0" width="62" height="20"></iframe> -->
@@ -155,7 +157,7 @@
<span class="kd">var</span> <span class="nx">CommentBox</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">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="nx">ReactDOM</span><span class="p">.</span><span class="nx">div</span><span class="p">({</span>
<span class="nx">React</span><span class="p">.</span><span class="nx">DOM</span><span class="p">.</span><span class="nx">div</span><span class="p">({</span>
<span class="nx">className</span><span class="o">:</span> <span class="s1">&#39;commentBox&#39;</span><span class="p">,</span>
<span class="nx">children</span><span class="o">:</span> <span class="s1">&#39;Hello, world! I am a CommentBox.&#39;</span>
<span class="p">})</span>
@@ -217,7 +219,7 @@
<span class="p">}</span>
<span class="p">});</span>
</code></pre></div>
<p>Notice how we&#39;re mixing HTML tags and components we&#39;ve built. HTML components are regular React components, just like the ones you define, with one difference. The JSX compiler will automatically rewrite HTML tags to &quot;ReactDOM.tagName&quot; expressions and leave everything else alone. This is to prevent the pollution of the global namespace.</p>
<p>Notice how we&#39;re mixing HTML tags and components we&#39;ve built. HTML components are regular React components, just like the ones you define, with one difference. The JSX compiler will automatically rewrite HTML tags to &quot;React.DOM.tagName&quot; expressions and leave everything else alone. This is to prevent the pollution of the global namespace.</p>
<h2>Component Properties</h2>
@@ -374,8 +376,8 @@
<span class="k">return</span> <span class="p">(</span>
<span class="o">&lt;</span><span class="nx">div</span> <span class="kr">class</span><span class="o">=</span><span class="s2">&quot;commentBox&quot;</span><span class="o">&gt;</span>
<span class="o">&lt;</span><span class="nx">h1</span><span class="o">&gt;</span><span class="nx">Comments</span><span class="o">&lt;</span><span class="err">/h1&gt;</span>
<span class="o">&lt;</span><span class="nx">CommentList</span> <span class="nx">data</span><span class="o">=</span><span class="p">{</span><span class="k">this</span><span class="p">.</span><span class="nx">state</span><span class="p">.</span><span class="nx">data</span><span class="p">}</span> <span class="o">/&gt;</span>
<span class="o">&lt;</span><span class="nx">CommentForm</span> <span class="o">/&gt;</span>
<span class="hll"> <span class="o">&lt;</span><span class="nx">CommentList</span> <span class="nx">data</span><span class="o">=</span><span class="p">{</span><span class="k">this</span><span class="p">.</span><span class="nx">state</span><span class="p">.</span><span class="nx">data</span><span class="p">}</span> <span class="o">/&gt;</span>
</span> <span class="o">&lt;</span><span class="nx">CommentForm</span> <span class="o">/&gt;</span>
<span class="o">&lt;</span><span class="err">/div&gt;</span>
<span class="p">);</span>
<span class="p">}</span>
+8 -3
View File
@@ -12,6 +12,7 @@
<meta property="og:description" content="A JavaScript library for building user interfaces" />
<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/react.css">
<link rel="stylesheet" href="/react/css/syntax.css">
@@ -41,6 +42,7 @@
<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" class="active">download</a></li>
<li><a href="/react/blog/">blog</a></li>
<li><a href="http://github.com/facebook/react">github</a>
</ul>
<!-- <iframe src="http://ghbtns.com/github&#45;btn.html?user=facebook&#38;repo=react.js&#38;type=fork"allowtransparency="true" frameborder="0" scrolling="0" width="62" height="20"></iframe> -->
@@ -67,15 +69,18 @@
<h4><a href="http://fb.me/react-0.3.2.min.js">React Core 0.3.2 (production)</a></h4>
<p>The compressed, production version of React core</p>
<div class="highlight"><pre><code class="html language-html" data-lang="html"><span class="nt">&lt;script </span><span class="na">src=</span><span class="s">&quot;http://fb.me/react-0.3.2.min.js&quot;</span><span class="nt">&gt;&lt;/script&gt;</span>
</code></pre></div>
<h4><a href="http://fb.me/react-0.3.2.js">React Core 0.3.2 (development)</a></h4>
<p>The uncompressed, development version of React core with inline documentation.</p>
<div class="highlight"><pre><code class="html language-html" data-lang="html"><span class="nt">&lt;script </span><span class="na">src=</span><span class="s">&quot;http://fb.me/react-0.3.2.js&quot;</span><span class="nt">&gt;&lt;/script&gt;</span>
</code></pre></div>
<h4><a href="http://fb.me/JSXTransformer-0.3.2.js">JSX Transform</a></h4>
<p>The JSX transformer used to support <a href="/react/docs/syntax.html">XML syntax</a> in JavaScript.</p>
<div class="highlight"><pre><code class="html language-html" data-lang="html"><span class="nt">&lt;script </span><span class="na">src=</span><span class="s">&quot;http://fb.me/JSXTransformer-0.3.2.js&quot;</span><span class="nt">&gt;&lt;/script&gt;</span>
</code></pre></div>
<h2>Bower</h2>
<div class="highlight"><pre><code class="sh language-sh" data-lang="sh"><span class="nv">$ </span>bower install --save react
</code></pre></div>
+122
View File
@@ -0,0 +1,122 @@
<?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>Why did we build React?</title>
<description>&lt;p&gt;There are a lot of JavaScript MVC frameworks out there. Why did we build React
and why would you want to use it?&lt;/p&gt;
&lt;h2&gt;React isn&amp;#39;t an MVC framework.&lt;/h2&gt;
&lt;p&gt;React is a library for building composable user interfaces. It encourages
the creation of reusable UI components which present data that changes over
time.&lt;/p&gt;
&lt;h2&gt;React doesn&amp;#39;t use templates.&lt;/h2&gt;
&lt;p&gt;Traditionally, web application UIs are built using templates or HTML directives.
These templates dictate the full set of abstractions that you are allowed to use
to build your UI.&lt;/p&gt;
&lt;p&gt;React approaches building user interfaces differently by breaking them into
&lt;strong&gt;components&lt;/strong&gt;. This means React uses JavaScript to generate markup, which we
see as an advantage over templates for a few reasons:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;JavaScript is a flexible, powerful programming language&lt;/strong&gt; with the ability
to build abstractions. This is incredibly important in large applications.&lt;/li&gt;
&lt;li&gt;By unifying your markup with it&amp;#39;s corresponding view logic, React can actually
make views &lt;strong&gt;easier to extend and maintain&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;By baking an understanding of markup and content into JavaScript, there&amp;#39;s
&lt;strong&gt;no manual string concatenation&lt;/strong&gt; and therefore less surface area for XSS
vulnerabilities.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We&amp;#39;ve also created &lt;a href=&quot;facebook.github.io/react/docs/syntax.html&quot;&gt;JSX&lt;/a&gt;, an optional
syntax extension, in case you prefer the readability of HTML to raw JavaScript.&lt;/p&gt;
&lt;h2&gt;Reactive updates are dead simple.&lt;/h2&gt;
&lt;p&gt;React really shines when your data changes over time.&lt;/p&gt;
&lt;p&gt;In a traditional JavaScript application, you need to look at what data changed
and imperatively make changes to the DOM to keep it up-to-date. Even AngularJS,
which provides a declarative interface via directives and data binding &lt;a href=&quot;http://docs.angularjs.org/guide/directive#reasonsbehindthecompilelinkseparation&quot;&gt;requires
a linking function to manually update DOM nodes&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;React takes a different approach.&lt;/p&gt;
&lt;p&gt;When your component is first initialized, the &lt;code&gt;render&lt;/code&gt; method is called,
generating a lightweight representation of your view. From that representation,
a string of markup is produced, and injected into the document. When your data
changes, the &lt;code&gt;render&lt;/code&gt; method is called again. In order to perform updates as
efficiently as possible, we diff the return value from the previous call to
&lt;code&gt;render&lt;/code&gt; with the new one, and generate a minimal set of changes to be applied
to the DOM.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The data returned from &lt;code&gt;render&lt;/code&gt; is neither a string nor a DOM node -- it&amp;#39;s a
lightweight description of what the DOM should look like.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;We call this process &lt;strong&gt;reconciliation&lt;/strong&gt;. Check out
&lt;a href=&quot;http://jsfiddle.net/fv6RD/3/&quot;&gt;this jsFiddle&lt;/a&gt; to see an example of
reconciliation in action.&lt;/p&gt;
&lt;p&gt;Because this re-render is so fast (around 1ms for TodoMVC), the developer
doesn&amp;#39;t need to explicitly specify data bindings. We&amp;#39;ve found this approach
makes it easier to build apps.&lt;/p&gt;
&lt;h2&gt;HTML is just the beginning.&lt;/h2&gt;
&lt;p&gt;Because React has its own lightweight representation of the document, we can do
some pretty cool things with it:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Facebook has dynamic charts that render to &lt;code&gt;&amp;lt;canvas&amp;gt;&lt;/code&gt; instead of HTML.&lt;/li&gt;
&lt;li&gt;Instagram is a &amp;quot;single page&amp;quot; web app built entirely with React and
&lt;code&gt;Backbone.Router&lt;/code&gt;. Designers regularly contribute React code with JSX.&lt;/li&gt;
&lt;li&gt;We&amp;#39;ve built internal prototypes that run React apps in a web worker and use
React to drive &lt;strong&gt;native iOS views&lt;/strong&gt; via an Objective-C bridge.&lt;/li&gt;
&lt;li&gt;You can run React
&lt;a href=&quot;http://github.com/petehunt/react-server-rendering&quot;&gt;on the server&lt;/a&gt;
for SEO, performance, code sharing and overall flexibility.&lt;/li&gt;
&lt;li&gt;Events behave in a consistent, standards-compliant way in all browsers
(including IE8) and automatically use
&lt;a href=&quot;http://davidwalsh.name/event-delegate&quot;&gt;event delegation&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Head on over to
&lt;a href=&quot;http://facebook.github.io/react&quot;&gt;facebook.github.io/react&lt;/a&gt; to check
out what we have built. Our documentation is geared towards building
apps with the framework, but if you are interested in the
nuts and bolts
&lt;a href=&quot;http://facebook.github.io/react/support.html&quot;&gt;get in touch&lt;/a&gt; with us!&lt;/p&gt;
&lt;p&gt;Thanks for reading!&lt;/p&gt;
</description>
<pubDate>2013-06-05T00:00:00-07:00</pubDate>
<link>http://facebook.github.io/react/blog/2013/06/05/why-react.html</link>
<guid isPermaLink="true">http://facebook.github.io/react/blog/2013/06/05/why-react.html</guid>
</item>
<item>
<title>JSFiddle Integration</title>
<description>&lt;p&gt;&lt;a href=&quot;http://jsfiddle.net&quot;&gt;JSFiddle&lt;/a&gt; just announced support for React. This is an exciting news as it makes collaboration on snippets of code a lot easier. You can play around this &lt;strong&gt;&lt;a href=&quot;http://jsfiddle.net/vjeux/kb3gN/&quot;&gt;base React JSFiddle&lt;/a&gt;&lt;/strong&gt;, fork it and share it! A &lt;a href=&quot;http://jsfiddle.net/vjeux/VkebS/&quot;&gt;fiddle without JSX&lt;/a&gt; is also available.&lt;/p&gt;
&lt;blockquote class=&quot;twitter-tweet&quot; align=&quot;center&quot;&gt;&lt;p&gt;React (by Facebook) is now available on JSFiddle. &lt;a href=&quot;http://t.co/wNQf9JPv5u&quot; title=&quot;http://facebook.github.io/react/&quot;&gt;facebook.github.io/react/&lt;/a&gt;&lt;/p&gt;&amp;mdash; JSFiddle (@jsfiddle) &lt;a href=&quot;https://twitter.com/jsfiddle/status/341114115781177344&quot;&gt;June 2, 2013&lt;/a&gt;&lt;/blockquote&gt;
&lt;script async src=&quot;//platform.twitter.com/widgets.js&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt;
</description>
<pubDate>2013-06-02T00:00:00-07:00</pubDate>
<link>http://facebook.github.io/react/blog/2013/06/02/jsfiddle-integration.html</link>
<guid isPermaLink="true">http://facebook.github.io/react/blog/2013/06/02/jsfiddle-integration.html</guid>
</item>
</channel>
</rss>
+2
View File
@@ -12,6 +12,7 @@
<meta property="og:description" content="A JavaScript library for building user interfaces" />
<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/react.css">
<link rel="stylesheet" href="/react/css/syntax.css">
@@ -41,6 +42,7 @@
<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/">blog</a></li>
<li><a href="http://github.com/facebook/react">github</a>
</ul>
<!-- <iframe src="http://ghbtns.com/github&#45;btn.html?user=facebook&#38;repo=react.js&#38;type=fork"allowtransparency="true" frameborder="0" scrolling="0" width="62" height="20"></iframe> -->
+6 -6
View File
@@ -14,15 +14,15 @@ var TodoList = React.createClass({\n\
});\n\
\n\
var TodoCreate = React.createClass({\n\
handleSubmit: function() {\n\
handleSubmit: React.autoBind(function() {\n\
var textInput = this.refs.textInput.getDOMNode();\n\
this.props.onCreate(textInput.value);\n\
textInput.value = '';\n\
return false;\n\
},\n\
}),\n\
render: function() {\n\
return (\n\
<form onSubmit={this.handleSubmit.bind(this)}>\n\
<form onSubmit={this.handleSubmit}>\n\
<input type=\"text\" ref=\"textInput\" />\n\
<button>Add</button>\n\
</form>\n\
@@ -34,15 +34,15 @@ var TodoApp = React.createClass({\n\
getInitialState: function() {\n\
return {items: []};\n\
},\n\
onItemCreate: function(value) {\n\
onItemCreate: React.autoBind(function(value) {\n\
this.setState({items: this.state.items.concat([value])});\n\
},\n\
}),\n\
render: function() {\n\
return (\n\
<div>\n\
<h3>TODO</h3>\n\
<TodoList items={this.state.items} />\n\
<TodoCreate onCreate={this.onItemCreate.bind(this)} />\n\
<TodoCreate onCreate={this.onItemCreate} />\n\
</div>\n\
);\n\
}\n\
+2 -2
View File
@@ -81,7 +81,7 @@ var ReactPlayground = React.createClass({displayName: 'ReactPlayground',
);
} else if (this.state.mode === this.MODES.JS) {
content =
React.DOM.div( {className:{playgroundJS: true, playgroundStage: true}},
React.DOM.div( {className:"playgroundJS playgroundStage"},
this.getDesugaredCode()
);
}
@@ -121,7 +121,7 @@ var ReactPlayground = React.createClass({displayName: 'ReactPlayground',
}
} catch (e) {
React.renderComponent(
React.DOM.div( {content:e.toString(), className:{playgroundError: true}}, null ),
React.DOM.div( {content:e.toString(), className:"playgroundError"}, null ),
mountNode
);
}
+2
View File
@@ -12,6 +12,7 @@
<meta property="og:description" content="A JavaScript library for building user interfaces" />
<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/react.css">
<link rel="stylesheet" href="/react/css/syntax.css">
@@ -41,6 +42,7 @@
<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/">blog</a></li>
<li><a href="http://github.com/facebook/react">github</a>
</ul>
<!-- <iframe src="http://ghbtns.com/github&#45;btn.html?user=facebook&#38;repo=react.js&#38;type=fork"allowtransparency="true" frameborder="0" scrolling="0" width="62" height="20"></iframe> -->
+2
View File
@@ -12,6 +12,7 @@
<meta property="og:description" content="A JavaScript library for building user interfaces" />
<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/react.css">
<link rel="stylesheet" href="/react/css/syntax.css">
@@ -41,6 +42,7 @@
<li><a href="/react/docs/getting-started.html">docs</a></li>
<li><a href="/react/support.html" class="active">support</a></li>
<li><a href="/react/downloads.html">download</a></li>
<li><a href="/react/blog/">blog</a></li>
<li><a href="http://github.com/facebook/react">github</a>
</ul>
<!-- <iframe src="http://ghbtns.com/github&#45;btn.html?user=facebook&#38;repo=react.js&#38;type=fork"allowtransparency="true" frameborder="0" scrolling="0" width="62" height="20"></iframe> -->