Skip to content

Commit b04d6db

Browse files
authored
Merge branch 'master' into translate-Handling-Events
2 parents 1e547bd + f4a7efc commit b04d6db

File tree

231 files changed

+2960
-2466
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

231 files changed

+2960
-2466
lines changed
-87.2 KB
Binary file not shown.

README.md

+8-5
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,7 @@ This repo contains the source code and documentation powering [reactjs.org](http
4848
大家在翻译过程中会遇到不需要翻译的内容,可以添加到词汇表中。
4949

5050
项目起步,部分内容逐步完善中。后续会添加相关流程图片,便于理解。
51-
该流程我继续细化,如有疑问。可扫码进入该群,一起讨论完善这个项目:
52-
53-
<div align="center">
54-
<img src="./4BA430EC-A3C2-4CD9-8E44-D21E6461854D.png" width="300" height="388" alt="图片名称" align=center />
55-
</div>
51+
该流程我继续细化,如有疑问。
5652

5753
## About Chinese translation:
5854

@@ -140,6 +136,13 @@ The documentation is divided into several sections with a different tone and pur
140136
1. Follow GitHub's instructions.
141137
1. If possible, include screenshots of visual changes. A Netlify build will also be automatically created once you make your PR so other people can see your change.
142138

139+
## Translation
140+
141+
If you are interested in translating `reactjs.org`, please see the current translation efforts at [isreacttranslatedyet.com](https://www.isreacttranslatedyet.com/).
142+
143+
144+
If your language does not have a translation and you would like to create one, please follow the instructions at [reactjs.org Translations](https://github.com/reactjs/reactjs.org-translation#translating-reactjsorg).
145+
143146
## Troubleshooting
144147

145148
- `yarn reset` to clear the local cache

content/authors.yml

+3
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ sophiebits:
7373
steveluscher:
7474
name: Steven Luscher
7575
url: https://twitter.com/steveluscher
76+
tesseralis:
77+
name: Nat Alison
78+
url: https://twitter.com/tesseralis
7679
timer:
7780
name: Joe Haddad
7881
url: https://twitter.com/timer150

content/blog/2013-06-05-why-react.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ author: [petehunt]
66
There are a lot of JavaScript MVC frameworks out there. Why did we build React
77
and why would you want to use it?
88

9-
## React isn't an MVC framework.
9+
## React isn't an MVC framework. {#react-isnt-an-mvc-framework}
1010

1111
React is a library for building composable user interfaces. It encourages
1212
the creation of reusable UI components which present data that changes over
1313
time.
1414

15-
## React doesn't use templates.
15+
## React doesn't use templates. {#react-doesnt-use-templates}
1616

1717
Traditionally, web application UIs are built using templates or HTML directives.
1818
These templates dictate the full set of abstractions that you are allowed to use
@@ -33,7 +33,7 @@ to render views, which we see as an advantage over templates for a few reasons:
3333
We've also created [JSX](/docs/jsx-in-depth.html), an optional syntax
3434
extension, in case you prefer the readability of HTML to raw JavaScript.
3535

36-
## Reactive updates are dead simple.
36+
## Reactive updates are dead simple. {#reactive-updates-are-dead-simple}
3737

3838
React really shines when your data changes over time.
3939

@@ -63,7 +63,7 @@ Because this re-render is so fast (around 1ms for TodoMVC), the developer
6363
doesn't need to explicitly specify data bindings. We've found this approach
6464
makes it easier to build apps.
6565

66-
## HTML is just the beginning.
66+
## HTML is just the beginning. {#html-is-just-the-beginning}
6767

6868
Because React has its own lightweight representation of the document, we can do
6969
some pretty cool things with it:

content/blog/2013-06-12-community-roundup.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: [vjeux]
55

66
React was open sourced two weeks ago and it's time for a little round-up of what has been going on.
77

8-
## Khan Academy Question Editor
8+
## Khan Academy Question Editor {#khan-academy-question-editor}
99

1010
It looks like [Sophie Alpert](http://sophiebits.com/) is the first person outside of Facebook and Instagram to push React code to production. We are very grateful for her contributions in form of pull requests, bug reports and presence on IRC ([#reactjs on Freenode](irc://chat.freenode.net/reactjs)). Sophie wrote about her experience using React:
1111

@@ -16,7 +16,7 @@ It looks like [Sophie Alpert](http://sophiebits.com/) is the first person outsid
1616
>
1717
> [Read the full post...](http://sophiebits.com/2013/06/09/using-react-to-speed-up-khan-academy.html)
1818
19-
## Pimp my Backbone.View (by replacing it with React)
19+
## Pimp my Backbone.View (by replacing it with React) {#pimp-my-backboneview-by-replacing-it-with-react}
2020

2121
[Paul Seiffert](https://blog.mayflower.de/) wrote a blog post that explains how to integrate React into Backbone applications.
2222

@@ -28,15 +28,15 @@ It looks like [Sophie Alpert](http://sophiebits.com/) is the first person outsid
2828
>
2929
> [Read the full post...](https://blog.mayflower.de/3937-Backbone-React.html)
3030
31-
## Using facebook's React with require.js
31+
## Using facebook's React with require.js {#using-facebooks-react-with-requirejs}
3232

3333
[Mario Mueller](http://blog.xenji.com/) wrote a menu component in React and was able to easily integrate it with require.js, EventEmitter2 and bower.
3434

3535
> I recently stumbled upon facebook's React library, which is a JavaScript library for building reusable frontend components. Even if this lib is only at version 0.3.x it behaves very stable, it is fast and is fun to code. I'm a big fan of require.js, so I tried to use React within the require.js eco system. It was not as hard as expected and here are some examples and some thoughts about it.
3636
>
3737
> [Read the full post...](http://blog.xenji.com/2013/06/facebooks-react-require-js.html)
3838
39-
## Origins of React
39+
## Origins of React {#origins-of-react}
4040

4141
[Pete Hunt](http://www.petehunt.net/blog/) explained what differentiates React from other JavaScript libraries in [a previous blog post](/blog/2013/06/05/why-react.html). [Lee Byron](http://leebyron.com/) gives another perspective on Quora:
4242

content/blog/2013-06-19-community-roundup-2.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: [vjeux]
55

66
Since the launch we have received a lot of feedback and are actively working on React 0.4. In the meantime, here are the highlights of this week.
77

8-
## Some quick thoughts on React
8+
## Some quick thoughts on React {#some-quick-thoughts-on-react}
99

1010
[Andrew Greig](http://www.andrewgreig.com/) made a blog post that gives a high level description of what React is.
1111

@@ -19,7 +19,7 @@ Since the launch we have received a lot of feedback and are actively working on
1919
>
2020
> [Read the full post...](http://www.andrewgreig.com/637/)
2121
22-
## React and Socket.IO Chat Application
22+
## React and Socket.IO Chat Application {#react-and-socketio-chat-application}
2323

2424
[Danial Khosravi](https://danialk.github.io/) made a real-time chat application that interacts with the back-end using Socket.IO.
2525

@@ -28,7 +28,7 @@ Since the launch we have received a lot of feedback and are actively working on
2828
>
2929
> [Read the full post...](https://danialk.github.io/blog/2013/06/16/reactjs-and-socket-dot-io-chat-application/)
3030
31-
## React and Other Frameworks
31+
## React and Other Frameworks {#react-and-other-frameworks}
3232

3333
[Pete Hunt](http://www.petehunt.net/blog/) wrote an answer on Quora comparing React and Angular directives. At the end, he explains how you can make an Angular directive that is in fact being rendered with React.
3434

@@ -40,7 +40,7 @@ Since the launch we have received a lot of feedback and are actively working on
4040
4141
In the same vein, [Markov Twain](https://twitter.com/markov_twain/status/345702941845499906) re-implemented the examples on the front-page [with Ember](http://jsbin.com/azihiw/2/edit) and [Vlad Yazhbin](https://twitter.com/vla) re-implemented the tutorial [with Angular](http://jsfiddle.net/vla/Cdrse/).
4242

43-
## Web Components: React & x-tags
43+
## Web Components: React & x-tags {#web-components-react--x-tags}
4444

4545
Mozilla and Google are actively working on Web Components. [Vjeux](http://blog.vjeux.com/) wrote a proof of concept that shows how to implement them using React.
4646

@@ -49,7 +49,7 @@ Mozilla and Google are actively working on Web Components. [Vjeux](http://blog.v
4949
>
5050
> [Read the full post...](http://blog.vjeux.com/2013/javascript/custom-components-react-x-tags.html)
5151
52-
## React TodoMVC Example
52+
## React TodoMVC Example {#react-todomvc-example}
5353

5454
[TodoMVC.com](http://todomvc.com/) is a website that collects various implementations of the same basic Todo app. [Pete Hunt](http://www.petehunt.net/blog/) wrote an idiomatic React version.
5555

@@ -60,7 +60,7 @@ Mozilla and Google are actively working on Web Components. [Vjeux](http://blog.v
6060
>
6161
> [Read the source code...](https://github.com/tastejs/todomvc/tree/gh-pages/labs/architecture-examples/react)
6262
63-
## JSX is not HTML
63+
## JSX is not HTML {#jsx-is-not-html}
6464

6565
Many of you pointed out differences between JSX and HTML. In order to clear up some confusion, we have added some documentation that covers the four main differences:
6666

content/blog/2013-06-21-react-v0-3-3.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ author: [zpao]
66
We have a ton of great stuff coming in v0.4, but in the meantime we're releasing v0.3.3. This release addresses some small issues people were having and simplifies our tools to make them easier to use.
77

88

9-
## react-tools
9+
## react-tools {#react-tools}
1010

1111
* Upgrade Commoner so `require` statements are no longer relativized when passing through the transformer. This was a feature needed when building React, but doesn't translate well for other consumers of `bin/jsx`.
1212
* Upgraded our dependencies on Commoner and Recast so they use a different directory for their cache.
1313
* Freeze our esprima dependency.
1414

1515

16-
## React
16+
## React {#react}
1717

1818
* Allow reusing the same DOM node to render different components. e.g. `React.renderComponent(<div/>, domNode); React.renderComponent(<span/>, domNode);` will work now.
1919

2020

21-
## JSXTransformer
21+
## JSXTransformer {#jsxtransformer}
2222

2323
* Improved the in-browser transformer so that transformed scripts will execute in the expected scope. The allows components to be defined and used from separate files.

content/blog/2013-06-27-community-roundup-3.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: [vjeux]
55

66
The highlight of this week is that an interaction-heavy app has been ported to React. React components are solving issues they had with nested views.
77

8-
## Moving From Backbone To React
8+
## Moving From Backbone To React {#moving-from-backbone-to-react}
99

1010
[Clay Allsopp](https://twitter.com/clayallsopp) successfully ported [Propeller](http://usepropeller.com/blog/posts/from-backbone-to-react/), a fairly big, interaction-heavy JavaScript app, to React.
1111

@@ -17,7 +17,7 @@ The highlight of this week is that an interaction-heavy app has been ported to R
1717
>
1818
> [Read the full post...](http://usepropeller.com/blog/posts/from-backbone-to-react/)
1919
20-
## Grunt Task for JSX
20+
## Grunt Task for JSX {#grunt-task-for-jsx}
2121

2222
[Eric Clemmons](https://ericclemmons.github.io/) wrote a task for [Grunt](http://gruntjs.com/) that applies the JSX transformation to your JavaScript files. It also works with [Browserify](http://browserify.org/) if you want all your files to be concatenated and minified together.
2323

@@ -45,7 +45,7 @@ The highlight of this week is that an interaction-heavy app has been ported to R
4545
>
4646
> [Check out the project ...](https://github.com/ericclemmons/grunt-react)
4747
48-
## Backbone/Handlebars Nested Views
48+
## Backbone/Handlebars Nested Views {#backbonehandlebars-nested-views}
4949
5050
[Joel Burget](http://joelburget.com/) wrote a blog post talking about the way we would write React-like components in Backbone and Handlebars.
5151
@@ -57,13 +57,13 @@ The highlight of this week is that an interaction-heavy app has been ported to R
5757
>
5858
> [Read the full post...](http://joelburget.com/react/)
5959
60-
## JSRomandie Meetup
60+
## JSRomandie Meetup {#jsromandie-meetup}
6161
6262
[Renault John Lecoultre](https://twitter.com/renajohn/) from [BugBuster](http://www.bugbuster.com) did a React introduction talk at a JS meetup called [JS Romandie](https://twitter.com/jsromandie) last week.
6363
6464
<script async class="speakerdeck-embed" data-id="888a9d50c01b01300df36658d0894ac1" data-ratio="1.33333333333333" src="//speakerdeck.com/assets/embed.js"></script>
6565
66-
## CoffeeScript integration
66+
## CoffeeScript integration {#coffeescript-integration}
6767
6868
[Vjeux](http://blog.vjeux.com/) used the fact that JSX is just a syntactic sugar on-top of regular JS to rewrite the React front-page examples in CoffeeScript.
6969
@@ -81,7 +81,7 @@ The highlight of this week is that an interaction-heavy app has been ported to R
8181
>
8282
> [Read the full post...](http://blog.vjeux.com/2013/javascript/react-coffeescript.html)
8383
84-
## Tutorial in Plain JavaScript
84+
## Tutorial in Plain JavaScript {#tutorial-in-plain-javascript}
8585
8686
We've seen a lot of people comparing React with various frameworks. [Ricardo Tomasi](http://ricardo.cc/) decided to re-implement the tutorial without any framework, just plain JavaScript.
8787

content/blog/2013-07-02-react-v0-4-autobind-by-default.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: [zpao]
66
React v0.4 is very close to completion. As we finish it off, we'd like to share with you some of the major changes we've made since v0.3. This is the first of several posts we'll be making over the next week.
77

88

9-
## What is React.autoBind?
9+
## What is React.autoBind? {#what-is-reactautobind}
1010

1111
If you take a look at most of our current examples, you'll see us using `React.autoBind` for event handlers. This is used in place of `Function.prototype.bind`. Remember that in JS, [function calls are late-bound](https://bonsaiden.github.io/JavaScript-Garden/#function.this). That means that if you simply pass a function around, the `this` used inside won't necessarily be the `this` you expect. `Function.prototype.bind` creates a new, properly bound, function so that when called, `this` is exactly what you expect it to be.
1212

@@ -33,7 +33,7 @@ React.createClass({
3333
```
3434

3535

36-
## What's Changing in v0.4?
36+
## What's Changing in v0.4? {#whats-changing-in-v04}
3737

3838
After using `React.autoBind` for a few weeks, we realized that there were very few times that we didn't want that behavior. So we made it the default! Now all methods defined within `React.createClass` will already be bound to the correct instance.
3939

content/blog/2013-07-03-community-roundup-4.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: [vjeux]
55

66
React reconciliation process appears to be very well suited to implement a text editor with a live preview as people at Khan Academy show us.
77

8-
## Khan Academy
8+
## Khan Academy {#khan-academy}
99

1010
[Ben Kamens](http://bjk5.com/) explains how [Sophie Alpert](http://sophiebits.com/) and [Joel Burget](http://joelburget.com/) are promoting React inside of [Khan Academy](https://www.khanacademy.org/). They now have three projects in the works using React.
1111

@@ -21,7 +21,7 @@ The best part is the demo of how React reconciliation process makes live editing
2121
2222
[![](../images/blog/monkeys.gif)](http://bjk5.com/post/53742233351/getting-your-team-to-adopt-new-technology)
2323

24-
## React Snippets
24+
## React Snippets {#react-snippets}
2525

2626
Over the past several weeks, members of our team, [Pete Hunt](http://www.petehunt.net/) and [Paul O'Shannessy](http://zpao.com/), answered many questions that were asked in the [React group](https://groups.google.com/forum/#!forum/reactjs). They give a good overview of how to integrate React with other libraries and APIs through the use of [Mixins](/docs/reusable-components.html) and [Lifecycle Methods](/docs/working-with-the-browser.html).
2727

@@ -44,13 +44,13 @@ Over the past several weeks, members of our team, [Pete Hunt](http://www.petehun
4444
>
4545
> * [JSFiddle](http://jsfiddle.net/LQxy7/): Your React component simply render empty divs, and then in componentDidMount() you call React.renderComponent() on each of those divs to set up a new root React tree. Be sure to explicitly unmountAndReleaseReactRootNode() for each component in componentWillUnmount().
4646
47-
## Introduction to React Screencast
47+
## Introduction to React Screencast {#introduction-to-react-screencast}
4848

4949
[Pete Hunt](http://www.petehunt.net/) recorded himself implementing a simple `<Blink>` tag in React.
5050

5151
<figure><iframe src="https://player.vimeo.com/video/67248575" width="100%" height="340" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></figure>
5252

53-
## Snake in React
53+
## Snake in React {#snake-in-react}
5454

5555
[Tom Occhino](http://tomocchino.com/) implemented Snake in 150 lines with React.
5656

content/blog/2013-07-11-react-v0-4-prop-validation-and-default-values.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: [zpao]
66
Many of the questions we got following the public launch of React revolved around `props`, specifically that people wanted to do validation and to make sure their components had sensible defaults.
77

88

9-
## Validation
9+
## Validation {#validation}
1010

1111
Oftentimes you want to validate your `props` before you use them. Perhaps you want to ensure they are a specific type. Or maybe you want to restrict your prop to specific values. Or maybe you want to make a specific prop required. This was always possible — you could have written validations in your `render` or `componentWillReceiveProps` functions, but that gets clunky fast.
1212

@@ -29,7 +29,7 @@ React.createClass({
2929
```
3030

3131

32-
## Default Values
32+
## Default Values {#default-values}
3333

3434
One common pattern we've seen with our React code is to do something like this:
3535

content/blog/2013-07-17-react-v0-4-0.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ React v0.4 has some big changes. We've also restructured the documentation to be
1313
When you're ready, [go download it](/docs/installation.html)!
1414

1515

16-
### React
16+
### React {#react}
1717

1818
* Switch from using `id` attribute to `data-reactid` to track DOM nodes. This allows you to integrate with other JS and CSS libraries more easily.
1919
* Support for more DOM elements and attributes (e.g., `<canvas>`)
@@ -25,15 +25,15 @@ When you're ready, [go download it](/docs/installation.html)!
2525
* We've implemented an improved synthetic event system that conforms to the W3C spec.
2626
* Updates to your component are batched now, which may result in a significantly faster re-render of components. `this.setState` now takes an optional callback as its second parameter. If you were using `onClick={this.setState.bind(this, state)}` previously, you'll want to make sure you add a third parameter so that the event is not treated as the callback.
2727

28-
### JSX
28+
### JSX {#jsx}
2929

3030
* Support for comment nodes `<div>{/* this is a comment and won't be rendered */}</div>`
3131
* Children are now transformed directly into arguments instead of being wrapped in an array
3232
E.g. `<div><Component1/><Component2/></div>` is transformed into `React.DOM.div(null, Component1(null), Component2(null))`.
3333
Previously this would be transformed into `React.DOM.div(null, [Component1(null), Component2(null)])`.
3434
If you were using React without JSX previously, your code should still work.
3535

36-
### react-tools
36+
### react-tools {#react-tools}
3737

3838
* Fixed a number of bugs when transforming directories
3939
* No longer re-write `require()`s to be relative unless specified

0 commit comments

Comments
 (0)