Skip to content

Commit caa074b

Browse files
authored
Merge pull request #163 from ptmt/merge-0.44.0
Merge with upstream / React Native 0.44.0
2 parents e4290f7 + 9cbfad5 commit caa074b

File tree

2,764 files changed

+184131
-83663
lines changed

Some content is hidden

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

2,764 files changed

+184131
-83663
lines changed

.editorconfig

+3
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@ end_of_line = lf
99
insert_final_newline = true
1010
indent_style = space
1111
indent_size = 2
12+
13+
[*.gradle]
14+
indent_size = 4

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
**/staticBundle.js
44
**/main.js
55
Libraries/vendor/**/*
6+
packager/src/worker-farm/**/*

.eslintrc

+7-2
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
"SyntheticEvent": false,
6262
"$Either": false,
6363
"$All": false,
64+
"$ArrayBufferView": false,
6465
"$Tuple": false,
6566
"$Supertype": false,
6667
"$Subtype": false,
@@ -78,6 +79,7 @@
7879
"comma-dangle": 0, // disallow trailing commas in object literals
7980
"no-cond-assign": 1, // disallow assignment in conditional expressions
8081
"no-console": 0, // disallow use of console (off by default in the node environment)
82+
"no-const-assign": 2, // disallow assignment to const-declared variables
8183
"no-constant-condition": 0, // disallow use of constant expressions in conditions
8284
"no-control-regex": 1, // disallow control characters in regular expressions
8385
"no-debugger": 1, // disallow use of debugger
@@ -221,15 +223,18 @@
221223
"no-bitwise": 1, // disallow use of bitwise operators (off by default)
222224
"no-plusplus": 0, // disallow use of unary operators, ++ and -- (off by default)
223225

226+
// React Plugin
227+
// The following rules are made available via `eslint-plugin-react`.
228+
224229
"react/display-name": 0,
225230
"react/jsx-boolean-value": 0,
226231
"react/jsx-no-duplicate-props": 2,
227232
"react/jsx-no-undef": 1,
228233
"react/jsx-sort-props": 0,
229234
"react/jsx-uses-react": 1,
230235
"react/jsx-uses-vars": 1,
231-
"react/no-did-mount-set-state": [1, "allow-in-func"],
232-
"react/no-did-update-set-state": [1, "allow-in-func"],
236+
"react/no-did-mount-set-state": 1,
237+
"react/no-did-update-set-state": 1,
233238
"react/no-multi-comp": 0,
234239
"react/no-string-refs": 1,
235240
"react/no-unknown-property": 0,

.flowconfig

+18-23
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,25 @@
11
[ignore]
2+
; We fork some components by platform
3+
.*/*[.]android.js
4+
.*/*[.]ios.js
25

3-
# We fork some components by platform.
4-
.*/*.android.js
5-
.*/*.ios.js
6+
; Ignore templates for 'react-native init'
7+
.*/local-cli/templates/.*
68

7-
# Ignore templates with `@flow` in header
8-
.*/local-cli/generator.*
9-
10-
# Ignore malformed json
11-
.*/node_modules/y18n/test/.*\.json
12-
13-
# Ignore the website subdir
9+
; Ignore the website subdir
1410
<PROJECT_ROOT>/website/.*
1511

16-
# Ignore BUCK generated dirs
12+
; Ignore "BUCK" generated dirs
1713
<PROJECT_ROOT>/\.buckd/
1814

19-
# Ignore unexpected extra @providesModule
20-
.*/node_modules/commoner/test/source/widget/share.js
15+
; Ignore unexpected extra "@providesModule"
16+
.*/node_modules/.*/node_modules/fbjs/.*
2117

22-
# Ignore duplicate module providers
23-
# For RN Apps installed via npm, "Libraries" folder is inside node_modules/react-native but in the source repo it is in the root
18+
; Ignore duplicate module providers
19+
; For RN Apps installed via npm, "Libraries" folder is inside
20+
; "node_modules/react-native" but in the source repo it is in the root
2421
.*/Libraries/react-native/React.js
2522
.*/Libraries/react-native/ReactNative.js
26-
.*/node_modules/jest-runtime/build/__tests__/.*
2723

2824
[include]
2925

@@ -32,28 +28,27 @@ Libraries/react-native/react-native-interface.js
3228
flow/
3329

3430
[options]
35-
module.system=haste
31+
emoji=true
3632

37-
esproposal.class_static_fields=enable
38-
esproposal.class_instance_fields=enable
33+
module.system=haste
3934

4035
experimental.strict_type_args=true
4136

4237
munge_underscores=true
4338

44-
module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub'
4539
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\|pdf\)$' -> 'RelativeImageStub'
4640
module.name_mapper='react-native' -> 'react-native-macos'
4741

4842
suppress_type=$FlowIssue
4943
suppress_type=$FlowFixMe
5044
suppress_type=$FixMe
5145

52-
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(30\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
53-
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(30\\|1[0-9]\\|[1-2][0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
46+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(4[0-5]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native_oss[a-z,_]*\\)?)\\)
47+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(4[0-5]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native_oss[a-z,_]*\\)?)\\)?:? #[0-9]+
5448
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
49+
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
5550

5651
unsafe.enable_getters_and_setters=true
5752

5853
[version]
59-
^0.35.0
54+
^0.45.0

.github/ISSUE_TEMPLATE.md

+29-14
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,36 @@
1-
Hey there and thank you for using React Native!
1+
Please read the following carefully before opening a new issue.
2+
Your issue may be closed if it does not provide the information required by this template.
23

3-
React Native, as you've probably heard, is getting really popular and truth is we're getting a bit overwhelmed by the activity surrounding it. There are just too many issues for us to manage properly.
4+
We use GitHub Issues exclusively for tracking bugs in React Native.
45

5-
Do the checklist before filing an issue:
6+
- If you have a question, ask on Stack Overflow: http://stackoverflow.com/questions/tagged/react-native
7+
- If you have a feature request, post it on Canny: https://react-native.canny.io/feature-requests
68

7-
- [ ] Is this something you can **debug and fix**? Send a pull request! Bug fixes and documentation fixes are welcome.
8-
- [ ] Have a usage question? Ask your question on [StackOverflow](http://stackoverflow.com/questions/tagged/react-native). We use StackOverflow for usage question and GitHub for bugs.
9-
- [ ] Have an idea for a feature? Post the feature request on [Product Pains](https://productpains.com/product/react-native/). It has a voting system to surface the important issues. GitHub issues should only be used for bugs.
9+
Make sure your issue reproduces on master. Your issue may already have been fixed!
10+
If your issue is present in master and in the stable release, try to reproduce your bug on https://snack.expo.io/
11+
If you can't reproduce the bug on Snack, provide a sample project.
12+
At the very least, provide an example of your code.
1013

14+
--- Delete everything above this line ---
1115

12-
None of the above, create a bug report
13-
------------------------------------------------------------------
16+
### Description
1417

15-
Make sure to add **all the information needed to understand the bug** so that someone can help. If the info is missing we'll add the 'Needs more information' label and close the issue until there is enough information.
18+
Explain what you did, what you expected to happen, and what actually happens.
1619

17-
- [ ] Provide a **minimal code snippet** / [rnplay](https://rnplay.org/) example that reproduces the bug.
18-
- [ ] Provide **screenshots** where appropriate
19-
- [ ] What's the **version** of React Native you're using?
20-
- [ ] Does this occur on iOS, Android or both?
21-
- [ ] Are you using Mac, Linux or Windows?
20+
### Reproduction Steps and Sample Code
21+
22+
List all the steps required to reproduce the issue you're reporting. These steps should be clear and concise.
23+
24+
***An example of your code is REQUIRED***
25+
26+
27+
### Solution
28+
29+
What needs to be done to address this issue? Ideally, provide a pull request with a fix.
30+
31+
### Additional Information
32+
33+
* React Native version: [FILL THIS OUT: Be specific, filling out "latest" here is not enough.]
34+
* Platform: [FILL THIS OUT: iOS, Android, or both?]
35+
* Development Operating System: [FILL THIS OUT: Are you developing on MacOS, Linux, or Windows?]
36+
* Dev tools: [FILL THIS OUT: Xcode or Android Studio version, iOS or Android SDK version, if applicable]

.github/PULL_REQUEST_TEMPLATE.md

+23-10
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,32 @@
1-
Thanks for submitting a pull request! Please provide enough information so that others can review your pull request:
1+
Thanks for submitting a PR! Please read these instructions carefully:
22

3-
> **Unless you are a React Native release maintainer and cherry-picking an *existing* commit into a current release, ensure your pull request is targeting the `master` React Native branch.**
3+
- [ ] Explain the **motivation** for making this change.
4+
- [ ] Provide a **test plan** demonstrating that the code is solid.
5+
- [ ] Match the **code formatting** of the rest of the codebase.
6+
- [ ] Target the `master` branch, NOT a "stable" branch.
47

5-
Explain the **motivation** for making this change. What existing problem does the pull request solve?
8+
## Motivation (required)
69

7-
Prefer **small pull requests**. These are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it.
10+
What existing problem does the pull request solve?
811

9-
**Test plan (required)**
12+
## Test Plan (required)
1013

11-
Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI.
14+
A good test plan has the exact commands you ran and their output, provides screenshots or videos if the pull request changes UI or updates the website. See [What is a Test Plan?][1] to learn more.
1215

13-
Make sure tests pass on both Travis and Circle CI.
16+
If you have added code that should be tested, add tests.
1417

15-
**Code formatting**
18+
## Next Steps
1619

17-
Look around. Match the style of the rest of the codebase. See also the simple [style guide](https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#style-guide).
20+
Sign the [CLA][2], if you haven't already.
1821

19-
For more info, see the ["Pull Requests" section of our "Contributing" guidelines](https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#pull-requests).
22+
Small pull requests are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it.
23+
24+
Make sure all **tests pass** on both [Travis][3] and [Circle CI][4]. PRs that break tests are unlikely to be merged.
25+
26+
For more info, see the ["Pull Requests"][5] section of our "Contributing" guidelines.
27+
28+
[1]: https://medium.com/@martinkonicek/what-is-a-test-plan-8bfc840ec171#.y9lcuqqi9
29+
[2]: https://code.facebook.com/cla
30+
[3]: https://travis-ci.org/facebook/react-native
31+
[4]: http://circleci.com/gh/facebook/react-native
32+
[5]: https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#pull-requests

.gitignore

+12-2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@ project.xcworkspace
2929
/Examples/**/android/app/gradlew.bat
3030
/ReactAndroid/build/
3131

32+
# Buck
33+
.buckd
34+
buck-out
35+
/ReactAndroid/src/main/jni/prebuilt/lib/armeabi-v7a/
36+
/ReactAndroid/src/main/jni/prebuilt/lib/x86/
37+
/ReactAndroid/src/main/gen
38+
3239
# Android
3340
.idea
3441
.gradle
@@ -41,10 +48,13 @@ node_modules
4148
*.log
4249
.nvm
4350

44-
rn-cli.config.js
45-
4651
# OS X
4752
.DS_Store
53+
*.tgz
4854

4955
# Test generated files
5056
/ReactAndroid/src/androidTest/assets/AndroidTestBundle.js
57+
*.js.meta
58+
59+
/coverage
60+
/third-party

.npmignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# rnpm
22
/local-cli/rnpm
3+
/local-cli/server/middleware/heapCapture/bundle.js

.travis.yml

+19-33
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,37 @@
11
language: objective-c
22

3-
matrix:
4-
include:
5-
- os: osx
6-
osx_image: xcode8.2
7-
env:
8-
- TEST_TYPE=objc
9-
- SDK_TO_TEST='macosx10.12'
10-
- os: osx
11-
osx_image: xcode7.3
12-
env:
13-
- TEST_TYPE=objc
14-
- SDK_TO_TEST='macosx10.11'
15-
- os: osx
16-
osx_image: xcode6.4
17-
env:
18-
- TEST_TYPE=objc
19-
- SDK_TO_TEST='macosx10.10'
20-
- os: osx
21-
osx_image: xcode6.4
22-
env:
23-
- TEST_TYPE=objc
24-
- SDK_TO_TEST='macosx10.9'
25-
- os: osx
26-
env: TEST_TYPE=js
3+
osx_image: xcode8.2
274

285
install:
296
- mkdir -p /Users/travis/build/facebook/.nvm
307
- export NVM_DIR="/Users/travis/build/facebook/.nvm"
318
- brew install nvm
329
- source $(brew --prefix nvm)/nvm.sh
33-
# TODO npm 2 started stalling on Travis, t11852928
10+
11+
# Use node 6 because that is what runs on land-blocking tests
3412
- nvm install 6
3513
- rm -Rf "${TMPDIR}/jest_preprocess_cache"
36-
- npm config set spin=false
37-
- npm config set progress=false
38-
- travis_wait npm install
39-
- node --version
40-
- npm --version
14+
- wget https://github.com/yarnpkg/yarn/releases/download/v0.16.0/yarn-0.16.0.js
15+
- export yarn="node $(pwd)/yarn-0.16.0.js"
16+
- $yarn install
4117

4218
script:
43-
- if [[ "$TEST_TYPE" = objc ]]; then travis_retry travis_wait ./scripts/objc-test.sh; fi
19+
- if [[ "$TEST_TYPE" = objc-macos ]]; then travis_retry travis_wait ./scripts/objc-test-macos.sh test; fi
4420
- if [[ "$TEST_TYPE" = e2e-objc ]]; then node ./scripts/run-ci-e2e-tests.js --macos --js --retries 3; fi
45-
- if [[ "$TEST_TYPE" = js ]]; then npm run flow check; fi
46-
- if [[ "$TEST_TYPE" = js ]]; then npm test -- --maxWorkers=1; fi
21+
- if [[ ( "$TEST_TYPE" = podspecs ) && ( "$TRAVIS_PULL_REQUEST" = "false" ) ]]; then gem install cocoapods && ./scripts/process-podspecs.sh; fi
22+
23+
24+
matrix:
25+
- fast_finish: true # Fail the whole build as soon as one test type fails. Should help with Travis capacity issues (very long queues).
26+
27+
# The order of these tests says which are more likely to run first and fail the whole build fast.
28+
env:
29+
- TEST_TYPE=objc-macos
30+
- TEST_TYPE=podspecs
31+
- TEST_TYPE=e2e-objc
4732

4833
branches:
4934
only:
5035
- master
5136
- /^.*-stable$/
37+
- /^merge-.*$/

CONTRIBUTING.md

+23-22
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,30 @@ We will do our best to keep `master` in good shape, with tests passing at all ti
1414

1515
The core team will be monitoring for pull requests. When we get one, we'll run some Facebook-specific integration tests on it first. From here, we'll need to get another person to sign off on the changes and then merge the pull request. For API changes we may need to fix internal uses, which could cause some delay. We'll do our best to provide updates and feedback throughout the process.
1616

17-
**Please submit your pull request on the `master` branch**. If the fix is critical and should be included in a stable branch please mention it and it will be cherry picked into it.
17+
**Please submit your pull request on the `master` branch**. If the fix is critical and should be included in a stable branch please mention it and it will be cherry picked into it by a project maintainer.
1818

1919
*Before* submitting a pull request, please make sure the following is done…
2020

2121
1. Fork the repo and create your branch from `master`.
22-
2. **Describe your test plan in your commit.** If you've added code that should be tested, add tests!
23-
3. If you've changed APIs, update the documentation.
24-
4. If you've updated the docs, verify the website locally and submit screenshots if applicable.
25-
26-
```
27-
$ cd website
28-
$ npm install && npm start
29-
go to: http://localhost:8079/react-native/index.html
30-
```
31-
32-
5. Add the copyright notice to the top of any new files you've added.
33-
6. Ensure tests pass on Travis and Circle CI.
34-
7. Make sure your code lints (`node linter.js <files touched>`).
35-
8. If you haven't already, sign the [CLA](https://code.facebook.com/cla).
36-
9. Squash your commits (`git rebase -i`).
37-
one intent alongs with one commit makes it clearer for people to review and easier to understand your intention
38-
39-
Note: It is not necessary to keep clicking `Merge master to your branch` on PR page. You would want to merge master if there are conflicts or tests are failing. The facebook-bot ultimately squashes all commits to a single one before merging your PR.
22+
2. **Describe your test plan in your commit.**
23+
- If you've added code that should be tested, add tests!
24+
- If you've changed APIs, update the documentation.
25+
- If you've updated the docs, verify the website locally and submit screenshots if applicable.
26+
27+
```
28+
$ cd website
29+
$ npm install && npm start
30+
Open the following in your browser: http://localhost:8079/react-native/index.html
31+
```
32+
33+
3. Add the copyright notice to the top of any new files you've added.
34+
4. Ensure tests pass on Travis and Circle CI.
35+
5. Make sure your code lints (`node linter.js <files touched>`).
36+
6. If you haven't already, sign the [CLA](https://code.facebook.com/cla).
37+
7. Squash your commits (`git rebase -i`).
38+
One intent alongside one commit makes it clearer for people to review and easier to understand your intention.
39+
40+
> **Note:** It is not necessary to keep clicking `Merge master to your branch` on the PR page. You would want to merge master if there are conflicts or tests are failing. The Facebook-GitHub-Bot ultimately squashes all commits to a single one before merging your PR.
4041
4142
#### Copyright Notice for files
4243

@@ -69,16 +70,16 @@ We are using GitHub Issues for our public bugs. We keep a close eye on this and
6970

7071
### Reporting New Issues
7172

72-
The best way to get your bug fixed is to provide a reduced test case. Please provide either a public repository with a runnable example or a [React Native Playground](https://rnplay.org/) snippet.
73+
The best way to get your bug fixed is to provide a reduced test case. Please provide either a public repository with a runnable example or a [Sketch](https://sketch.expo.io/).
7374

7475
### Security Bugs
7576

7677
Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe disclosure of security bugs. With that in mind, please do not file public issues; go through the process outlined on that page.
7778

7879
## How to Get in Touch
7980

80-
* [Facebook group](https://www.facebook.com/groups/react.native.community/)
81-
* Reactiflux — [#react-native](http://join.reactiflux.com/)
81+
* [Facebook](https://www.facebook.com/groups/react.native.community/)
82+
* [Twitter](https://www.twitter.com/reactnative)
8283

8384
## Style Guide
8485

0 commit comments

Comments
 (0)