Skip to content

Commit

Permalink
Merge branch 'master' of github.com:facebook/react-native
Browse files Browse the repository at this point in the history
  • Loading branch information
Swaagie committed Apr 3, 2017
2 parents acdefe2 + cc2ec6f commit 53cd593
Show file tree
Hide file tree
Showing 772 changed files with 18,304 additions and 32,073 deletions.
11 changes: 8 additions & 3 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
.*/Libraries/react-native/React.js
.*/Libraries/react-native/ReactNative.js

; Ignore duplicate ReactErrorUtils in react-dom/lib in React 16 alpha 4.
; TODO (bvaughn) Remove this once we've synced to React 16 alpha 5.
; For more info see https://phabricator.intern.facebook.com/D4747529#10
<PROJECT_ROOT>/node_modules/react-dom/lib/ReactErrorUtils.js

[include]

[libs]
Expand All @@ -41,12 +46,12 @@ suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FixMe

suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(4[0-1]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native_oss[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(4[0-1]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native_oss[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(4[0-2]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native_oss[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(4[0-2]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native_oss[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError

unsafe.enable_getters_and_setters=true

[version]
^0.41.0
^0.42.0
20 changes: 10 additions & 10 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
Please read the following carefully before opening a new issue.
Your issue may be closed if it does not provide the information required by this template.

We use GitHub Issues for tracking bugs in React Native.

- If you have a non-bug question, ask on Stack Overflow: http://stackoverflow.com/questions/tagged/react-native
- If you have a question, ask on Stack Overflow: http://stackoverflow.com/questions/tagged/react-native
- If you have a feature request, post it on Canny: https://react-native.canny.io/feature-requests

Your issue may be closed without explanation if it does not provide the information required by this template.

--- Please use this template, and delete everything above this line before submitting your issue ---
--- Delete everything above this line ---

### Description

[FILL THIS OUT: Explain what you did, what you expected to happen, and what actually happens.]
Explain what you did, what you expected to happen, and what actually happens.

### Reproduction
### Reproduction Steps and Sample Code

[FILL THIS OUT: Try to reproduce your bug on rnplay.org and provide a link. If you can't reproduce the bug on rnplay.org, provide a sample project.]
Try to reproduce your bug on https://sketch.expo.io/ and provide a link.
If you can't reproduce the bug on Sketch, provide a sample project. At the very least, provide an example of your code.

### Solution

[FILL THIS OUT: What needs to be done to address this issue? Ideally, provide a pull request with a fix.]
What needs to be done to address this issue? Ideally, provide a pull request with a fix.

### Additional Information

* React Native version: [FILL THIS OUT: Does the bug reproduce on the latest RN release?]
* React Native version: [FILL THIS OUT: Be specific, filling out "latest" here is not enough.]
* Platform: [FILL THIS OUT: iOS, Android, or both?]
* Operating System: [FILL THIS OUT: MacOS, Linux, or Windows?]
* Development Operating System: [FILL THIS OUT: Are you developing on MacOS, Linux, or Windows?]
* Dev tools: [FILL THIS OUT: Xcode or Android Studio version, iOS or Android SDK version, if applicable]
33 changes: 23 additions & 10 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,32 @@
Thanks for submitting a pull request! Please provide enough information so that others can review your pull request:
Thanks for submitting a PR! Please read these instructions carefully:

> **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.**
- [ ] Explain the **motivation** for making this change.
- [ ] Provide a **test plan** demonstrating that the code is solid.
- [ ] Match the **code formatting** of the rest of the codebase.
- [ ] Target the `master` branch, NOT a "stable" branch.

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

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.
What existing problem does the pull request solve?

**Test plan (required)**
## Test Plan (required)

Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI.
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.

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

**Code formatting**
## Next Steps

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).
Sign the [CLA][2], if you haven't already.

For more info, see the ["Pull Requests" section of our "Contributing" guidelines](https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#pull-requests).
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.

Make sure all **tests pass** on both [Travis][3] and [Circle CI][4]. PRs that break tests are unlikely to be merged.

For more info, see the ["Pull Requests"][5] section of our "Contributing" guidelines.

[1]: https://medium.com/@martinkonicek/what-is-a-test-plan-8bfc840ec171#.y9lcuqqi9
[2]: https://code.facebook.com/cla
[3]: https://travis-ci.org/facebook/react-native
[4]: http://circleci.com/gh/facebook/react-native
[5]: https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#pull-requests
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,5 @@ node_modules
/ReactAndroid/src/androidTest/assets/AndroidTestBundle.js
*.js.meta

/coverage
/third-party
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ install:
- $yarn install

script:
- if [[ "$TEST_TYPE" = objc-ios ]]; then travis_retry travis_wait ./scripts/objc-test-ios.sh; fi
- if [[ "$TEST_TYPE" = objc-ios ]]; then travis_retry travis_wait ./scripts/objc-test-ios.sh test; fi
- if [[ "$TEST_TYPE" = objc-tvos ]]; then travis_retry travis_wait ./scripts/objc-test-tvos.sh; fi
- if [[ "$TEST_TYPE" = e2e-objc ]]; then node ./scripts/run-ci-e2e-tests.js --ios --js --retries 3; fi
- if [[ ( "$TEST_TYPE" = podspecs ) && ( "$TRAVIS_PULL_REQUEST" = "false" ) ]]; then gem install cocoapods && ./scripts/process-podspecs.sh; fi
Expand Down
45 changes: 23 additions & 22 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,30 @@ We will do our best to keep `master` in good shape, with tests passing at all ti

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.

**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.
**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.

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

1. Fork the repo and create your branch from `master`.
2. **Describe your test plan in your commit.** If you've added code that should be tested, add tests!
3. If you've changed APIs, update the documentation.
4. If you've updated the docs, verify the website locally and submit screenshots if applicable.

```
$ cd website
$ npm install && npm start
go to: http://localhost:8079/react-native/index.html
```
5. Add the copyright notice to the top of any new files you've added.
6. Ensure tests pass on Travis and Circle CI.
7. Make sure your code lints (`node linter.js <files touched>`).
8. If you haven't already, sign the [CLA](https://code.facebook.com/cla).
9. Squash your commits (`git rebase -i`).
one intent alongs with one commit makes it clearer for people to review and easier to understand your intention
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.
2. **Describe your test plan in your commit.**
- If you've added code that should be tested, add tests!
- If you've changed APIs, update the documentation.
- If you've updated the docs, verify the website locally and submit screenshots if applicable.

```
$ cd website
$ npm install && npm start
Open the following in your browser: http://localhost:8079/react-native/index.html
```

3. Add the copyright notice to the top of any new files you've added.
4. Ensure tests pass on Travis and Circle CI.
5. Make sure your code lints (`node linter.js <files touched>`).
6. If you haven't already, sign the [CLA](https://code.facebook.com/cla).
7. Squash your commits (`git rebase -i`).
One intent alongside one commit makes it clearer for people to review and easier to understand your intention.

> **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.
#### Copyright Notice for files

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

### Reporting New Issues

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.
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/).

### Security Bugs

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.

## How to Get in Touch

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

## Style Guide

Expand Down
2 changes: 1 addition & 1 deletion ContainerShip/Dockerfile.android
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ ADD build.gradle /app/build.gradle
ADD react.gradle /app/react.gradle

# run gradle downloads
RUN ./gradlew :ReactAndroid:downloadBoost :ReactAndroid:downloadDoubleConversion :ReactAndroid:downloadFolly :ReactAndroid:downloadGlog
RUN ./gradlew :ReactAndroid:downloadBoost :ReactAndroid:downloadDoubleConversion :ReactAndroid:downloadFolly :ReactAndroid:downloadGlog :ReactAndroid:downloadJSCHeaders

# compile native libs with Gradle script, we need bridge for unit and integration tests
RUN ./gradlew :ReactAndroid:packageReactNdkLibsForBuck -Pjobs=1 -Pcom.android.build.threadPoolSize=1
Expand Down
41 changes: 29 additions & 12 deletions ContainerShip/Dockerfile.android-base
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM library/ubuntu:16.04

# set default build arguments
ARG ANDROID_VERSION=25.2.3
ARG BUCK_VERSION=2016.11.11.01
ARG BUCK_VERSION=f3452a6a7ab15a60e94c962e686293acbe677473
ARG NDK_VERSION=10e
ARG NODE_VERSION=6.2.0
ARG WATCHMAN_VERSION=4.7.0
Expand Down Expand Up @@ -30,7 +30,7 @@ RUN n $NODE_VERSION
# download buck
RUN git clone https://github.com/facebook/buck.git /opt/buck
WORKDIR /opt/buck
RUN git checkout v$BUCK_VERSION
RUN git checkout $BUCK_VERSION

# build buck
RUN ant
Expand Down Expand Up @@ -62,16 +62,33 @@ RUN unzip ndk.zip
# cleanup NDK
RUN rm ndk.zip

# add android SDK tools
# 2 - Android SDK Platform-tools, revision 25.0.3
# 12 - Android SDK Build-tools, revision 23.0.1
# 35 - SDK Platform Android 6.0, API 23, revision 3
# 39 - SDK Platform Android 4.4.2, API 19, revision 4
# 102 - ARM EABI v7a System Image, Android API 19, revision 5
# 103 - Intel x86 Atom System Image, Android API 19, revision 5
# 131 - Google APIs, Android API 23, revision 1
# 166 - Android Support Repository, revision 41
RUN echo "y" | android update sdk -u -a -t 2,12,35,39,102,103,131,166
# Add android SDK tools

# Android SDK Platform-tools, revision 25.0.4
RUN echo "y" | android update sdk -u -a -t $(android list sdk -a | grep "Android SDK Platform-tools, revision 25.0.4" | awk '{ print $1 }' | sed 's/.$//')

# Android SDK Build-tools, revision 23.0.1
RUN echo "y" | android update sdk -u -a -t $(android list sdk -a | grep "Android SDK Build-tools, revision 23.0.1" | awk '{ print $1 }' | sed 's/.$//')

# SDK Platform Android 6.0, API 23, revision 3
RUN echo "y" | android update sdk -u -a -t $(android list sdk -a | grep "SDK Platform Android 6.0, API 23" | awk '{ print $1 }' | sed 's/.$//')

# SDK Platform Android 4.4.2, API 19, revision 4
RUN echo "y" | android update sdk -u -a -t $(android list sdk -a | grep "SDK Platform Android 4.4.2, API 19, revision 4" | awk '{ print $1 }' | sed 's/.$//')

# ARM EABI v7a System Image, Android API 19, revision 5
RUN echo "y" | android update sdk -u -a -t $(android list sdk -a | grep "ARM EABI v7a System Image, Android API 19, revision 5" | awk '{ print $1 }' | sed 's/.$//')

# Intel x86 Atom System Image, Android API 19, revision 5
RUN echo "y" | android update sdk -u -a -t $(android list sdk -a | grep "Intel x86 Atom System Image, Android API 19, revision 5" | awk '{ print $1 }' | sed 's/.$//')

# Google APIs, Android API 23, revision 1
RUN echo "y" | android update sdk -u -a -t $(android list sdk -a | grep "Google APIs, Android API 23, revision 1" | awk '{ print $1 }' | sed 's/.$//')

# Android Support Repository, revision 45
RUN echo "y" | android update sdk -u -a -t $(android list sdk -a | grep "Android Support Repository, revision 45" | awk '{ print $1 }' | sed 's/.$//')

# Link adb executable
RUN ln -s /opt/android/platform-tools/adb /usr/bin/adb

# clean up unnecessary directories
Expand Down
10 changes: 9 additions & 1 deletion ContainerShip/scripts/run-android-ci-instrumentation-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ const child_process = require('child_process');
const fs = require('fs');
const path = require('path');

// Flaky tests ignored on Circle CI. They still run internally at fb.
const ignoredTests = [
'ReactScrollViewTestCase',
'ReactHorizontalScrollViewTestCase'
];

const colors = {
GREEN: '\x1b[32m',
RED: '\x1b[31m',
Expand All @@ -53,6 +59,8 @@ let testClasses = fs.readdirSync(path.resolve(process.cwd(), test_opts.PATH))
return file.endsWith('.java');
}).map((clazz) => {
return path.basename(clazz, '.java');
}).filter(className => {
return ignoredTests.indexOf(className) === -1;
}).map((clazz) => {
return test_opts.PACKAGE + '.' + clazz;
}).filter((clazz) => {
Expand Down Expand Up @@ -112,7 +120,7 @@ return async.mapSeries(testClasses, (clazz, callback) => {
print_test_suite_results(results);

const failures = results.filter((test) => {
test.status === 'failure';
return test.status === 'failure';
});

return failures.length === 0 ? process.exit(0) : process.exit(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ watchman shutdown-server
node local-cli/cli.js bundle --platform android --dev true --entry-file ReactAndroid/src/androidTest/js/TestBundle.js --bundle-output ReactAndroid/src/androidTest/assets/AndroidTestBundle.js

# build test APK
buck install ReactAndroid/src/androidTest/buck-runner:instrumentation-tests --config build.threads=1
source ./scripts/circle-ci-android-setup.sh && NO_BUCKD=1 retry3 buck install ReactAndroid/src/androidTest/buck-runner:instrumentation-tests --config build.threads=1

# run installed apk with tests
node ./ContainerShip/scripts/run-android-ci-instrumentation-tests.js $*
exit $?
2 changes: 1 addition & 1 deletion ContainerShip/scripts/run-ci-e2e-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ RUN_CLI_INSTALL=1
RUN_IOS=0
RUN_JS=0

RETRY_COUNT=${RETRY_COUNT:-3}
RETRY_COUNT=${RETRY_COUNT:-1}
AVD_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 8 | head -n 1)

ANDROID_NPM_DEPS="appium@1.5.1 mocha@2.4.5 wd@0.3.11 colors@1.0.3 pretty-data2@0.40.1"
Expand Down
Loading

0 comments on commit 53cd593

Please sign in to comment.