Commit Graph

10427 Commits

Author SHA1 Message Date
Jean Lauliac 3c85a6b902 packager: stronger option types
Reviewed By: davidaurelio

Differential Revision: D4868612

fbshipit-source-id: 50d72ce56d8e3ef0d917ee5bbe3dd42faf075584
2017-04-12 04:31:24 -07:00
Christoph Pojer deebf15a56 Move formatBanner into packager folder
Reviewed By: davidaurelio

Differential Revision: D4868954

fbshipit-source-id: 7a28019c781262bcf4aab0ad2e67868d35ebf9fb
2017-04-12 02:44:51 -07:00
Aaron Chiu 625b4940ee FLog.w ==> Flog.d
Reviewed By: yungsters

Differential Revision: D4874628

fbshipit-source-id: ae39a7105145f11b749822f3c98db973cfe613eb
2017-04-12 00:42:57 -07:00
Andrew Y. Chen 8290cd7ce2 Fix ARTShape arc
Reviewed By: AaaChiuuu

Differential Revision: D4871406

fbshipit-source-id: 7f777048c6756399b309e34cf3341c4263467b0b
2017-04-11 19:35:09 -07:00
Andrew Y. Chen 6b900dc7fb Fix withCredentials test failure
Reviewed By: AaaChiuuu

Differential Revision: D4870817

fbshipit-source-id: d741eb21d4c7092f89d5a8461b9ec92e3df49120
2017-04-11 18:30:35 -07:00
Lukas Wöhrl f26a99764a Fix min constraint incorrectly reducing available space
Summary:
If a min constraint exists. It incorrectly reduces the available space by that amount. This adds a test and fix for this.
Closes https://github.com/facebook/yoga/pull/501

Differential Revision: D4867146

Pulled By: emilsjolander

fbshipit-source-id: ceafe070bfe7f501929d316656ac44c4e1753059
2017-04-11 13:09:38 -07:00
Lukas Wöhrl f7fe9a6219 Fix position on root node with RTL direction
Summary:
If the root node has a position and we have a RTL layout, that position must be like LTR direction. See #477.
Closes https://github.com/facebook/yoga/pull/502

Differential Revision: D4867144

Pulled By: emilsjolander

fbshipit-source-id: b5ad3d87e7054090da12d7665a3d1abe8496a548
2017-04-11 13:09:38 -07:00
Eric Vicenti 7da07fa9f3 Upgrade react-docgen to use new babylon parser
Reviewed By: mkonicek

Differential Revision: D4855504

fbshipit-source-id: 30c2d956242be5e8f01eb4ebc7e7afd77a72cd36
2017-04-11 12:32:49 -07:00
Naman Goel b7d873b1a0 Flow type improvements to accept co-variant types
Differential Revision: D4848918

fbshipit-source-id: b8d4628431c57c8fda12fc7e2e38e5b2dab9b1ad
2017-04-11 12:25:39 -07:00
Janic Duplessis 18525ce8c5 Remove unused react-addons dependencies
Summary:
We don't export addons anymore so we can remove those.

cc bvaughn
Closes https://github.com/facebook/react-native/pull/13244

Reviewed By: hramos

Differential Revision: D4836676

Pulled By: ericvicenti

fbshipit-source-id: 430ebd2b049e90f3e27e2420c8316bbbe2274baa
2017-04-11 12:25:39 -07:00
Karan Thakkar 840dc0cc82 Allow configuring the app source folder for android
Summary:
I have been working on integrating React Native into an existing app and realised that the source folder for android code is currently hardcoded as `app`. Being a legacy codebase we can't really change that. So I wanted to be able to customise this folder name so that I can integrate RN seamlessly and start it from the CLI without having to run it from Android Studio.

- Create a barebones RN app
- `react-native run-android` works successfully
- Refactor the name of the app folder inside the android directory to `TestFolderName` using Android Studio
- `react-native run-android` now fails
- Changing this command to `react-native run-android --appFolder=TestFolderName` works successfully
Closes https://github.com/facebook/react-native/pull/13273

Differential Revision: D4833396

Pulled By: ericvicenti

fbshipit-source-id: 4c62cee6aaa2cc78eede5c7756459430022fffde
2017-04-11 12:25:39 -07:00
Pieter De Baets 9d1c62669b Add extra guards to DispatchMessageQueueThread
Reviewed By: bnham

Differential Revision: D4868432

fbshipit-source-id: 23d6c996aa97db82ea5e0e166e1988f4ce378b6f
2017-04-11 12:25:39 -07:00
Alex Kotliarskyi ea7c5ab04b Add mock for BackHandler
Reviewed By: fkgozali

Differential Revision: D4861901

fbshipit-source-id: b1b74e63731328d2235bf86794aa481a8275ed8c
2017-04-11 12:25:38 -07:00
Andrew Y. Chen 21819f1a99 Add support for async callbacks in ReactFindViewUtil
Reviewed By: AaaChiuuu

Differential Revision: D4841500

fbshipit-source-id: 16620d72bd636ad13085c15c38862e16da6c42d2
2017-04-11 10:45:35 -07:00
Jean Lauliac 8fc3b48c65 packager: worker: remove `extern` option
Reviewed By: davidaurelio

Differential Revision: D4867367

fbshipit-source-id: ebe5fa860566e87bd6d042ee41b9a7aa9c777fc6
2017-04-11 08:15:57 -07:00
Jean Lauliac fabf833c3f packager: Module.js: fix Haste name code
Summary: The original code wasn't very readable. Better with this change, I think.

Reviewed By: davidaurelio

Differential Revision: D4851335

fbshipit-source-id: 210309d4b727aff58bea48d0ab324256234cd941
2017-04-11 08:15:57 -07:00
David Aurelio 7f706e824d Use exact types for options
Summary: Make option types exact to prevent stale options in our code base.

Reviewed By: jeanlauliac

Differential Revision: D4867773

fbshipit-source-id: 6aa06649735d6105f4b6ff2af7f699cf8ba336c7
2017-04-11 08:02:24 -07:00
David Aurelio eabc9cecd6 Push handling of missing parent module to `resolve`
Reviewed By: jeanlauliac

Differential Revision: D4863235

fbshipit-source-id: 857814cb25ee661db5e2cbdeac7175d9276044db
2017-04-11 08:02:23 -07:00
David Aurelio 3bcf4acfc7 Allow resolution without a parent.
Reviewed By: jeanlauliac

Differential Revision: D4862926

fbshipit-source-id: 18f98b6db98e9f937632bd5d00e0b0acfcff9de5
2017-04-11 08:02:23 -07:00
Alex Dvornikov abd148fa21 Show redbox window on JS errors for debug builds
Reviewed By: javache

Differential Revision: D4860613

fbshipit-source-id: 255202df9401ffd1dfb48224dd89255eac76874e
2017-04-11 06:00:42 -07:00
Jean Lauliac cb88df00ae packager: TransformCache: do not include basename in hash
Reviewed By: cpojer

Differential Revision: D4867411

fbshipit-source-id: ece5214ee9cf152e23790c70f7a8b12060725150
2017-04-11 05:31:26 -07:00
Pieter De Baets 3184f314ad Fix NPE in StackTraceHelper
Reviewed By: AaaChiuuu

Differential Revision: D4860056

fbshipit-source-id: 68865d8d8d1c2a678970f10e99d2ae5bc31ea5f8
2017-04-11 04:29:55 -07:00
Tim Yung dd7aa3659d Lists: Fix RCTJSONStringify Breakage on Infinity
Reviewed By: jingc

Differential Revision: D4867026

fbshipit-source-id: dfe98d5012ced80fbe10bf069c58f45d00da388b
2017-04-11 00:45:35 -07:00
Ho Chin Chee a41292d9c4 Update HAXM installation link
Summary:
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.
- [ ] Match the **code formatting** of the rest of the codebase.
- [x] Target the `master` branch, NOT a "stable" branch.

So other Mac users wont have to dig around to look for the link.

What existing problem does the pull request solve?

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.

If you have added code that should be tested, add tests.

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

Differential Revision: D4866808

fbshipit-source-id: 9259eff382d9440754e672ad05828342091877d2
2017-04-10 23:34:04 -07:00
Adam Comella e544563bd2 BREAKING: Android: Support withCredentials flag in XHRs
Summary:
Corresponding iOS PR: #12275

Respect the withCredentials XMLHttpRequest flag for sending cookies with requests. This can reduce payload sizes where large cookies are set for domains.

This should fix #5347.

This is a breaking change because it alters the default behavior of XHR. Prior to this change, XHR would send cookies by default. After this change, by default, XHR does not send cookies which is consistent with the default behavior of XHR on web for cross-site requests. Developers can restore the previous behavior by passing `true` for XHR's `withCredentials` argument.

**Test plan (required)**

Verified in a test app that XHR works properly when specifying `withCredentials` as `true`, `false`, and `undefined`. Also, my team uses this change in our app.

Adam Comella
Microsoft Corp.
Closes https://github.com/facebook/react-native/pull/12276

Differential Revision: D4673646

Pulled By: ericvicenti

fbshipit-source-id: 924c230c9df72071b3cf9151c3ac201905ac28a5
2017-04-10 22:46:12 -07:00
Kazuki Sakamoto ecd0df01af Add YGConfigGetInstanceCount
Summary:
- depends on #496
- For memory leak unit test
- Expose the API for C#
Closes https://github.com/facebook/yoga/pull/497

Reviewed By: emilsjolander

Differential Revision: D4796190

Pulled By: splhack

fbshipit-source-id: 99e4e78e8dfb3d459cf6cd7103ab252c3748e5a6
2017-04-10 14:24:25 -07:00
Valentin Shergin ca6e0b37cf `reactRespondsToTouch:` was removed
Summary:
* It complicates Touch Handling mechanism.
* The same functionality can be (and should be) implemented via overriding standard `hitTest:` method.
* It was marked as deprecated a while ago.

Reviewed By: mmmulani

Differential Revision: D4667776

fbshipit-source-id: 2e047c3308563a2849ea351a242270f0800fead2
2017-04-10 12:32:31 -07:00
Satyajit Sahoo 1d270081d8 Add ability to customize CLI path
Summary: Closes https://github.com/facebook/react-native/pull/13248

Differential Revision: D4861273

fbshipit-source-id: 420a9dde94e888baab226e3c0d8d20e6f1464ae5
2017-04-10 12:16:03 -07:00
Hilke Heremans 2ab840522c Ignore all loopback addresses for ip detection
Summary:
There is a bug with IP detection on Macs that have (1) multiple ethernet interfaces, (2) are using the second or third interface as their primary connection and (3) have extra loopback IPs configured (for example when running OpenVPN, running some Docker configurations or other more exotic applications). In those cases, automatic IP detection will falsely detect the IP as something like `127.94.0.1`, which will make it impossible to run debug builds from a physical device.

The underlying network configurations looks something similar to this (irrelevant parts omitted):
```
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
	options=1203<RXCSUM,TXCSUM,TXSTATUS,SW_TIMESTAMP>
	inet 127.0.0.1 netmask 0xff000000
	inet 127.94.0.1 netmask 0xff000000
	nd6 options=201<PERFORMNUD,DAD>
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
	options=10b<RXCSUM,TXCSUM,VLAN_HWTAGGING,AV>
	ether xx:xx:xx:xx:xx:xx
	nd6 options=201<PERFORMNUD,DAD>
	media: autoselect
Closes https://github.com/facebook/react-native/pull/13415

Differential Revision: D4859654

Pulled By: javache

fbshipit-source-id: 3c5d06201c48a2dfe1c274ff433423e5d7f2cded
2017-04-10 11:00:31 -07:00
Brian Vaughn c95a991061 Removed takeSnapshot util function from ReactNative renderer
Summary:
It was added to react-native-implementation in c7387fe

Relates to [this comment](848593c0f0 (commitcomment-21585552)) and issue #13343

cc janicduplessis
Closes https://github.com/facebook/react-native/pull/13347

Reviewed By: bvaughn

Differential Revision: D4843898

Pulled By: ericvicenti

fbshipit-source-id: 2b83d7bd71b7a7e6961e4da551ddd4090af03824
2017-04-10 10:31:21 -07:00
Kathy Gray 78ab4ee893 Delay module creation on call for constants when module has none
Reviewed By: AaaChiuuu

Differential Revision: D4810252

fbshipit-source-id: b2b98c3a8355dbb5775f254f25304a21f0bfee5b
2017-04-10 03:16:36 -07:00
Kathy Gray 678679e009 Separate findMethods from BaseJavaModule
Reviewed By: javache

Differential Revision: D4795087

fbshipit-source-id: 6d135a409d463940a5a0aabbc85682ed61420ae3
2017-04-10 03:16:36 -07:00
Faraz Sherwani 8591d8ae71 Webview disable save form prop
Summary:
Adds functionality to be able to disable saving of form data and thereby disabling autocomplete in webview on Android. Can be used as a workaround for #13241

Manual testing that autocomplete is disabled when the property is set to true, and still enabled when it is unset or set to false.
Closes https://github.com/facebook/react-native/pull/13271

Differential Revision: D4858899

Pulled By: ericvicenti

fbshipit-source-id: 62738b0685e4c1958c8a32e184fa2fe4f711b336
2017-04-09 21:45:45 -07:00
Pieter De Baets 2336ac299c Improve constant extraction from RCTNativeModule
Reviewed By: dcaspi

Differential Revision: D4829671

fbshipit-source-id: 6b1cef1d31c7d8981c6f1e304d3742e885f8a83b
2017-04-08 15:18:08 -07:00
Pieter De Baets f3dfd616f4 Allow lazy Cxx modules to not initialize
Reviewed By: mhorowitz

Differential Revision: D4851596

fbshipit-source-id: cf5f5c51b9aaa0da96f7ab6fba1277b72c988400
2017-04-08 15:18:08 -07:00
Andres Suarez e67b8fe761 Use flow 0.43.1
Reviewed By: nmote

Differential Revision: D4851923

fbshipit-source-id: 018f61c3a45e32c899287848d36129e3601145a4
2017-04-08 14:05:11 -07:00
Jonathan Kim 3d3cd867c9 Added option to disable xip
Summary:
When running an app on a real iPhone in debug mode, I occasionally get issues when trying to load the js bundle and I suspect the issue is with xip.io (and it doesn't look like I'm the only one: https://github.com/facebook/react-native/issues/12786 https://github.com/facebook/react-native/issues/9688#issuecomment-272591839). So I've added the ability to optionally disable the use of xip.io if an env variable `DISABLE_XIP` is set.

Add `export DISABLE_XIP=true` to the `Bundle React Native code and images` build phase. Run the app on a real iPhone and ensure that it can load the JS bundle from the host computers IP.
Closes https://github.com/facebook/react-native/pull/13326

Differential Revision: D4855719

Pulled By: ericvicenti

fbshipit-source-id: cb2e91291acadaa78ea302800b55c2e5388f6380
2017-04-07 20:15:46 -07:00
David Aurelio 263f40a2d3 packager: HasteMap: expose getAllFiles()
Reviewed By: tomocchino

Differential Revision: D4850695

fbshipit-source-id: 8aae4353de8779f7a1358b2766dad4a6c751b4af
2017-04-07 20:15:46 -07:00
César Alberca a1e06dfb39 Removed extra semicolon
Summary: Closes https://github.com/facebook/react-native/pull/13389

Differential Revision: D4854128

Pulled By: hramos

fbshipit-source-id: bd7d0d12eae51fed31cf4bc2260b8c4f447e08c8
2017-04-07 18:45:30 -07:00
Spencer Ahrens 6f8ce41a39 Fix crash from FillRateLogging
Reviewed By: thechefchen

Differential Revision: D4853991

fbshipit-source-id: b024d4052edb04e9f9da2e2504c56f8b7840cded
2017-04-07 16:00:56 -07:00
Ludovico Fischer 29404f087e Correct `setState()` usage in tutorial
Summary:
If the new state depends on the previous state, if I remember correctly, it’s safer to use  `setState()` with a function argument to ensure we’re not reading from an outdated `state`.

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.

The tutorial suggests to use `setState()` with an object argument when the new state depends on the previous state. In such situations, it’s preferable to use a function to ensure the previous state is up-to-date.

Updates documentation only, so there are no additional tests. Rendering the site.

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

Differential Revision: D4852404

Pulled By: hramos

fbshipit-source-id: 834759e16bcfbd5a8de71bf0c56f2b154f3321e1
2017-04-07 13:31:06 -07:00
Andrew Y. Chen 909af08f24 Add a nativeID prop to allow native code to reference react managed views
Reviewed By: sahrens

Differential Revision: D4786713

fbshipit-source-id: af9cef0737c010b429d52d00181c00bd81f13f5b
2017-04-07 12:00:40 -07:00
Benjamin Jaeger e154117f37 Add proguard rules to bridge BUCK
Summary:
prevents reflected classes from being stripped/obfuscated
Depends on D4830910

Reviewed By: mhorowitz

Differential Revision: D4835688

fbshipit-source-id: 5b85668f92ed4ae5cebc9902ec60f6d5d6299bd4
2017-04-07 11:46:12 -07:00
Adam Perry 403f356082 Stop yarn error message appearing for Windows users of local-cli
Summary:
On windows, recent versions of local-cli will display a yarn error to stderr when starting the packager (see https://github.com/expo/xde/issues/91, https://github.com/react-community/create-react-native-app/issues/101, https://github.com/react-community/create-react-native-app/issues/113#issuecomment-289185491 for examples of users hitting this in the wild), even though no package management action is being taken.

From what I can tell this is what happens:

* [`local-cli/util/yarn.js` does not ignore stderr on Windows](6fa87134fc/local-cli/util/yarn.js (L25))
* [`local-cli/util/PackageManager.js` calls the above function when it's require'd](6fa87134fc/local-cli/util/PackageManager.js (L20))

For Windows users who don't have yarn installed, this means that the 'yarn is not recognized as an internal or external command..." error displays wh
Closes https://github.com/facebook/react-native/pull/13355

Differential Revision: D4848084

Pulled By: hramos

fbshipit-source-id: f32176354e0bd7ff6d7009ea30dca64ff23ae3d5
2017-04-07 11:17:00 -07:00
Peter Pistorius d03f9b7442 PushNotificationIOS.requestPermissions won't resolve if no event listeners are attached
Summary:
Resolves #13012

RCTPushNotificationManager uses startObserving to register for RCTRegisterUserNotificationSettings. According to the docs, the startObserving method won't be called until somebody subscribes to NotificationManagerIOS.

This means there is a scenario when the developer can call requestPermissions without subscribing to notifications first, but since RCTPushNotificationManager relies on NSNotificationCenter subscribtion, the result will never be returned.

When requesting permissions  the promise will resolve:
`PushNotificationIOS.requestPermissions().then(console.log);` without the need for calling `PushNotificationIOS.addEventListener()` first.
Closes https://github.com/facebook/react-native/pull/13263

Differential Revision: D4851767

Pulled By: javache

fbshipit-source-id: 2be8621e072ae1086014594bc986ca5590b5eb61
2017-04-07 11:17:00 -07:00
Pieter De Baets 5767b98f4d Add JSC utility header to RCTBridge
Reviewed By: shergin

Differential Revision: D4823509

fbshipit-source-id: 79c96d3bc183d89a5dec7da06b0a0a710d8c7dea
2017-04-07 11:16:59 -07:00
Pieter De Baets 76b93e1253 Add block-based initializer for RCTModuleData
Reviewed By: shergin

Differential Revision: D4821772

fbshipit-source-id: 2cd35ec6726b6fe1494a92966ade5aa0b86e769b
2017-04-07 11:16:59 -07:00
Héctor Ramos 597c8c7700 Update ISSUE_TEMPLATE.md
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.

What existing problem does the pull request solve?

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.

If you have added code that should be tested, add tests.

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

Differential Revision: D4852068

Pulled By: hramos

fbshipit-source-id: ff193a7c90aa8b00c248575ae647f1fb14eb261f
2017-04-07 11:16:59 -07:00
Ben Roth 540f4c9638 Fix crash in `RCTRedBox::formatFrameSource:`
Summary:
Motivation: Similar to https://github.com/facebook/react-native/pull/13242 - the application will crash with `[NSNull lastPathComponent]: unrecognized selector sent to instance` if a stack frame with no filename makes it to RCTRedBox.
Closes https://github.com/facebook/react-native/pull/13360

Differential Revision: D4848980

Pulled By: javache

fbshipit-source-id: dc506f2ba39c2d4d68982b56a6e765a19dc048b0
2017-04-07 11:03:56 -07:00
Steffen Forkmann 39431deb1f fix typo - closes #13369
Summary:
We're just fixing a reported typo from the docs.

proofreading
Closes https://github.com/facebook/react-native/pull/13375

Differential Revision: D4851601

Pulled By: javache

fbshipit-source-id: b8bd4067285809dd24b6e5c9bc8fddcc8734dfd1
2017-04-07 10:45:33 -07:00