Skip to content

Commit c979ff1

Browse files
committed
Merge pull request ptmt#45 from ptmt/merge-0.22.0
Merge github.com:facebook/react-native into master
2 parents 84b618a + eb307c0 commit c979ff1

File tree

511 files changed

+25715
-16269
lines changed

Some content is hidden

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

511 files changed

+25715
-16269
lines changed

.buckconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
[android]
3+
target = Google Inc.:Google APIs:23
4+
5+
[maven_repositories]
6+
central = https://repo1.maven.org/maven2
7+
8+
[alias]
9+
movies = //Examples/Movies/android/app:app

.buckjavaargs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-Xmx512m -XX:+HeapDumpOnOutOfMemoryError

.eslintrc

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,19 @@
1919
"__DEV__": true,
2020
"__dirname": false,
2121
"__fbBatchedBridgeConfig": false,
22+
"alert": false,
2223
"cancelAnimationFrame": false,
2324
"clearImmediate": true,
2425
"clearInterval": false,
2526
"clearTimeout": false,
2627
"console": false,
2728
"document": false,
2829
"escape": false,
30+
"Event": false,
31+
"EventTarget": false,
2932
"exports": false,
3033
"fetch": false,
34+
"FormData": false,
3135
"global": false,
3236
"jest": false,
3337
"Map": true,
@@ -43,7 +47,29 @@
4347
"setTimeout": false,
4448
"window": false,
4549
"XMLHttpRequest": false,
46-
"pit": false
50+
"pit": false,
51+
52+
// Flow global types.
53+
"ReactComponent": false,
54+
"ReactClass": false,
55+
"ReactElement": false,
56+
"ReactPropsCheckType": false,
57+
"ReactPropsChainableTypeChecker": false,
58+
"ReactPropTypes": false,
59+
"SyntheticEvent": false,
60+
"$Either": false,
61+
"$All": false,
62+
"$Tuple": false,
63+
"$Supertype": false,
64+
"$Subtype": false,
65+
"$Shape": false,
66+
"$Diff": false,
67+
"$Keys": false,
68+
"$Enum": false,
69+
"$Exports": false,
70+
"$FlowIssue": false,
71+
"$FlowFixMe": false,
72+
"$FixMe": false
4773
},
4874

4975
"rules": {
@@ -81,13 +107,12 @@
81107
"curly": 1, // specify curly brace conventions for all control statements
82108
"default-case": 0, // require default case in switch statements (off by default)
83109
"dot-notation": 1, // encourages use of dot notation whenever possible
84-
"eqeqeq": 1, // require the use of === and !==
110+
"eqeqeq": [1, "allow-null"], // require the use of === and !==
85111
"guard-for-in": 0, // make sure for-in loops have an if statement (off by default)
86112
"no-alert": 1, // disallow the use of alert, confirm, and prompt
87113
"no-caller": 1, // disallow use of arguments.caller or arguments.callee
88114
"no-div-regex": 1, // disallow division operators explicitly at beginning of regular expression (off by default)
89115
"no-else-return": 0, // disallow else after a return in an if (off by default)
90-
"no-empty-label": 1, // disallow use of labels for anything other then loops and switches
91116
"no-eq-null": 0, // disallow comparisons to null without a type-checking operator (off by default)
92117
"no-eval": 1, // disallow use of eval()
93118
"no-extend-native": 1, // disallow adding to native types
@@ -156,6 +181,8 @@
156181
// These rules are purely matters of style and are quite subjective.
157182

158183
"key-spacing": 0,
184+
"keyword-spacing": 1, // enforce spacing before and after keywords
185+
"jsx-quotes": [1, "prefer-double"],
159186
"comma-spacing": 0,
160187
"no-multi-spaces": 0,
161188
"brace-style": 0, // enforce one true brace style (off by default)
@@ -179,11 +206,9 @@
179206
"quote-props": 0, // require quotes around object literal property names (off by default)
180207
"semi": 1, // require or disallow use of semicolons instead of ASI
181208
"sort-vars": 0, // sort variables within the same declaration block (off by default)
182-
"space-after-keywords": 1, // require a space after certain keywords (off by default)
183209
"space-in-brackets": 0, // require or disallow spaces inside brackets (off by default)
184210
"space-in-parens": 0, // require or disallow spaces inside parentheses (off by default)
185211
"space-infix-ops": 1, // require spaces around operators
186-
"space-return-throw-case": 1, // require a space after return, throw, and case
187212
"space-unary-ops": [1, { "words": true, "nonwords": false }], // require or disallow spaces before/after unary operators (words on by default, nonwords off by default)
188213
"max-nested-callbacks": 0, // specify the maximum depth callbacks can be nested (off by default)
189214
"one-var": 0, // allow just one var statement per function (off by default)
@@ -201,7 +226,6 @@
201226

202227
"react/display-name": 0,
203228
"react/jsx-boolean-value": 0,
204-
"react/jsx-quotes": [1, "double", "avoid-escape"],
205229
"react/jsx-no-undef": 1,
206230
"react/jsx-sort-props": 0,
207231
"react/jsx-uses-react": 0,

.flowconfig

Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,6 @@
1111
# Examples
1212
.*/Examples/SimpleChatClient/*.*
1313

14-
# Ignore react-tools where there are overlaps, but don't ignore anything that
15-
# react-native relies on
16-
.*/node_modules/react-tools/src/React.js
17-
.*/node_modules/react-tools/src/renderers/shared/event/EventPropagators.js
18-
.*/node_modules/react-tools/src/renderers/shared/event/eventPlugins/ResponderEventPlugin.js
19-
.*/node_modules/react-tools/src/shared/vendor/core/ExecutionEnvironment.js
20-
2114
# Ugh
2215
.*/node_modules/babel.*
2316
.*/node_modules/babylon.*
@@ -26,11 +19,9 @@
2619
# Ignore react and fbjs where there are overlaps, but don't ignore
2720
# anything that react-native relies on
2821
.*/node_modules/fbjs/lib/Map.js
29-
.*/node_modules/fbjs/lib/Promise.js
3022
.*/node_modules/fbjs/lib/fetch.js
31-
#.*/node_modules/fbjs/lib/ExecutionEnvironment.js
32-
.*/node_modules/fbjs/lib/isEmpty.js
33-
.*/node_modules/fbjs/lib/crc32.js
23+
.*/node_modules/fbjs/lib/fetchWithRetries.js
24+
.*/node_modules/fbjs/lib/ExecutionEnvironment.js
3425
.*/node_modules/fbjs/lib/ErrorUtils.js
3526

3627
# Flow has a built-in definition for the 'react' module which we prefer to use
@@ -39,6 +30,11 @@
3930
.*/node_modules/react/lib/React.js
4031
.*/node_modules/react/lib/ReactDOM.js
4132

33+
.*/__mocks__/.*
34+
.*/__tests__/.*
35+
36+
.*/commoner/test/source/widget/share.js
37+
4238
# Ignore commoner tests
4339
.*/node_modules/commoner/test/.*
4440

@@ -51,26 +47,47 @@
5147
# Ignore Website
5248
.*/website/.*
5349

50+
.*/node_modules/is-my-json-valid/test/.*\.json
51+
.*/node_modules/iconv-lite/encodings/tables/.*\.json
52+
.*/node_modules/y18n/test/.*\.json
53+
.*/node_modules/spdx-license-ids/spdx-license-ids.json
54+
.*/node_modules/spdx-exceptions/index.json
55+
.*/node_modules/resolve/test/subdirs/node_modules/a/b/c/x.json
56+
.*/node_modules/resolve/lib/core.json
57+
.*/node_modules/jsonparse/samplejson/.*\.json
58+
.*/node_modules/json5/test/.*\.json
59+
.*/node_modules/ua-parser-js/test/.*\.json
60+
.*/node_modules/builtin-modules/builtin-modules.json
61+
.*/node_modules/binary-extensions/binary-extensions.json
62+
.*/node_modules/url-regex/tlds.json
63+
.*/node_modules/joi/.*\.json
64+
.*/build/.*\.json
65+
.*/\.buckd/.*
66+
5467
[include]
5568

5669
[libs]
5770
Libraries/react-native/react-native-interface.js
71+
flow/
5872

5973
[options]
6074
module.system=haste
6175

76+
esproposal.class_static_fields=enable
77+
esproposal.class_instance_fields=enable
78+
6279
munge_underscores=true
6380

6481
module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub'
65-
module.name_mapper='^[./a-zA-Z0-9$_-]+\.png$' -> 'RelativeImageStub'
82+
module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\)$' -> 'RelativeImageStub'
6683

6784
suppress_type=$FlowIssue
6885
suppress_type=$FlowFixMe
6986
suppress_type=$FixMe
7087

71-
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(2[0-0]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
72-
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(2[0-0]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
88+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(2[0-2]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
89+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(2[0-2]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
7390
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
7491

7592
[version]
76-
0.21.0
93+
0.22.1

.travis.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ language: objective-c
33
osx_image: xcode7.2
44

55
cache:
6-
directories:
7-
- node_modules
8-
- .nvm
6+
directories:
7+
- node_modules
8+
- .nvm
99

1010
before_install:
1111
- brew update || brew update
@@ -19,7 +19,7 @@ install:
1919
- nvm install 5
2020
- rm -Rf "${TMPDIR}/jest_preprocess_cache"
2121
- npm config set spin=false
22-
- npm install -g flow-bin@`node -p "require('fs').readFileSync('.flowconfig', 'utf8').split('[version]')[1].trim()"`
22+
- npm config set progress=false
2323
- npm install
2424
- node --version
2525
- npm --version
@@ -34,10 +34,8 @@ script:
3434
3535
elif [ "$TEST_TYPE" = js ]
3636
then
37-
3837
flow check && npm test
39-
40-
elif [ "$TEST_TYPE" = e2e ]
38+
elif [ "$TEST_TYPE" = e2e-objc ]
4139
then
4240
./scripts/e2e-test.sh
4341
else
@@ -49,10 +47,12 @@ env:
4947
matrix:
5048
- TEST_TYPE=objc
5149
- TEST_TYPE=js
52-
# - TEST_TYPE=e2e
5350
global:
51+
#- TEST_TYPE=e2e-objc
52+
5453

5554
branches:
5655
only:
5756
- master
5857
- /^.*-stable$/
58+

CONTRIBUTING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The core team will be monitoring for pull requests. When we get one, we'll run s
1717
*Before* submitting a pull request, please make sure the following is done…
1818

1919
1. Fork the repo and create your branch from `master`.
20-
2. If you've added code that should be tested, add tests!
20+
2. **Describe your test plan in your commit.** If you've added code that should be tested, add tests!
2121
3. If you've changed APIs, update the documentation.
2222
4. Add the copyright notice to the top of any new files you've added.
2323
5. Ensure tests pass on Travis and Circle CI.
@@ -73,6 +73,7 @@ Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe
7373

7474
#### General
7575

76+
* **Most important: Look around.** Match the style you see used in the rest of the project. This includes formatting, naming things in code, naming things in documentation.
7677
* Add trailing commas,
7778
* 2 spaces for indentation (no tabs)
7879
* "Attractive"

Examples/.eslintrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"rules": {
3+
"no-alert": 0
4+
}
5+
}

Examples/UIExplorer/AnimatedExample.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ exports.examples = [
3939
'mounts.',
4040
render: function() {
4141
class FadeInView extends React.Component {
42+
state: any;
43+
4244
constructor(props) {
4345
super(props);
4446
this.state = {
@@ -66,6 +68,8 @@ exports.examples = [
6668
}
6769
}
6870
class FadeInExample extends React.Component {
71+
state: any;
72+
6973
constructor(props) {
7074
super(props);
7175
this.state = {

0 commit comments

Comments
 (0)