Commit Graph

10209 Commits

Author SHA1 Message Date
Mike Grabowski dcecfa3189 Make CLI executable configurable
Summary:
Follow up to #13248 for iOS.

This pull request allows changing the default path to `cli` when running from Xcode environment. That is especially useful when debugging from a different location or... running `Haul`.

Set `export CLI_PATH=./node_modules/react-native/local-cli/cli.js` and run. Should use new path provided.
Closes https://github.com/facebook/react-native/pull/13264

Differential Revision: D4819059

Pulled By: ericvicenti

fbshipit-source-id: 4a6241823c0bc8f1fa16869bc872bdbe04df510f
2017-04-03 08:45:54 -07:00
Jean Lauliac cc2ec6ff07 packager: TransformCache: use sha1 instead of murmurhash
Reviewed By: davidaurelio

Differential Revision: D4809941

fbshipit-source-id: 33b6c56b4c48eca88d8c1922f52ed29a728d1173
2017-04-03 06:03:17 -07:00
Jean Lauliac 4bd7dc0035 packager: TransformCache: do not rehash transformOptions every single time
Reviewed By: davidaurelio

Differential Revision: D4809963

fbshipit-source-id: 9d3ac907e822596567ee7af4427bcd24f1bac73f
2017-04-03 04:45:00 -07:00
Tim Yung e1466da1eb RN: Options to Preload Bundles on Startup
Reviewed By: achen1

Differential Revision: D4809513

fbshipit-source-id: a9a4196b72b241faf7c788e26b9e6880cecebb3e
2017-04-02 08:46:22 -07:00
Lukas Wöhrl f1371ec24c Don't transfer layout outputs to java for unset edges
Summary:
See facebook/yoga#483. We should not transfer the layout if the layout didn't change. (using ```hasNewLayout```). This also changes that the lock on the java node is only aquired if needed, and it holds the lock only for the time the values are set and not for the time all it's children are set.
Closes https://github.com/facebook/yoga/pull/484

Reviewed By: astreet

Differential Revision: D4802966

Pulled By: emilsjolander

fbshipit-source-id: e8a8f2280ad6b25b98fc68b07eac68e0ec80fe3e
2017-04-01 04:34:17 -07:00
Shruti Malugu edbb48c67a Replacing all instances of [UIApplication sharedApplication] wi…
Summary:
…th RCTSharedApplication()

Thanks for submitting a PR! Please read these instructions carefully:

- [ ] Explain the **motivation** for making this change.
          Using React Native latest version with Cocoapods 1.2.0 causes the following error inside iOS app extensions

> /react-native/React/Modules/RCTAccessibilityManager.m:67:70: ‘sharedApplication’ is unavailable: not available on iOS (App Extension) — Use view controller based solutions where appropriate instead.

Moving the use of [UIApplication sharedApplication] to RCTSharedApplication() which is safe on app extension

- [ ] Provide a **test plan** demonstrating that the code is solid.
        I am not sure how to test such that all the features which touch the modified code are tested.

- [ ] Match the **code formatting** of the rest of the codebase.
- [ ] Target the `master` branch, NOT a "stable" branch.

What existing problem does the pull request solve?
    Using React Native latest v
Closes https://github.com/facebook/react-native/pull/13227

Differential Revision: D4816338

Pulled By: javache

fbshipit-source-id: e3e3c77882990ad1817b0b633521cff52571ecd0
2017-04-01 03:34:41 -07:00
Spencer Ahrens 7ff18f290b Fix Warning/Yellow Box so it does not mess up app layout when opened.
Reviewed By: fkgozali

Differential Revision: D4808601

fbshipit-source-id: c15a7aa4514ea21798ceabca075189478596e0a2
2017-03-31 18:34:21 -07:00
Ben Roth 9075fe0618 Fix crash in `RCTJSStackFrame::stackFrameWithDictionary:`
Summary:
Motivation: When logging to RCTRedBox, if any of the stack frames lacks a line number or a column, the application will crash with `[NSNull integerValue]: unrecognized selector sent to instance`.
Closes https://github.com/facebook/react-native/pull/13242

Differential Revision: D4812185

Pulled By: hramos

fbshipit-source-id: 4b1c3c38f67cf59034a383c95d4280d1b6380300
2017-03-31 13:32:47 -07:00
dlowder-salesforce 92190727d1 Clean up and remove duplicate code in Travis iOS/tvOS test scripts
Summary:
**Motivation**

Remove duplicated lines in objc-test-ios.sh and objc-test-tvos.sh

**Test plan**

Travis CI should continue to work as before.
Closes https://github.com/facebook/react-native/pull/13173

Differential Revision: D4812177

Pulled By: hramos

fbshipit-source-id: 40afe0beab896d741f607f4841df7e9b42f4c17d
2017-03-31 12:46:45 -07:00
Charles Dick 175e77d004 break dependency between JSPackagerClient.RequestHandler and WebSocketListener
Reviewed By: amnn

Differential Revision: D4810406

fbshipit-source-id: a447bc15c6619921edd7adf0b3d1d93ae04e2e43
2017-03-31 11:02:07 -07:00
Viktor Seč ec68c97d72 Add iOS Linking location example to docs
Summary:
Hi, the docs make it seem like `geo:${latitude},${longitude}` is the cross-platform way to link locations on Google/Apple Maps. This is Android-only though.

I did no changes to code.

I noticed that the Appetize.io embed tries to run the [Linking example](https://facebook.github.io/react-native/docs/linking.html) code on iOS, although the example uses Android location scheme. This results in errors. I'd like to fix this as well, but I have no idea how to tell the demo to run on Android.
Closes https://github.com/facebook/react-native/pull/13220

Differential Revision: D4804123

Pulled By: hramos

fbshipit-source-id: 2de85d56476933ec54ea423d76a0fe98ed5132d3
2017-03-31 10:46:55 -07:00
Jean Lauliac 3ef2055ee9 packager: sync Module#read()
Reviewed By: davidaurelio

Differential Revision: D4802783

fbshipit-source-id: c6309bcae6ad48bea2350de04353f694be6eea2f
2017-03-31 10:20:19 -07:00
Hector Ramos 7664c276db Temporarily disable Android instrumentation tests
Summary:
Android instrumentation tests keep failing due to `java.lang.RuntimeException: java.lang.RuntimeException: Timed out waiting for JS thread`.

An [earlier job](https://circleci.com/gh/facebook/react-native/17064) based off commit [c31a65](c31a65669e) finished successfully, yet [this job](https://circleci.com/gh/facebook/react-native/17070), triggered by the very [next commit](e82c2fbbe5), failed Android instrumentation tests even though that commit touches no Android code.

You can see from the [Circle history](https://circleci.com/gh/facebook/react-native/tree/master) that this test has been consistently failing for the same time out reason.

I am disabling Android instrumentation tests as they are not providing any useful signal a this point in time.

Debug and fix instrumentation tests, and re-enable them.
Closes https://github.com/facebook/react-native/pull/13239

Differential Revision: D4810775

Pulled By: hramos

fbshipit-source-id: 8866f9208ec3b5ac5f0ed2f6c2cf58c5b5825830
2017-03-31 10:20:19 -07:00
vivaxy 8e925d578b Update Images.md
Summary:
Remove redundant `\`` mark

Thanks for submitting a PR! Please read these instructions carefully:

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

This PR fixes Documentation typo.

No need for test.
Closes https://github.com/facebook/react-native/pull/13228

Differential Revision: D4810457

Pulled By: hramos

fbshipit-source-id: 5c475a5d8b51d4a926e0fc737e2a12805e3bf70b
2017-03-31 09:06:00 -07:00
Pieter De Baets b133d06057 Disable flaky PropertiesUpdateTest
Reviewed By: AaaChiuuu

Differential Revision: D4810246

fbshipit-source-id: 76b38522eea9332217b515b7ff225c0073381da9
2017-03-31 09:06:00 -07:00
Pieter De Baets e12e57eb77 Move bindKeys to RCTBridge setUp
Reviewed By: shergin

Differential Revision: D4794788

fbshipit-source-id: 0839829f4ed010bf2fb2574092a8f68f4c95341a
2017-03-31 05:31:26 -07:00
Koen Punt 8daf985fc3 match plist indentation with xcode format
Summary:
xcode has its own way of indentation of the plist.

fixes #11668
Closes https://github.com/facebook/react-native/pull/11670

Differential Revision: D4410865

fbshipit-source-id: 8c65e7719d228b07f58b1ccb86b369e319067f02
2017-03-31 03:03:10 -07:00
Kirwan Lyster 01a0e10026 Make SystraceRequestListener extend BaseRequestListener
Summary: Instead of `SystraceRequestListener` implementing `RequestListener`, this diff instead extends the base implementation.

Reviewed By: massimocarli

Differential Revision: D4796679

fbshipit-source-id: 0c9a0b755f4beff69007688962682989e5af72e0
2017-03-31 03:03:06 -07:00
Brent Vatne b80e2c8799 Move packager initialization events to reporter
Summary:
This PR depends on #13172

Packager events are mostly logged through the TerminalReporter by default (#13172 makes this configurable). But there are a few things that aren't passed through TerminalReporter.

- We [log a banner with some information about the port and what's going on](8c7b32d5f1/local-cli/server/server.js (L22-L32))
- Also [a message about looking for JS files](8c7b32d5f1/local-cli/server/server.js (L34-L38)) (not sure what that is for / if it is useful beyond telling the user what directory root they started the packager in, but that's another thing).
- If the packager fails to start, then [we log an error message](8c7b32d5f1/local-cli/server/server.js (L41-L61)).

This pull request changes those log messages to be handled by TerminalReporter. I tri
Closes https://github.com/facebook/react-native/pull/13209

Differential Revision: D4809759

Pulled By: davidaurelio

fbshipit-source-id: 2c427ec0c1accaf54bf6b2d1da882cd6bfaa7829
2017-03-31 02:17:22 -07:00
Marc Horowitz ec4b85467d Allow DeviceInfoModule to be instantiated with only an android Context
Reviewed By: javache

Differential Revision: D4772673

fbshipit-source-id: 80894faa076ccfddf0fe28bd4d7b6aaeba6c38a5
2017-03-31 01:00:52 -07:00
Marc Horowitz 1916b38a65 Support passing a collection of native modules to JSContext
Reviewed By: javache

Differential Revision: D4772649

fbshipit-source-id: dd9353edb0c2c013a3b7fe772231db12cdd8cdae
2017-03-31 01:00:52 -07:00
Marc Horowitz 0b2ac0ada8 Support narrower module dependencies
Reviewed By: javache

Differential Revision: D4772632

fbshipit-source-id: 615bf8998a3817364d0f8bd435c95c2c1f1bebed
2017-03-31 01:00:52 -07:00
Brent Vatne 5f5da4e122 Add support for custom log reporter cli option for local server
Summary:
In Expo tools such as XDE, exp we listen listen to stdout from the packager process and print it in our own buffer. In the case of XDE, an electron app, our log pane is DOM-based, and before printing each log chunk we need to remove special tty characters and sometimes parse it to get information that we need (eg: progress bar). By using a custom reporter, we can take the raw events and pass them along in a format that is easy to consume by XDE and exp. This same motivation applies to create-react-native-app, where we currently don't show a progress bar in the terminal, but we can with this change.

Create `LogReporter.js` in the root of a project with the CLI changes included in this PR.

```
class LogReporter {
  update(event) {
    console.log(JSON.stringify(event));
  }
}

module.exports = LogReporter;
```

Now, run `react-native start --customLogReporterPath=LogReporter.js` -- all of the raw events will be output as JSON (while the logs
Closes https://github.com/facebook/react-native/pull/13172

Differential Revision: D4795760

Pulled By: hramos

fbshipit-source-id: 80164b2f30e33a3f9965f4865a8404f8640a52c1
2017-03-30 18:15:49 -07:00
Brian Vaughn d4aa42a4ac Show more meaningful error stack in ReactNative redbox
Reviewed By: yungsters

Differential Revision: D4797372

fbshipit-source-id: 069c013bcc3d58dd38a25979f4a04aed5fc1dde6
2017-03-30 17:19:41 -07:00
Pieter De Baets 7db16a4020 Remove RelayFBPreloadedModules, error on overlapping modules
Reviewed By: davidaurelio

Differential Revision: D4779671

fbshipit-source-id: f2dfeb696baab457769c22ca7ab28972270e5fc0
2017-03-30 16:50:05 -07:00
Aaron Chiu 7773f25756 move us off AsyncTask
Reviewed By: achen1

Differential Revision: D4795134

fbshipit-source-id: 70979e3fae6dcd63d535290659c87de82f9617c3
2017-03-30 16:20:51 -07:00
Joon Ho Cho 5be8d5f63e Update xcode dependency from 0.8.9 -> 0.9.1
Summary:
This should resolve the following npm deprecation warning:
```
 WARN deprecated node-uuid@1.4.7: Use uuid module instead
```

Existing tests should cover this already.
Closes https://github.com/facebook/react-native/pull/13194

Differential Revision: D4796723

Pulled By: javache

fbshipit-source-id: 2783f5d04c696b887de2ab2d32805e4661484a83
2017-03-30 16:20:49 -07:00
Hawken Rives f36664f7fe Upgrade glob to v7.1.1
Summary:
> Explain the **motivation** for making this change. What existing problem does the pull request solve?

Of the three dependencies I have that rely on `glob`, react-native is the only one not on 7.x. If react-native can upgrade, then npm can deduplicate the glob dependency.

```console
$ npm ls glob
├─┬ eslint@3.13.1
│ └── glob@7.1.1
├─┬ jest@18.1.0
│ └─┬ jest-cli@18.1.0
│   └─┬ istanbul-api@1.1.0
│     ├─┬ fileset@2.0.3
│     │ └── glob@7.1.1
│     ├─┬ istanbul-lib-report@1.0.0-alpha.3
│     │ └─┬ rimraf@2.5.4
│     │   └── glob@7.1.1
│     └─┬ istanbul-lib-source-maps@1.1.0
│       └─┬ rimraf@2.5.4
│         └── glob@7.1.1
└─┬ react-native@0.39.2
  ├── glob@5.0.15
  └─┬ rimraf@2.5.4
    └── glob@7.1.1
```

**Test plan (required)**

> Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull req
Closes https://github.com/facebook/react-native/pull/11893

Differential Revision: D4796721

Pulled By: javache

fbshipit-source-id: 6e7424dd731329f982c2f6c05b40dec8febf2e57
2017-03-30 16:20:44 -07:00
Martin Konicek e82c2fbbe5 Add OSS website test, clean up test names, remove website dependency on sass
Reviewed By: ericvicenti

Differential Revision: D4726864

fbshipit-source-id: 38c13a08d42d11533a02c14a9acd5a05bbce307f
2017-03-30 15:30:41 -07:00
Sam Corcos c31a65669e Add comma to prevent build error when react.gradle is uncommented
Summary:
Thanks for submitting a PR! Please read these instructions carefully:

- [ ] 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.

At the moment, if you uncomment the react specific code in `build.gradle` you'll get a compilation error. Adding a comma prevents this error.

No tests are necessary. This is a simple fix.

Sign the [CLA][2], if you haven't already.

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/martink
Closes https://github.com/facebook/react-native/pull/13212

Differential Revision: D4802065

Pulled By: javache

fbshipit-source-id: 0ddfe16241381d7e4ac0e48be1bada21d9df2068
2017-03-30 10:20:56 -07:00
Pieter De Baets f6754348be Merge RCTPlatform.isTesting and RCTRunningInTestEnvironment
Reviewed By: fkgozali

Differential Revision: D4802834

fbshipit-source-id: 76bb98877f2fc427c01806b192d8dc71489a1c4a
2017-03-30 10:02:35 -07:00
Pieter De Baets 5af30382d5 Improve fbsystrace support
Reviewed By: mhorowitz

Differential Revision: D4756318

fbshipit-source-id: 7811f680a7ad044b5ae028ee9b2fed5f46ce2a63
2017-03-30 06:53:16 -07:00
Build Service 12de9729bd @allow-large-files [i18n] remove unused generated strings.xml files on master
fbshipit-source-id: c3151e7f8c346b1ece67ea37b88110b16e1a9107
2017-03-29 21:02:38 -07:00
Build Service 7f35abb26a @allow-large-files @ignore-conflict-markers[i18n] translation auto-update for i18n/instagram.config.json on master
fbshipit-source-id: 680e36c342abcc80279979ca461eb08449d535bb
2017-03-29 21:02:38 -07:00
Build Service c21760af4f @allow-large-files @ignore-conflict-markers[i18n] translation auto-update for i18n/fb4a.config.json on master
fbshipit-source-id: e973b0d453b88fc9f6cf54e1fd97ef7780cafe87
2017-03-29 21:02:38 -07:00
Build Service b6f1a3b6d7 @allow-large-files @ignore-conflict-markers[i18n] translation auto-update for i18n/adsmanager.config.json on master
fbshipit-source-id: f52efb222ea7385f8d291395b2edef5f28dea713
2017-03-29 21:02:38 -07:00
Nicholas Tate 8c7b32d5f1 Container Testing Updates
Summary:
ericvicenti - Here are necessary updates for the the testing container workflow.

normanjoyner

Temporarily disabled E2E tests on the Containership Jenkins pipeline because they seemed to be sporadically failing and slow down the run rate of CI tests.

* Run all stages and parallel branches in testing suite even if one
fails (just mark the overall job as failed)
* Added update to docker tag name to convert spaces to hyphens to cover
edge case where the project name may have spaces
* Updated buck to more recent version in the base image
* Remove duplicate module provider from `.flowconfig`
* Correctly exit with status code from failed instrumentation tests
* Add JSCHeaders to prepare for testing on stage branches
* Fix bug in filtering of failed instrumentation tests
* Turn down retry count to 1 for E2E tests and temporarily disable
* Add retry3 count to the apk install from buck
* Updated base image to install android SDKs through grepping since the
IDs update frequ
Closes https://github.com/facebook/react-native/pull/13032

Differential Revision: D4799015

Pulled By: ericvicenti

fbshipit-source-id: bbac9303e8ca4fe8be0e8b230a2f863c71c3366c
2017-03-29 17:56:14 -07:00
Build Service 944adb76d1 @allow-large-files [i18n] remove unused generated strings.xml files on master
fbshipit-source-id: 8efabef352fa71b3c18c1a8e318d66850fdd5e56
2017-03-29 17:13:58 -07:00
Build Service 9a596018f8 @allow-large-files @ignore-conflict-markers[i18n] translation auto-update for i18n/instagram.config.json on master
fbshipit-source-id: 951f549645f4010bd01ab6486a2b3b617a901b04
2017-03-29 17:13:58 -07:00
Build Service 5012f8938e @allow-large-files @ignore-conflict-markers[i18n] translation auto-update for i18n/fb4a.config.json on master
fbshipit-source-id: 2d84aa83e9efaaa89838da7c8d9595692b6bccdd
2017-03-29 17:13:58 -07:00
Build Service 7f346973d1 @allow-large-files @ignore-conflict-markers[i18n] translation auto-update for i18n/adsmanager.config.json on master
fbshipit-source-id: 156680756e04fc7ef69017c49324ff0b7acd030f
2017-03-29 17:13:57 -07:00
Lukas Wöhrl 759b8ccf71 Don't transfer layout outputs to java for nodes which don't have a new layout
Summary:
As suggested in facebook/yoga#484. This is the PR which only adds the part of using a local bool field for storing the hasLayoutFlag, to be able to pass the layout only if it has really changed.
Closes https://github.com/facebook/yoga/pull/492

Reviewed By: astreet

Differential Revision: D4786961

Pulled By: emilsjolander

fbshipit-source-id: cf3d354b93f6dcc3ef817ef73a47bd29e37d1848
2017-03-29 16:45:37 -07:00
Spencer Ahrens a7633afa08 Add UIExplorer to manual testing script.
Summary:
Encourage a little more testing coverage and make it a little easier to do.
Closes https://github.com/facebook/react-native/pull/13040

Reviewed By: shergin

Differential Revision: D4742701

Pulled By: sahrens

fbshipit-source-id: 4398c3b737b09c4113e965725585efc038936515
2017-03-29 16:19:30 -07:00
Brian Vaughn 704b662437 Update ReactNative site docgen to handle ViewPropTypes
Reviewed By: hramos

Differential Revision: D4795300

fbshipit-source-id: 5ed1dccd94dbefd661532a5a412b9dbecbc8fc93
2017-03-29 13:31:21 -07:00
Benjamin Eckel 140c5f657c Make run-ios --device example copy-pastable
Summary:
This changes the single quotes to double quotes so this command can be copy-pasted.

If a user copy pastes the run-on-device example in bash they will be presented with a confusing prompt because bash expects another terminating single quote.

```
~ben (master *) ~/code/transit: react-native run-ios --device 'Max's iPhone'
>
>
```

It seems minor but this could be just confusing enough to frustrate a beginner or someone not familiar with bash.

This can be tested by running:

```
react-native run-ios --help
```

and verifying that the "run on device" example is changed:

```diff
- react-native run-ios --device 'Max's iPhone'
+ react-native run-ios --device "Max's iPhone"
```
Closes https://github.com/facebook/react-native/pull/13145

Differential Revision: D4776305

Pulled By: hramos

fbshipit-source-id: 9500551bfc106cd1687468f7ecc4c91089e1f703
2017-03-29 11:45:56 -07:00
Elie Teyssedou 56a4538b31 Update documentation for Modal's prop animationType
Summary:
I was using Modal component and I didn't knew what was the default for animationType prop. After reading the code, I saw that it was `none`.

I did not tell that the "default" is `slide` if animated is set to `true`, because it is not a default but an implementation of `animated` prop effect and because of the deprecation of `animated`.

Thanks.
Closes https://github.com/facebook/react-native/pull/13196

Differential Revision: D4795765

Pulled By: hramos

fbshipit-source-id: 25d62ac7eeb20fc5557918c3d75709f44f5d4972
2017-03-29 11:31:51 -07:00
hoangpham95 c3110963f2 The width and height should be in the revsersed order.
Summary:
Inspired by #13191

Creating a test app with spannable `TextView`, and observe the text width/height
Closes https://github.com/facebook/react-native/pull/13203

Differential Revision: D4795809

Pulled By: hramos

fbshipit-source-id: a7c6845abe7472dc7ad2f1f978a20d02fe49eda8
2017-03-29 11:17:16 -07:00
Ben Alpert 1d367004e9 Improve feel of scroll snapping behavior on iOS
Reviewed By: sahrens, shergin

Differential Revision: D4768384

fbshipit-source-id: 6319d058292be6ba38c059d8d1a1bf70bac603e2
2017-03-29 07:16:01 -07:00
Janic Duplessis c233191485 Animated - Add missing super calls to fix native animated crash
Summary:
There was some missing super.__detach calls in some Animated nodes, we rely on the base class being called to drop the node in the native implementation, not doing so will cause some nodes to leak. It also resulted in a crash when removing certain nodes because they would get updated after being detached.

**Test plan**
Reproduced the crash by unmounting a view that uses a DiffClamp node and made sure this fixes it. Also tested that other native animations still worked properly.

Fixes #11317
Closes https://github.com/facebook/react-native/pull/12910

Differential Revision: D4718188

Pulled By: javache

fbshipit-source-id: 179ec1334532152c124a9c0f447f488311925d0a
2017-03-29 04:02:22 -07:00
Emil Sjolander 673093eed0 Set web defaults when resetting
Reviewed By: astreet

Differential Revision: D4779742

fbshipit-source-id: 5b8c5d7bd432a12984e4ebfd3187da3d680272cd
2017-03-29 03:17:28 -07:00