Skip to content

Commit 70ca85b

Browse files
author
Ted Kim
committed
Merge branch 'master' of https://github.com/facebook/react into translation
2 parents b40265f + c927cfa commit 70ca85b

File tree

238 files changed

+5572
-2577
lines changed

Some content is hidden

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

238 files changed

+5572
-2577
lines changed

.babelrc

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"presets": ["react"],
3+
"ignore": ["third_party"],
4+
"plugins": [
5+
"fbjs-scripts/babel-6/dev-expression",
6+
"syntax-trailing-function-commas",
7+
"transform-es2015-template-literals",
8+
"transform-es2015-literals",
9+
"transform-es2015-arrow-functions",
10+
"transform-es2015-block-scoped-functions",
11+
["transform-es2015-classes", { "loose": true }],
12+
"transform-es2015-object-super",
13+
"transform-es2015-shorthand-properties",
14+
"transform-es2015-computed-properties",
15+
"transform-es2015-for-of",
16+
"check-es2015-constants",
17+
["transform-es2015-spread", { "loose": true }],
18+
"transform-es2015-parameters",
19+
["transform-es2015-destructuring", { "loose": true }],
20+
"transform-es2015-block-scoping",
21+
"transform-es2015-modules-commonjs",
22+
"transform-es3-member-expression-literals",
23+
"transform-es3-property-literals"
24+
]
25+
}

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ docs/vendor/bundle/
1111
examples/
1212
# Ignore built files.
1313
build/
14+
coverage/
1415
scripts/bench/bench-*.js
1516
vendor/*

.eslintrc

-64
This file was deleted.

.eslintrc.js

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
const OFF = 0;
2+
const WARNING = 1;
3+
const ERROR = 2;
4+
5+
module.exports = {
6+
parser: 'babel-eslint',
7+
8+
extends: './node_modules/fbjs-scripts/eslint/.eslintrc.js',
9+
10+
plugins: [
11+
'react',
12+
'react-internal',
13+
],
14+
15+
ecmaFeatures: {
16+
modules: false
17+
},
18+
19+
// We're stricter than the default config, mostly. We'll override a few rules
20+
// and then enable some React specific ones.
21+
rules: {
22+
'accessor-pairs': OFF,
23+
'brace-style': [ERROR, '1tbs'],
24+
'comma-dangle': [ERROR, 'always-multiline'],
25+
'consistent-return': ERROR,
26+
'dot-location': [ERROR, 'property'],
27+
'dot-notation': ERROR,
28+
'eol-last': ERROR,
29+
'eqeqeq': [ERROR, 'allow-null'],
30+
'indent': [ERROR, 2, {SwitchCase: 1}],
31+
'jsx-quotes': [ERROR, 'prefer-double'],
32+
'no-bitwise': OFF,
33+
'no-multi-spaces': ERROR,
34+
'no-restricted-syntax': [ERROR, 'WithStatement'],
35+
'no-shadow': ERROR,
36+
'no-unused-expressions': ERROR,
37+
'no-unused-vars': [ERROR, {args: 'none'}],
38+
'quotes': [ERROR, 'single', 'avoid-escape'],
39+
'space-after-keywords': ERROR,
40+
'space-before-blocks': ERROR,
41+
'space-before-function-paren': [ERROR, {anonymous: 'never', named: 'never'}],
42+
'space-before-keywords': ERROR,
43+
'strict': [ERROR, 'global'],
44+
45+
// React & JSX
46+
// Our transforms set this automatically
47+
'react/display-name': OFF,
48+
'react/jsx-boolean-value': [ERROR, 'always'],
49+
'react/jsx-no-undef': ERROR,
50+
// We don't care to do this
51+
'react/jsx-sort-prop-types': OFF,
52+
'react/jsx-sort-props': OFF,
53+
'react/jsx-uses-react': ERROR,
54+
'react/jsx-uses-vars': ERROR,
55+
// It's easier to test some things this way
56+
'react/no-did-mount-set-state': OFF,
57+
'react/no-did-update-set-state': OFF,
58+
// We define multiple components in test files
59+
'react/no-multi-comp': OFF,
60+
'react/no-unknown-property': OFF,
61+
// This isn't useful in our test code
62+
'react/prop-types': OFF,
63+
'react/react-in-jsx-scope': ERROR,
64+
'react/self-closing-comp': ERROR,
65+
// We don't care to do this
66+
'react/sort-comp': OFF,
67+
'react/wrap-multilines': [ERROR, {declaration: false, assignment: false}],
68+
69+
// CUSTOM RULES
70+
// the second argument of warning/invariant should be a literal string
71+
'react-internal/warning-and-invariant-args': ERROR,
72+
}
73+
};

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@ chrome-user-data
2525
*.sublime-workspace
2626
.idea
2727
*.iml
28+
.vscode

.travis.yml

+5
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ script:
7373
else
7474
./node_modules/.bin/grunt jest:normal
7575
fi
76+
echo 'Testing in server-render (HTML generation) mode...'
77+
printf '\nmodule.exports.useCreateElement = false;\n' \
78+
>> src/renderers/dom/shared/ReactDOMFeatureFlags.js
79+
./node_modules/.bin/grunt jest:normal
80+
git checkout -- src/renderers/dom/shared/ReactDOMFeatureFlags.js
7681
else
7782
./node_modules/.bin/grunt $TEST_TYPE
7883
fi

CHANGELOG.md

+16
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
## 0.14.7 (January 28, 2016)
2+
3+
### React
4+
- Fixed bug with `<option>` tags when using `dangerouslySetInnerHTML`
5+
- Fixed memory leak in synthetic event system
6+
7+
### React TestUtils Add-on
8+
- Fixed bug with calling `setState` in `componentWillMount` when using shallow rendering
9+
10+
11+
## 0.14.6 (January 6, 2016)
12+
13+
### React
14+
- Updated `fbjs` dependency to pick up change affecting handling of undefined document.
15+
16+
117
## 0.14.5 (December 29, 2015)
218

319
### React

Gruntfile.js

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
'use strict';
22

3-
var assign = require('object-assign');
43
var path = require('path');
5-
var process = require('process');
64

75
var GULP_EXE = 'gulp';
86
if (process.platform === 'win32') {
@@ -35,7 +33,7 @@ module.exports = function(grunt) {
3533
// but if it breaks we'll fix it then.
3634
cmd: path.join('node_modules', '.bin', GULP_EXE),
3735
args: args,
38-
opts: assign({stdio: 'inherit'}, opts),
36+
opts: Object.assign({stdio: 'inherit'}, opts),
3937
}, function(err, result, code) {
4038
if (err) {
4139
grunt.fail.fatal('Something went wrong running gulp: ', result);
@@ -139,7 +137,12 @@ module.exports = function(grunt) {
139137
]);
140138

141139
// Automate the release!
142-
grunt.registerMultiTask('release', require('./grunt/tasks/release'));
140+
var releaseTasks = require('./grunt/tasks/release');
141+
grunt.registerTask('release:setup', releaseTasks.setup);
142+
grunt.registerTask('release:bower', releaseTasks.bower);
143+
grunt.registerTask('release:docs', releaseTasks.docs);
144+
grunt.registerTask('release:msg', releaseTasks.msg);
145+
grunt.registerTask('release:starter', releaseTasks.starter);
143146

144147
grunt.registerTask('release', [
145148
'release:setup',

README.md

+10-4
Original file line numberDiff line numberDiff line change
@@ -33,23 +33,29 @@ You'll notice that we used an HTML-like syntax; [we call it JSX](https://faceboo
3333

3434
## Installation
3535

36-
The fastest way to get started is to serve JavaScript from the CDN (also available on [cdnjs](https://cdnjs.com/libraries/react) and [jsdelivr](http://www.jsdelivr.com/#!react)):
36+
The fastest way to get started is to serve JavaScript from the CDN (also available on [cdnjs](https://cdnjs.com/libraries/react) and [jsdelivr](https://www.jsdelivr.com/projects/react)):
3737

3838
```html
3939
<!-- The core React library -->
40-
<script src="https://fb.me/react-0.14.5.js"></script>
40+
<script src="https://fb.me/react-0.14.7.js"></script>
4141
<!-- The ReactDOM Library -->
42-
<script src="https://fb.me/react-dom-0.14.5.js"></script>
42+
<script src="https://fb.me/react-dom-0.14.7.js"></script>
4343
```
4444

45-
We've also built a [starter kit](https://facebook.github.io/react/downloads/react-0.14.5.zip) which might be useful if this is your first time using React. It includes a webpage with an example of using React with live code.
45+
We've also built a [starter kit](https://facebook.github.io/react/downloads/react-0.14.7.zip) which might be useful if this is your first time using React. It includes a webpage with an example of using React with live code.
4646

4747
If you'd like to use [bower](http://bower.io), it's as easy as:
4848

4949
```sh
5050
bower install --save react
5151
```
5252

53+
And it's just as easy with [npm](http://npmjs.com):
54+
55+
```sh
56+
npm i --save react
57+
```
58+
5359
## Contribute
5460

5561
The main purpose of this repository is to continue to evolve React core, making it faster and easier to use. If you're interested in helping with that, then keep reading. If you're not interested in helping right now that's ok too. :) Any feedback you have about using React would be greatly appreciated.

docs/Rakefile

+29-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
require('rubygems')
22
require('json')
33
require('yaml')
4+
require('open-uri')
5+
6+
desc "download babel-browser"
7+
task :fetch_remotes do
8+
IO.copy_stream(
9+
open('https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.34/browser.min.js'),
10+
'js/babel-browser.min.js'
11+
)
12+
end
413

514
desc "generate js from jsx"
615
task :js do
7-
system "cp ../node_modules/babel/node_modules/babel-core/browser.min.js ./js/babel-browser.min.js"
816
system "../node_modules/.bin/babel _js --out-dir=js"
917
end
1018

@@ -24,6 +32,25 @@ task :update_version do
2432
end
2533
end
2634

35+
desc "update SRI hashes"
36+
task :update_hashes do
37+
map = {
38+
'react.js' => 'dev',
39+
'react.min.js' => 'prod',
40+
'react-with-addons.js' => 'addons_dev',
41+
'react-with-addons.min.js' => 'addons_prod',
42+
'react-dom.js' => 'dom_dev',
43+
'react-dom.min.js' => 'dom_prod',
44+
'react-dom-server.js' => 'dom_server_dev',
45+
'react-dom-server.min.js' => 'dom_server_prod'
46+
}
47+
site_config = YAML.load_file('_config.yml')
48+
map.each do |file, key|
49+
site_config['react_hashes'][key] = `openssl dgst -sha384 -binary ../../react-bower/#{file} | openssl base64 -A`
50+
end
51+
File.open('_config.yml', 'w+') { |f| f.write(site_config.to_yaml) }
52+
end
53+
2754
desc "update acknowledgements list"
2855
task :update_acknowledgements do
2956
authors = File.readlines('../AUTHORS').map {|author| author.gsub(/ <.*\n/,'')}
@@ -35,7 +62,7 @@ task :update_acknowledgements do
3562
end
3663

3764
desc "build into ../../react-gh-pages"
38-
task :release => [:update_version, :default] do
65+
task :release => [:update_version, :js, :fetch_remotes] do
3966
system "jekyll build -d ../../react-gh-pages"
4067
end
4168

docs/_config.yml

+13-4
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
name: React
33
description: A JavaScript library for building user interfaces
44
url: https://facebook.github.io
5-
baseurl: /react
6-
permalink: /blog/:year/:month/:day/:title.html
7-
paginate_path: /blog/page:num/
5+
baseurl: "/react"
6+
permalink: "/blog/:year/:month/:day/:title.html"
7+
paginate_path: "/blog/page:num/"
88
relative_permalinks: true
99
paginate: 5
1010
timezone: America/Los_Angeles
@@ -36,4 +36,13 @@ sass:
3636
sass_dir: _css
3737
gems:
3838
- jekyll-redirect-from
39-
react_version: 0.14.5
39+
react_version: 0.14.7
40+
react_hashes:
41+
dev: xQae1pUPdAKUe0u0KUTNt09zzdwheX4VSUsV8vatqM+t6X7rta01qOzessL808ox
42+
prod: zTm/dblzLXQNp3CgY+hfaC/WJ6h4XtNrePh2CW2+rO9GPuNiPb9jmthvAL+oI/dQ
43+
addons_dev: I5TF2q2QDmB31aN5lcClArdUo+WJH/Yi3hcH3PBVXFe5DYtYCFh7Jx/dmpba12zn
44+
addons_prod: KPHTQfiYMhtsIRbZcY4ri1lBYZQbj4ePsSdzODR2Bu5L5ts3APVyqwKPBThO5Hgc
45+
dom_dev: A1t0GCrR06cTHvMjaxeSE8XOiz6j7NvWdmxhN/9z748wEvJTVk13Rr8gMzTUnd8G
46+
dom_prod: ntqCsHbLdMxT352UbhPbT7fqjE8xi4jLmQYQa8mYR+ylAapbXRfdsDweueDObf7m
47+
dom_server_dev: 3I5+eGB/ILYa6pQQX+rM9O0SyDltamM40RiZ5JvIijSYEfVGZU0vY4Iwx9a1eYyD
48+
dom_server_prod: Kt9dEqXzv00orFPW2o3H+kxQtSiNO8EqXsXJT3i99rCcp74N/Km98V0kUxAzy44k

docs/_data/nav_docs.yml

+2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414
title: Videos
1515
- id: complementary-tools
1616
title: Complementary Tools
17+
href: https://github.com/facebook/react/wiki/Complementary-Tools
1718
- id: examples
1819
title: Examples
20+
href: https://github.com/facebook/react/wiki/Examples
1921
- title: Guides
2022
items:
2123
- id: why-react

0 commit comments

Comments
 (0)