Commit Graph

13004 Commits

Author SHA1 Message Date
Héctor Ramos 22a2553405 Move danger to bots directory
Summary:
No logic change here. Part of a plan to consolidate CI-only files amongst .circleci and bots/ directories.
Closes https://github.com/facebook/react-native/pull/17807

Differential Revision: D6865976

Pulled By: hramos

fbshipit-source-id: 48607a80dcf8cac1c3c033c18bf5d6dd4cd8e6bf
2018-01-31 16:42:41 -08:00
Valentin Shergin d74ff6fadd Fixed typo in RCTSurfaceRootShadowView
Summary:
Trivial.
Special thanks to janicduplessis

Created from Diffusion's 'Open in Editor' feature.

Reviewed By: fkgozali

Differential Revision: D6863932

fbshipit-source-id: d40a30271adc5c8d47149ab920e2ac11158ab756
2018-01-31 15:16:36 -08:00
Héctor Ramos a2f3ba864e Generate JUnit test reports for iOS builds
Summary: Closes https://github.com/facebook/react-native/pull/17794

Differential Revision: D6850015

Pulled By: hramos

fbshipit-source-id: bd230a5aa6fe14fb760f7b0c5f0989bf6ee1e8ea
2018-01-31 15:02:58 -08:00
Mehdi Mulani a70fdac5bd Measure touch events from nearest "root view"
Summary:
This makes RCTTouchHandler follow the same logic when sending touch event
coordinates as `UIManager.measure`.
This is important as UIManager.measure is used in `Touchable.js` aka the mother
of all touch events in RN.

In particular, this will make touch events correctly handled for places where RN is embedded into other screens.

Reviewed By: shergin

Differential Revision: D6838102

fbshipit-source-id: 70cad52606ea931cb637d8aa2d4845818eea0647
2018-01-31 14:46:39 -08:00
Agastya Darma b1cdb7d553 Implementing space-evenly
Summary:
So in v0.52.0 space-evenly is introduced but not yet implemented (1050e0b by woehrl01). This pull request implements the space-evenly.

Manual Testing.
![notes marker](https://i.imgur.com/IXmezVY.png)

[IOS] [FEATURE] [Yoga] Adding space-evenly on justify-content in iOS
[ANDROID] [FEATURE] [Yoga] - Adding space-evenly on justify-content in Android
Closes https://github.com/facebook/react-native/pull/17805

Differential Revision: D6858294

Pulled By: shergin

fbshipit-source-id: 7a705ca05f58603ef4588e1bfd16c16a78f8a390
2018-01-31 10:17:22 -08:00
Dan Caspi 3fbf7856d9 Better handling exception in loadScript()
Differential Revision: D6856807

fbshipit-source-id: 36c527ee00eef56a5912ad6e4233d6cd61cb5170
2018-01-31 05:31:12 -08:00
David Aurelio e756251413 Synchronize map access
Summary:
We want applying deltas to be an atomic operation, from incrementing the delta message ID to updating the relevant maps.
This is a simple approach to synchronize the corrsponding method.

We will probably need to go with a more sophisticated approach, that makes sure that deltas are applied in order. That would also allow us to lock only on writes.

Reviewed By: kathryngray

Differential Revision: D6846560

fbshipit-source-id: 175a80b4e39223883e397d75e20109fc12a2a878
2018-01-31 03:04:13 -08:00
Valentin Shergin 00099093dc Text: Enabling RCTVirtualText for iOS
Summary:
Without this change native RCTVirtualText module is unactive on iOS.
This can cause bags in Text rendering because failback module (RCTVirtualText) does not popagate dirty status upward.

Depends on D6842304.

Reviewed By: yungsters, AaaChiuuu

Differential Revision: D6854770

fbshipit-source-id: ab8b7acd67309b7351c0074293ee6515a55385ce
2018-01-30 20:35:39 -08:00
Brian Vaughn 74f386633d Udated create-react-class to version 15.6.3
Reviewed By: acdlite

Differential Revision: D6849403

fbshipit-source-id: 8a04eab540edd902e1aa36a74b2596088201ae65
2018-01-30 19:16:14 -08:00
Douglas Lowder a63fd378a4 Link both iOS and tvOS libraries with react-native link (fix #13783)
Summary:
Fix issues with the react-native CLI when linking iOS and tvOS libraries to a project created with `react-native init`. (#13783)

Verified the changes against test project at https://github.com/dlowder-salesforce/react-native-link-test.  Both `react-native link react-native-svg` and `react-native unlink react-native-svg` work correctly on this project.  Added new unit test for the new file added to `local-cli/link/ios`.

[CLI] [BUGFIX] `react-native link` has been fixed to correctly link iOS and tvOS targets.
[IOS] [BUGFIX] `react-native link` has been fixed to correctly link iOS and tvOS targets.
Closes https://github.com/facebook/react-native/pull/17231

Differential Revision: D6837567

Pulled By: hramos

fbshipit-source-id: 234d3d3966ae1b89cd16a37c95d303553f7ba5f5
2018-01-30 16:28:59 -08:00
Valentin Shergin 5fba82deff Fixing clowntown in RCTSurfaceRootShadowView
Summary: Obvious.

Reviewed By: mmmulani

Differential Revision: D6829844

fbshipit-source-id: 6c49be990fbcc3be2b5595866c3d1fd42a3eb3e9
2018-01-30 14:31:57 -08:00
Héctor Ramos da8bec9f8b Switch to yarn
Summary:
Switch to Yarn in order to more closely match internal Facebook environment.
Closes https://github.com/facebook/react-native/pull/17193

Differential Revision: D6572337

Pulled By: hramos

fbshipit-source-id: 331b1f331937e8ce3b787d48561e2e655d4a1cc9
2018-01-30 14:01:48 -08:00
Mehdi Mulani a9c684a0ff Allow substituting a default font handler
Reviewed By: nscoding

Differential Revision: D6798995

fbshipit-source-id: 541b4391428d1ee9c0b394033182dc232536c864
2018-01-30 13:51:19 -08:00
Chris Lewis 22efd95be1 Add back ability to customise OkHttp client
Summary:
Prior to 0a71f48b13, users could customise the OkHttp client used by React Native on Android by calling replaceOkHttpClient in OkHttpClientProvider.

This functionality has a variety of legitimate applications from changing connection timeouts or pool size to Stetho integration. The challenge is to add back support for replacing the client without causing a breaking change or reintroducing the problems olegbl sought to address in his original commit.

Introducing a client factory archives these aims, it adds a new, backwards compatible interface and is called each time a client is requested rather than re-using the same instance (unless you explicitly want this behaviour, in which case you could replicate it using a static class property inside your custom factory).

A number of PRs have been opened to add this functionality: https://github.com/facebook/react-native/pull/14675, https://github.com/facebook/react-native/pull/14068.

I don't have a lot of Java experience so I'm open to better/more idiomatic ways to achieve this :)

Create React Native application and set a custom factory in the constructor, e.g.  `OkHttpClientProvider.setOkHttpClientFactory(new CustomNetworkModule());`

Where a custom factory would look like:

```
class CustomNetworkModule implements OkHttpClientFactory {
    public OkHttpClient createNewNetworkModuleClient() {
        return new OkHttpClient.Builder().build();
    }
}
```

Remove the existing replace client method to prevent accident use and alert existing users that its functionality has changed: https://github.com/facebook/react-native/pull/16972

[Android] [Minor] [Networking] - | Provide interface for customising the OkHttp client used by React Native |
Closes https://github.com/facebook/react-native/pull/17237

Differential Revision: D6837734

Pulled By: hramos

fbshipit-source-id: 81e63df7716e6f9039ea12e99233f6336c6dd7ef
2018-01-30 11:58:45 -08:00
Valentin Shergin ef4214a49a Stub for `clearButtonMode` prop in RCTUITextView
Summary: Even if we don't support this prop yet, we have to expose this in RCTUITextView to conform the contract between ViewManager and ShadowView.

Reviewed By: sahrens

Differential Revision: D6842304

fbshipit-source-id: 7ea26974f595eba6a3c06df06ca01e46af2e63df
2018-01-30 11:30:54 -08:00
Bhuwan Khattar 619a8c9f29 Pass hasteImplModulePath to JestHasteMap and everywhere else
Reviewed By: jeanlauliac

Differential Revision: D6641294

fbshipit-source-id: 36ebec95e69fe920c6cc10addd96406521cb4b82
2018-01-30 11:30:54 -08:00
Héctor Ramos 964320447d Add support annotations dependency
Summary:
Should fix current test-android error in Circle CI.
Closes https://github.com/facebook/react-native/pull/17774

Differential Revision: D6837326

Pulled By: hramos

fbshipit-source-id: a53464d3abb52248c6565dee68e7e7f9be9a313f
2018-01-30 11:03:52 -08:00
Brian Vaughn c7ed03a95c Synced ReactFabric render
Reviewed By: fkgozali, sebmarkbage

Differential Revision: D6839001

fbshipit-source-id: 47b8278e883c33ca1f359dd16614f86c292e972d
2018-01-30 09:01:17 -08:00
Tom Duncalf 3f969cb1db Add minify flag to react-native bundle command
Summary:
We have found that it is useful to work with production rather than dev bundles when working on e.g. performance and animation tuning.

For a larger app, `react-native bundle` with `--dev false` can get very slow due to minification - in our case, this was especially true of library code (e.g. the AWS SDK taking nearly 15 secs to minify on a top-spec MBP 15"). This is fine when just building every now and then, but when making frequent changes and rebuilding, it becomes quite painful.

Currently there is no way to perform a release (non-dev) build, with minification disabled. This PR adds an optional `--minify` flag to enable developers to disable minification, reducing build times significantly for our use case.

Checked output bundle size, to ensure behaviour stays the same as the existing default when `--minify` is not specified, and that the `minify` flag gets passed through to Metro bundler correctly if specified.

N/A

[GENERAL] [ENHANCEMENT] [Bundler] - Added optional --minify flag to bundler
Closes https://github.com/facebook/react-native/pull/17702

Differential Revision: D6806356

Pulled By: shergin

fbshipit-source-id: c466a2dea692561f8b2002118662c3affc71b991
2018-01-30 00:42:54 -08:00
Semen Zhydenko 8ffc16c6e7 Typos in code
Summary:
To fix typos

No testing required, changed only internal things names

No

addtionalStyles -> additionalStyles
occured -> occurred
recomendedType -> recommendedType
markDirtyAndPropogate -> markDirtyAndPropagate
targetting -> targeting
RCTApplyTranformationAccordingLayoutDirection -> RCTApplyTransformationAccordingLayoutDirection (tranform -> transform)
Closes https://github.com/facebook/react-native/pull/17587

Differential Revision: D6832696

Pulled By: shergin

fbshipit-source-id: 452287e5ce82df5c6b87126cb21889b7bd9d73c1
2018-01-29 19:17:33 -08:00
Héctor Ramos 28d60b68ad Trim docs that are already present in the open source docs site
Summary:
A lot of these docs are already present in https://github.com/facebook/react-native-website.
Closes https://github.com/facebook/react-native/pull/17776

Differential Revision: D6839783

Pulled By: hramos

fbshipit-source-id: 945fde22afb8f181d0463617d224d3f3429faa24
2018-01-29 16:20:15 -08:00
Adam Putinski 31288161e1 Add accessibilityElementsHidden prop
Summary:
Allow iOS to have similar accessibility functionality to Android. This PR exposes the `accessibilityElementsHidden` property on iOS which is similar to Android's `importantForAccessibility="no-hide-descendants"`

I didn't see any existing examples for testing native props being passed through, but I did add an example to the RNTester app. I've attached some screenshots using the Accessibility Inspector to verify the property was correctly passed through.

![a](https://user-images.githubusercontent.com/603528/34998153-50e66776-faac-11e7-826d-1445a6813929.png)
![b](https://user-images.githubusercontent.com/603528/34998158-535a7420-faac-11e7-80d4-992fb7cd82dd.png)

I've updated the website with appropriate documentation.

https://github.com/facebook/react-native-website/pull/141

![screen shot 2018-01-16 at 10 23 50](https://user-images.githubusercontent.com/603528/34998202-6f2f39a6-faac-11e7-8651-0cfe8e037a30.png)
![screen shot 2018-01-16 at 10 23 59](https://user-images.githubusercontent.com/603528/34998205-711d6f94-faac-11e7-974d-54340c72fce4.png)

[IOS] [FEATURE] [View] - Added accessibilityElementsHidden property
Closes https://github.com/facebook/react-native/pull/17627

Differential Revision: D6806444

Pulled By: hramos

fbshipit-source-id: 50d31fdb92f4c59ae9355b019c422418b2e6cc24
2018-01-29 14:44:11 -08:00
Brian Vaughn d676746f14 React sync for revisions 9491dee...a7b9f98
Reviewed By: sebmarkbage

Differential Revision: D6834573

fbshipit-source-id: 30829313053ecec54a891941fcf090021497ef8e
2018-01-29 14:44:11 -08:00
Joey Jiron afd988f85a fixed issue with runIOS not being able to launch tvOS app
Summary:
Yes.

Yes

Environment:
OS: MacOS X 10.12.6 (16G29)
Node: 8.9.4
Yarn: N/A
npm: 5.4.2
Watchman: Not Found
Xcode: 9.2 (9C40b)
Android Studio: N/A

[CLI iOS runIOS] When using `react-native-cli` to try to launch the tvOS scheme the user get's an error because the current implementation for launching simulators ignores any simulator/device who's name does not start with `iOS`

StackOverflow issue also found here :  https://stackoverflow.com/questions/48069690/how-to-select-project-to-run-tvos-version-with-npm-start

Actual command line steps
```
$npm i -g react-native-cli
...
$react-native init CoolProject
...
$cd CoolProject/
$react-native run-ios --simulator "Apple TV"  --scheme "CoolProject-tvOS"

Scanning folders for symlinks in /Users/jjiron/CoolProject/node_modules (7ms)
Found Xcode project CoolProject.xcodeproj
CoreData: annotation:  Failed to load optimized model at path '/Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/Frameworks/InstrumentsPackaging.framework/Versions/A/Resources/XRPackageModel.momd/XRPackageModel 9.0.omo'

Could not find Apple TV simulator
```

The cli tool should launch the tvOS application on the simulator.

The user get's an error message saying "Could not find Apple TV simulator"

Don't ignore appletv simulators when looking for simulators to launch. Also use the correct application build when selecting which app to launch on the simulator/device.

Added automated test for `findMatchingSimulator.js` to allow tvOS simulators

[react-native-cli] Fixed issue where you cannot launch tvOS app on Apple TV simulator
Closes https://github.com/facebook/react-native/pull/17660

Differential Revision: D6806327

Pulled By: hramos

fbshipit-source-id: 1a4f37058f3c5d8223012a3e4050e7bbfaafa6c4
2018-01-29 13:48:13 -08:00
Logan Daniels ae2d5b1e68 Nested virtualized lists should receive recordInteration events
Summary:
Right now when an interaction is recorded on a parent VirtualizedList, the interaction isn't passed on to its children. That means that if `waitForInteraction` is set to true for a child list's viewability helper, it will never trigger a VPV.

This change adds forwarding of these events inside `onBeginScrollDrag`. It also forwards the interaction state of the parent list at register time, in case a child list is rendered mid-scroll.

Reviewed By: sahrens

Differential Revision: D6822091

fbshipit-source-id: dfe300e42722d4285f65787ab2c1368f050c5577
2018-01-29 12:13:58 -08:00
Janic Duplessis ecaca80d42 Support sticky headers for inverted Lists
Summary:
Sticky headers for inverted lists should still stick at the top of the list instead of the bottom.

Tested by adding the inverted prop to the SectionList example in RNTester.

It does add a prop to ScrollView but it's very specific to the inverted list implementation, not sure if it should be documented.

[GENERAL][ENHANCEMENT][LISTS] -  Support sticky headers for inverted Lists
Closes https://github.com/facebook/react-native/pull/17762

Differential Revision: D6830784

Pulled By: sahrens

fbshipit-source-id: 6841fdd46e04b30547659d85ff54c3a21c61a8a2
2018-01-29 11:46:26 -08:00
Dmitry Zakharov 429fcc8cab Migrate DeviceInfoModule from RN Module to Native Function.
Reviewed By: danzimm

Differential Revision: D6750934

fbshipit-source-id: f453801737e41632c6b84ff894e7f0eb66b575dc
2018-01-29 11:18:42 -08:00
Alexey Lang 6224ef5301 Measure time to create ReactInstanceManager
Reviewed By: fkgozali

Differential Revision: D6591797

fbshipit-source-id: 7345b7c772eb4ae35ad570082090fbdf704102d3
2018-01-29 11:07:39 -08:00
Valentin Shergin e3ff3cf6cb Removed outdated assertion in RCTShadowView related to breaking change in Yoga
Summary: It's been more than two years; I think everyone already migrated and learned the new behavior.

Reviewed By: emilsjolander

Differential Revision: D6829885

fbshipit-source-id: a86d56fb7235a137e9ce6e360d7ae2224b047313
2018-01-29 10:47:14 -08:00
Vojtech Novak ed5872e2cc Make sure refreshControl shows up on initial render if specified
Summary:
[this commit](2e1707d0e6) which was just a small refactor broke refreshControl behavior - if we render FlatList with refreshing=true, the refreshControl won't be visible on initial render.

The problem is, the [previous beginRefreshing method](2e1707d0e6 (diff-cfafa8d7e42ab87ab863f917e187a4aeL51)) was renamed to `beginRefreshingProgramatically` and the old call was left in one place [here](2e1707d0e6 (diff-cfafa8d7e42ab87ab863f917e187a4aeR47)).

Now, I am not sure what kind of jumping the mentioned commit was fixing, but since this fix only concerns the initial render, I believe it will not influence the jumping fix.

I have tested this locally in my app, can provide a video if needed.

none

 [IOS] [BUGFIX] [RefreshControl] - Make sure refreshControl shows up on initial render if specified
Closes https://github.com/facebook/react-native/pull/17727

Differential Revision: D6827402

Pulled By: shergin

fbshipit-source-id: 25849244e87af54f25d636b6ade7adcf88958980
2018-01-28 22:29:51 -08:00
hovox 2fef1bafc8 GLog fix on case sensitive APFS macOS
Summary:
<!--
Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html

Happy contributing!

-->

This will fix compile error on case sensitive APFS(Apple File System) macs.

Integrate  RN on case sensitive formatted macOS via cocoa pods you will get compile errors on the include lines something like :
```
         ^~~~~~~~~~~~~~~~
1 error generated.
** BUILD FAILED **
```

If you change `#include <glog/logging.h>` into `#include <GLog/logging.h>` (replace `glog` with `GLog`) it will fix the build error. After fixing this you will get same kind of errors on a few other places.

[IOS] [BUGFIX] [Framework] - `GLog` fix on case sensitive APFS macOS
Closes https://github.com/facebook/react-native/pull/17697

Differential Revision: D6832740

Pulled By: shergin

fbshipit-source-id: 0c7a01f33fde35dbc8004c5bb6e5b22f8f0ea369
2018-01-28 22:29:51 -08:00
Moti Zilberman be7037fd8e Test and document Image resizeMode=center on iOS
Summary:
`<Image resizeMode="center">` already works on iOS (implemented in #8792), but is neither tested nor documented the way the other `resizeMode` values are.

This PR primarily enables the relevant RNTester case on iOS, and secondarily copies over the doc comment from `Image.android.js` to `Image.ios.js`. A PR to `react-native-website` will follow shortly and it is there I will try and revise the wording a bit.

Updated RNTester screenshot (iOS):

<img src=https://user-images.githubusercontent.com/2246565/35470720-44b38282-0357-11e8-941c-1b3c5a1b2f3b.png width=300>

react-native-website PR coming soon.

[IOS] [MINOR] [Image] - Include resizeMode=center in RNTester
Closes https://github.com/facebook/react-native/pull/17759

Differential Revision: D6829051

Pulled By: hramos

fbshipit-source-id: c6e0000a75765e8bf3a1d0306aaafad002b14a58
2018-01-27 11:45:12 -08:00
Nico 29f8354c19 Prevents JS Debugger issues with CORS
Summary:
<!--
Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html

Happy contributing!

-->

See #17618

On certain networks, `xip.io` is used, but as the debugger will always using localhost a change upstream has resulted in a CORS issue (see screenshots in #17618). This change ensures that the debugger will always open with whatever configuration.

> This should be merged in as a patch of `0.52.x` as it affects current release, and `0.51.x` didn't have this issue.

Tested locally, could do with the people having the same issue in #17618 testing it out prior to merging.

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/react-native-website, and link to your PR here.)

<!--
Help reviewers and the release process by writing your own release notes

**INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**

  CATEGORY
[----------]        TYPE
[ CLI      ]   [-------------]      LOCATION
[ DOCS     ]   [ BREAKING    ]   [-------------]
[ GENERAL  ]   [ BUGFIX      ]   [-{Component}-]
[ INTERNAL ]   [ ENHANCEMENT ]   [ {File}      ]
[ IOS      ]   [ FEATURE     ]   [ {Directory} ]   |-----------|
[ ANDROID  ]   [ MINOR       ]   [ {Framework} ] - | {Message} |
[----------]   [-------------]   [-------------]   |-----------|

[CATEGORY] [TYPE] [LOCATION] - MESSAGE

 EXAMPLES:

 [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
 [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
 [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
 [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
 [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
 [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->

[CLI] [BUGFIX] [local-cli/server/middleware/getDevToolsMiddleware.js] - Prevents JS Debugger issues with CORS
Closes https://github.com/facebook/react-native/pull/17720

Differential Revision: D6828205

Pulled By: hramos

fbshipit-source-id: 7e5d43db9faf7edc9444ba4214aca1a18e25dbd2
2018-01-27 02:36:12 -08:00
Jani Eväkallio 8aa568e867 Fix Xcode Archive task failing if project path contains whitespace
Summary:
Currently, Xcodebuild Archive task "Bundle React Native code and images" step fails if the project path contains whitespace characters. This is due to `react-native-xcode.sh` not escaping the local CLI path.

Ideally, of course, folks would use sane directory names, but this affects people in the community. I have seen this at a beginner hackathon, as well as Stack Overflow, e.g. https://stackoverflow.com/questions/48209829/cannot-create-offline-bundle-for-react-native-ios

```
mkdir Bad\ Name
cd Bad\ Name
react-native init TestProject
cd TestProject
open ios/TestProject.xcodeproj
```
* Run `Build > Archive`
* `cli.js bundle` command fails with "Cannot find module '.../Bad'"

* Patch `/node_modules/react-native/scripts/react-native-xcode.sh` with changed file
* Run `Build > Archive`
* Build succeeds

<!--
Help reviewers and the release process by writing your own release notes

**INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**

  CATEGORY
[----------]        TYPE
[ CLI      ]   [-------------]      LOCATION
[ DOCS     ]   [ BREAKING    ]   [-------------]
[ GENERAL  ]   [ BUGFIX      ]   [-{Component}-]
[ INTERNAL ]   [ ENHANCEMENT ]   [ {File}      ]
[ IOS      ]   [ FEATURE     ]   [ {Directory} ]   |-----------|
[ ANDROID  ]   [ MINOR       ]   [ {Framework} ] - | {Message} |
[----------]   [-------------]   [-------------]   |-----------|

[CATEGORY] [TYPE] [LOCATION] - MESSAGE

 EXAMPLES:

 [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
 [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
 [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
 [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
 [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
 [INTERNAL] [FEATURE] [./scrip] - Added thing to script that nobody will see
-->

 [IOS] [MINOR] [scripts/react-native-xcode.sh] - Escape directory paths with spaces
Closes https://github.com/facebook/react-native/pull/17628

Differential Revision: D6806418

Pulled By: hramos

fbshipit-source-id: 7ef3943d91807d0086f0717e436e1988f9faf03d
2018-01-26 13:47:37 -08:00
Satyajit Sahoo be56a3efee Implement Blob support for XMLHttpRequest
Summary:
This PR is a followup to https://github.com/facebook/react-native/pull/11417 and should be merged after that one is merged.

  1. Add support for creating blobs from strings, not just other blobs
  1. Add the `File` constructor which is a superset of `Blob`
  1. Add the `FileReader` API which can be used to read blobs as strings or data url (base64)
  1. Add support for uploading and downloading blobs via `XMLHttpRequest` and `fetch`
  1. Add ability to download local files on Android so you can do `fetch(uri).then(res => res.blob())` to get a blob for a local file (iOS already supported this)

  1. Clone the repo https://github.com/expo/react-native-blob-test
  1. Change the `package.json` and update `react-native` dependency to point to this branch, then run `npm install`
  1. Run the `server.js` file with `node server.js`
  1. Open the `index.common.js` file and replace `localhost` with your computer's IP address
  1. Start the packager with `yarn start` and run the app on your device

If everything went well, all tests should pass, and you should see a screen like this:

![screen shot 2017-06-08 at 7 53 08 pm](https://user-images.githubusercontent.com/1174278/26936407-435bbce2-4c8c-11e7-9ae3-eb104e46961e.png)!

Pull to rerun all tests or tap on specific test to re-run it

  [GENERAL] [FEATURE] [Blob] - Implement blob support for XMLHttpRequest
Closes https://github.com/facebook/react-native/pull/11573

Reviewed By: shergin

Differential Revision: D6082054

Pulled By: hramos

fbshipit-source-id: cc9c174fdefdfaf6e5d9fd7b300120a01a50e8c1
2018-01-26 09:17:11 -08:00
Tim Yung 3fc33bb54f RN: Add Missing Start/End Style Types
Reviewed By: shergin

Differential Revision: D6813953

fbshipit-source-id: eed5dcaa2b6f4101f03d7fe1fca9d20c0f6a6429
2018-01-25 22:01:05 -08:00
Valentin Shergin 7d1ec7a3dc Fixed a bug when <Text> does not redraw native view on relayout
Summary: `contentFrame` is now always provided by shadow thread (with attributed string and embedded views), so we have to update it on every single relayout.

Reviewed By: yungsters

Differential Revision: D6817401

fbshipit-source-id: c2a1f314f34a2187053eb11ce0744c935edbb8ae
2018-01-25 21:33:20 -08:00
Andy Toulouse 2a3c37f424 Give IInspector a virtual destructor for correct InspectorImpl destruction
Reviewed By: bnham

Differential Revision: D6815637

fbshipit-source-id: bfd3bd4a664ec51d5364df512bfc9bc366f516c1
2018-01-25 20:31:58 -08:00
4ndroidev 7b1915e74d Fix NPE in Android Switch during measure
Summary:
<!--
Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html

Happy contributing!

-->

Fixes #16000

see [Issue #16000](https://github.com/facebook/react-native/issues/16000)
fix a null pointer exception while using higher version 'com.android.support:appcompat-v7'

N/A

[ANDROID][BUGFIX][Switch] - Fix NPE in Android Switch during measure
Closes https://github.com/facebook/react-native/pull/16064

Differential Revision: D6816122

Pulled By: hramos

fbshipit-source-id: ba9a6febad4884b8ab142d8c7142085367006904
2018-01-25 18:00:09 -08:00
Job Vranish 40a8434bde Removed use of xip.io, as it's not needed.
Summary:
By default, when a react-native app launches in development mode on a physical iOS device, it attempts to load the JS bundle from a packager at `http://_your-local-ip-address_.xip.io:8081/`.

This change removes the use of `xip.io`, which changes that url to: `http://_your-local-ip-address_:8081/`

<!--
Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html

Happy contributing!

-->

Background:
The automatic IP detection feature (introduced [here](https://github.com/facebook/react-native/pull/8091)) is super handy. However, it’s use of `xip.io` has caused myself and others much grief.  Some routers do not allow or have intermittent errors when trying to resolve DNS names to local IP addresses. This prompted the introduction of a [DISABLE_XIP feature](https://github.com/facebook/react-native/pull/13326), which helps.

However, I don’t believe the use of `xip.io` is needed at all.

Based on [this comment](8c29a52c54 (commitcomment-18224788)), it appears the original reason for using `xip.io` was to “circumvent the numeric IP address limitation in ATS”.

But, the reason you can’t create ATS exceptions for raw IP addresses is that ATS is not enforced for raw IP addresses _at all_. You can read the Apple documentation [here](https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html), the relevant portion is:

> App Transport Security (ATS) applies only to connections made to public host names. The system does not provide ATS protection to connections made to:
> * Internet protocol (IP) addresses
> * Unqualified host names
> * Local hosts employing the .local top-level domain (TLD)

For example, in iOS, if you attempt to make an http request (note: _not_ https) to `http://www.google.com` you will get an error due to ATS.
However, you can make the same request to `http://172.217.6.14/`  (which for me is the same server) and the request will succeed.

And in fact, if an ATS exception _was_ needed, the DISABLE_XIP feature shouldn’t work at all, but it does.

In short, using `xip.io` with ATS exceptions is unnecessary, causes some very annoying problems for some people, and I think it should just be removed.

Run the app on a physical iOS device and verify that it can load the JS bundle from the host computer's IP.

[Implemented automatic IP detection for iOS #8091](https://github.com/facebook/react-native/pull/8091)
[Added option to disable xip #13326](https://github.com/facebook/react-native/pull/13326)

<!--
Help reviewers and the release process by writing your own release notes

**INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**

  CATEGORY
[----------]        TYPE
[ CLI      ]   [-------------]      LOCATION
[ DOCS     ]   [ BREAKING    ]   [-------------]
[ GENERAL  ]   [ BUGFIX      ]   [-{Component}-]
[ INTERNAL ]   [ ENHANCEMENT ]   [ {File}      ]
[ IOS      ]   [ FEATURE     ]   [ {Directory} ]   |-----------|
[ ANDROID  ]   [ MINOR       ]   [ {Framework} ] - | {Message} |
[----------]   [-------------]   [-------------]   |-----------|

[CATEGORY] [TYPE] [LOCATION] - MESSAGE

 EXAMPLES:

 [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
 [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
 [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
 [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
 [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
 [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
 [INTERNAL] [BUGFIX] [./scripts] - Removed use of xip.io
Closes https://github.com/facebook/react-native/pull/17642

Differential Revision: D6814609

Pulled By: hramos

fbshipit-source-id: f2faebd6a29b0b211d78cdfe8e195906307ab552
2018-01-25 16:46:46 -08:00
Valentin Shergin 46fd864348 Proper attributed strings comparsion in RCTBaseTextInputView
Summary:
Now, in the new model, we transfer text attributes with actual text via attributed text to a native text component,
so previous text-only comparsion is not sufficient anymore.

Depends on D6600685.

Differential Revision: D6809833

fbshipit-source-id: 475b7426cf3c6694781790d99ef32466606da2f2
2018-01-25 13:47:35 -08:00
Rafael Oleza e9b83e608e Bump metro@0.24.7
Summary: Releasing a new version of metro with an executable CLI

Reviewed By: davidaurelio

Differential Revision: D6808207

fbshipit-source-id: 68f6522924ea8ad7b6f9aaa3e952ebcf23d2cf8b
2018-01-25 09:49:40 -08:00
Michael Lee 869866cc5c Continue wrapping functions as we prepare for skylark
Differential Revision: D6808010

fbshipit-source-id: f24e71558baed2c2da319e20e0faf66858eb27d5
2018-01-25 09:30:00 -08:00
David Aurelio df6c48cf36 `babel-preset-react-native`: only require plugins once
Reviewed By: cpojer

Differential Revision: D6795591

fbshipit-source-id: 30b689e2cf72a4bf4bdae49113369ef536ed81d6
2018-01-25 02:45:43 -08:00
Hogyun Yu  (aka Philographer) b9d058a05c Remove references to Travis
Summary:
react-native project is migrated travis to circleCI.
but the document has some leavings.

Only Docs Edited

https://github.com/facebook/react-native/pull/16354
https://github.com/facebook/react-native/pull/16364

[ DOCS] Remove references to Travis
changed Releases.md
changed RNTester/RNTesterIntegrationTests/RNTesterSnapshotTests.m
changed scripts/android-e2e-test.js
Closes https://github.com/facebook/react-native/pull/17733

Differential Revision: D6806336

Pulled By: shergin

fbshipit-source-id: 22d21995d718a89bb831f75ed2ff6074dd22c6fe
2018-01-24 22:18:34 -08:00
Avik Chaudhuri 298f3bb69a @allow-large-files flow 0.64 release
Reviewed By: gabelevi

Differential Revision: D6800250

fbshipit-source-id: 7c0902526cce77eb6931856ac24a0560c4fbbc88
2018-01-24 17:03:41 -08:00
Valentin Shergin 2716f53220 The New <Text> on iOS
Summary:
This is a complete rewrite of RCTText, the part of React Native which manages Text and TextInput components.

Key points:

* It's understandable now. It follows a simple architectural pattern, and it's easy to debug and iterate. Text flow layout is a first-class citizen in React Native layout system now, not just a wired special case. It also brings entirely new possibilities such as nested interleaving <Text> and <View> components.
* All <Text>-specific APIs were removed from UIManager and co (it's about ~16 public methods which were used exclusively only by <Text>).
* It relies on new Yoga measurement/cloning API and on-dirty handler. So, it removes built-in dirty propagation subsystem from RN completely.
* It caches string fragments properly and granularly on a per-node basis which makes updating text-containing components more performant.
* It does not instantiate UIView for virtual components which reduces memory utilization.
* It drastically improves <TextInput> capabilities (e.g. rich text inside single line <TextInput> is now supported).

Screenshots:
https://cl.ly/2j3r1V0L0324
https://cl.ly/3N2V3C3d3q3R

Reviewed By: mmmulani

Differential Revision: D6617326

fbshipit-source-id: 35d4d81b35c9870e9557d0211c0e934e6072a41e
2018-01-24 00:03:01 -08:00
Eli White cd263a2cc7 Backed out changeset 409acf8d3356
Differential Revision: D6789941

fbshipit-source-id: 30d431727a4615208f51293d071f9334584a2269
2018-01-23 19:26:03 -08:00
Michael Lee 42c410ac84 Fix permissions on test script
Reviewed By: yungsters

Differential Revision: D6791810

fbshipit-source-id: 849cffd3810eb53a6050e5e1a37d84a5e4ccb62a
2018-01-23 17:01:40 -08:00
Sergei Dryganets 0c18ec5b9c Popups calling error callback instead of crashing if view with passed tagId not found
Summary:
The showPopup method has an error callback. For some reason, it is asserting in case the wrong tagId is passed instead of calling the error callback on Android.

Pass not existing tagId to showPopup method and make sure it is receiving an error in js instead of crashing in native on Android.

[ANDROID] [MINOR] showPopup method calls error callback instead of crashing on errors.
Closes https://github.com/facebook/react-native/pull/17550

Differential Revision: D6776014

Pulled By: hramos

fbshipit-source-id: 1d97b762818d1591018fd43556eb41c3fb491eb9
2018-01-23 14:07:25 -08:00