Rebuild manually

This commit is contained in:
Dan Abramov
2017-04-11 22:10:02 +01:00
parent 724d87ea40
commit a1457be82f
7 changed files with 10 additions and 9 deletions
+2 -2
View File
@@ -240,10 +240,10 @@
<p>We recommend using <a href="https://yarnpkg.com/">Yarn</a> or <a href="https://www.npmjs.com/">npm</a> for managing front-end dependencies. If you&#39;re new to package managers, the <a href="https://yarnpkg.com/en/docs/getting-started">Yarn documentation</a> is a good place to get started.</p>
<p>To install React with Yarn, run:</p>
<div class="highlight"><pre><code class="language-bash" data-lang="bash">yarn add react@15.5.0 react-dom@15.5.0
<div class="highlight"><pre><code class="language-bash" data-lang="bash">yarn add react@^15.5.0 react-dom@^15.5.0
</code></pre></div>
<p>To install React with npm, run:</p>
<div class="highlight"><pre><code class="language-bash" data-lang="bash">npm install --save react@15.5.0 react-dom@15.5.0
<div class="highlight"><pre><code class="language-bash" data-lang="bash">npm install --save react@^15.5.0 react-dom@^15.5.0
</code></pre></div>
<p>We recommend using a bundler like <a href="https://webpack.js.org/">webpack</a> or <a href="http://browserify.org/">Browserify</a> so you can write modular code and bundle it together into small packages to optimize load time.</p>
+2 -2
View File
@@ -270,10 +270,10 @@
<p>We recommend using <a href="https://yarnpkg.com/">Yarn</a> or <a href="https://www.npmjs.com/">npm</a> for managing front-end dependencies. If you&#39;re new to package managers, the <a href="https://yarnpkg.com/en/docs/getting-started">Yarn documentation</a> is a good place to get started.</p>
<p>To install React with Yarn, run:</p>
<div class="highlight"><pre><code class="language-bash" data-lang="bash">yarn add react@15.5.0 react-dom@15.5.0
<div class="highlight"><pre><code class="language-bash" data-lang="bash">yarn add react@^15.5.0 react-dom@^15.5.0
</code></pre></div>
<p>To install React with npm, run:</p>
<div class="highlight"><pre><code class="language-bash" data-lang="bash">npm install --save react@15.5.0 react-dom@15.5.0
<div class="highlight"><pre><code class="language-bash" data-lang="bash">npm install --save react@^15.5.0 react-dom@^15.5.0
</code></pre></div>
<p>We recommend using a bundler like <a href="https://webpack.js.org/">webpack</a> or <a href="http://browserify.org/">Browserify</a> so you can write modular code and bundle it together into small packages to optimize load time.</p>
-1
View File
@@ -130,7 +130,6 @@
<ul>
<li><a href="https://github.com/facebook/react/tree/master/src"><code>src</code></a> is the source code of React. <strong>If your change is related to the code, <code>src</code> is where you&#39;ll spend most of your time.</strong></li>
<li><a href="https://github.com/facebook/react/tree/master/docs"><code>docs</code></a> is the React documentation website. When you change APIs, make sure to update the relevant Markdown files.</li>
<li><a href="https://github.com/facebook/react/tree/master/examples"><code>examples</code></a> contains a few small React demos with different build setups.</li>
<li><a href="https://github.com/facebook/react/tree/master/packages"><code>packages</code></a> contains metadata (such as <code>package.json</code>) for all packages in the React repository. Nevertheless, their source code is still located inside <a href="https://github.com/facebook/react/tree/master/src"><code>src</code></a>.</li>
<li><code>build</code> is the build output of React. It is not in the repository but it will appear in your React clone after you <a href="/react/contributing/how-to-contribute.html#development-workflow">build it</a> for the first time.</li>
</ul>
+2
View File
@@ -78,6 +78,8 @@
<p>It is very technical and assumes a strong understanding of React public API as well as how it&#39;s divided into core, renderers, and the reconciler. If you&#39;re not very familiar with the React codebase, read <a href="/react/contributing/codebase-overview.html">the codebase overview</a> first.</p>
<p>It also assumes an understanding of the <a href="/react/blog/2015/12/18/react-components-elements-and-instances.html">differences between React components, their instances, and elements</a>.</p>
<p>The stack reconciler is powering all the React production code today. It is located in <a href="https://github.com/facebook/react/tree/master/src/renderers/shared/stack"><code>src/renderers/shared/stack/reconciler</code></a> and is used by both React DOM and React Native.</p>
<h3>Video: Building React from Scratch</h3>
+1 -1
View File
@@ -124,7 +124,7 @@
</code></pre></div>
<p>The keys of the passed object (that is, <code>left</code> and <code>right</code>) are used as keys for the entire set of children, and the order of the object&#39;s keys is used to determine the order of the rendered children. With this change, the two sets of children will be properly reordered in the DOM without unmounting.</p>
<p>The return value of <code>createFragment</code> should be treated as an opaque object; you can use the <a href="/react/docs/react-api.html#react.children"><code>React.Children</code></a> helpers to loop through a fragment but should not access it directly. Note also that we&#39;re relying on the JavaScript engine preserving object enumeration order here, which is not guaranteed by the spec but is implemented by all major browsers and VMs for objects with non-numeric keys.</p>
<p>The return value of <code>createFragment</code> should be treated as an opaque object; you can use the <a href="https://facebook.github.io/react/docs/react-api.html#react.children"><code>React.Children</code></a> helpers to loop through a fragment but should not access it directly. Note also that we&#39;re relying on the JavaScript engine preserving object enumeration order here, which is not guaranteed by the spec but is implemented by all major browsers and VMs for objects with non-numeric keys.</p>
<div class="docs-prevnext">
+1 -1
View File
@@ -333,7 +333,7 @@
<ul>
<li>React calls the function specified as <code>onChange</code> on the DOM <code>&lt;input&gt;</code>. In our case, this is the <code>handleChange</code> method in <code>TemperatureInput</code> component.</li>
<li>The <code>handleChange</code> method in the <code>TemperatureInput</code> component calls <code>this.props.onTemperatureChange()</code> with the new desired value. Its props, including <code>onTemperatureChange</code>, were provided by its parent component, the <code>Calculator</code>.</li>
<li>When it previously rendered, the <code>Calculator</code> has specified that <code>onTemperatureChange</code> of the Celsius <code>TemperatureInput</code> is the <code>Calculator</code>&#39;s <code>handleCelsiusChange</code> method, and <code>onTemperatureChange</code> of the Fahrenheit <code>TemperatureInput</code> is the <code>Calculator</code>&#39;s <code>handleFahrehnheitChange</code> method. So either of these two <code>Calculator</code> methods gets called depending on which input we edited.</li>
<li>When it previously rendered, the <code>Calculator</code> has specified that <code>onTemperatureChange</code> of the Celsius <code>TemperatureInput</code> is the <code>Calculator</code>&#39;s <code>handleCelsiusChange</code> method, and <code>onTemperatureChange</code> of the Fahrenheit <code>TemperatureInput</code> is the <code>Calculator</code>&#39;s <code>handleFahrenheitChange</code> method. So either of these two <code>Calculator</code> methods gets called depending on which input we edited.</li>
<li>Inside these methods, the <code>Calculator</code> component asks React to re-render itself by calling <code>this.setState()</code> with the new input value and the current scale of the input we just edited.</li>
<li>React calls the <code>Calculator</code> component&#39;s <code>render</code> method to learn what the UI should look like. The values of both inputs are recomputed based on the current temperature and the active scale. The temperature conversion is performed here.</li>
<li>React calls the <code>render</code> methods of the individual <code>TemperatureInput</code> components with their new props specified by the <code>Calculator</code>. It learns what their UI should look like.</li>
+2 -2
View File
@@ -152,10 +152,10 @@
&lt;p&gt;We recommend using &lt;a href=&quot;https://yarnpkg.com/&quot;&gt;Yarn&lt;/a&gt; or &lt;a href=&quot;https://www.npmjs.com/&quot;&gt;npm&lt;/a&gt; for managing front-end dependencies. If you&amp;#39;re new to package managers, the &lt;a href=&quot;https://yarnpkg.com/en/docs/getting-started&quot;&gt;Yarn documentation&lt;/a&gt; is a good place to get started.&lt;/p&gt;
&lt;p&gt;To install React with Yarn, run:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;yarn add react@15.5.0 react-dom@15.5.0
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;yarn add react@^15.5.0 react-dom@^15.5.0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;To install React with npm, run:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;npm install --save react@15.5.0 react-dom@15.5.0
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;npm install --save react@^15.5.0 react-dom@^15.5.0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;We recommend using a bundler like &lt;a href=&quot;https://webpack.js.org/&quot;&gt;webpack&lt;/a&gt; or &lt;a href=&quot;http://browserify.org/&quot;&gt;Browserify&lt;/a&gt; so you can write modular code and bundle it together into small packages to optimize load time.&lt;/p&gt;