Commit Graph

14635 Commits

Author SHA1 Message Date
Justin Chapman d154e9ec9d Allow for undefined userConfig (#18660)
Summary:
Fixes #18249

This PR fixes an error that occurs when running `react-native link` in projects laid out as described on the React Native website section on integrating with existing apps (https://facebook.github.io/react-native/docs/integration-with-existing-apps.html) where an `ios/` subdirectory exists but an `android/` subdirectory does not exist

<img width="1050" alt="screenshot 2018-04-02 14 57 27" src="https://user-images.githubusercontent.com/2475286/38210733-3f4bd9ea-3686-11e8-9bd3-d299812a015c.png">

None

[CLI] [BUGFIX] [local-cli/core/android/index.js] - Allow for undefined userConfig
Pull Request resolved: https://github.com/facebook/react-native/pull/18660

Differential Revision: D9235171

Pulled By: hramos

fbshipit-source-id: 230dd54f8911046f7e01633f99c4f02070fa0172
2018-08-08 21:16:57 -07:00
Eli White 370e0db970 Move View native require call to new file
Summary: Moving out the requireNativeComponent call into a new file. We want this long term for all of our view managers to support codegen of the native side and so we can move the viewConfigs into JS.

Reviewed By: yungsters

Differential Revision: D9231619

fbshipit-source-id: 7c89587cc6a76e92b309c4941577291e56af8c7c
2018-08-08 18:46:53 -07:00
Johannes Baldursson 610412385b Exposed scrollEnabled on TextInput (#19330)
Summary:
On iOS, it is not possible to select a range of text using a `Text` component (see #13938). Because of how the `Text` component is implemented on iOS, this will not work without a complete re-write. On Android however, this is not an issue.

As the `TextInput` component has evolved, it can more or less be used as a drop-in replacement on iOS by setting `multiline={true}` and `editable={false}`. Except for one detail: the text input field has scrolling activated and it's not possible to turn off. (See #1391 and #15962).

This pull request addresses that issue, simply by exposing the `scrollEnabled` property:

```
<TextInput
    multiline
    editable={false}
    scrollEnabled={false}
  />
```

1. Create a multiline `TextInput` component, with the attributes presented above.
2. Run on iOS
3. The `TextInput` field should not be able to scroll

facebook/react-native-website#367

[IOS] [FEATURE] [TextInput] - Made it possible to turn off scrolling on a multiline TextInput component
Pull Request resolved: https://github.com/facebook/react-native/pull/19330

Differential Revision: D9235061

Pulled By: hramos

fbshipit-source-id: 99d278004fc236b47dde7e61d74c71e8a3b9d170
2018-08-08 18:46:53 -07:00
Steven Cable b21d4914de Check return code from malloc (#20173)
Summary:
Calls abort() in cases where malloc returns NULL.

Checking the return value from malloc is good practice and is
required to pass a [Veracode security scan](https://www.veracode.com/). This will let
developers who are required to submit their software to Veracode
use React Native.
Pull Request resolved: https://github.com/facebook/react-native/pull/20173

Differential Revision: D9235096

Pulled By: hramos

fbshipit-source-id: 9fdc97f9e84f8d4d91ae59242093907f7a81d286
2018-08-08 18:32:19 -07:00
rainywan 03663491c6 remove code relating to Nesting of <View> within <Text>, which result… (#20558)
Summary:
…s a crash in Text Example of RNTester.

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.

If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged.
Pull Request resolved: https://github.com/facebook/react-native/pull/20558

Differential Revision: D9235009

Pulled By: hramos

fbshipit-source-id: 23ed28f7c8b84f509d35ac0fe7aa72c183a9ab11
2018-08-08 18:16:55 -07:00
Eli White 457a74cbc2 Move Switch native require call to new file
Summary: Moving out the requireNativeComponent call into a new file. We want this long term for all of our view managers to support codegen of the native side and so we can move the viewConfigs into JS.

Reviewed By: yungsters

Differential Revision: D9191214

fbshipit-source-id: d0bddbb50bb1cf6b5a727d72faf834b007ad9440
2018-08-08 15:03:01 -07:00
gengjiawen 51b12dd375 fix gradle wrapper issue (#19976)
Summary:
Just change gradle.properties version number to change gradle version is not the right way. Because sometimes the gradlew and gradlew.bat or even the jar need to be updated too.
I also add the wrapper task to `build.gradle`, so next time, we just need to change the version number and execute `gradlew wrapper`.
pass all current ci.
none
 [GENERAL] [BUGFIX] [Android] - fix gradle wrapper issue
Pull Request resolved: https://github.com/facebook/react-native/pull/19976

Differential Revision: D9229655

Pulled By: hramos

fbshipit-source-id: 63d1ddea6174f87778612a4e6711baac5787b0f8
2018-08-08 15:03:01 -07:00
Yury Zholobov 9b5b07f97f add Image border*Radius tests
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/20264

Differential Revision: D9228814

Pulled By: TheSavior

fbshipit-source-id: cad4c15e8070c7ab2023c20045b82f7ab3f994cf
2018-08-08 14:32:49 -07:00
Ram N 617e25d9b5 Explicitly make UIManagerModule use OnBatchComplete on Android
Summary:
Currently, we scan all native modules to see if they implement the OnBatchCompleteListerner. If they do, we add those modules to a list, and when C++ calls OnBactchComplete is called, we execute the callback on each of the modules.
The only native module implementing this callback today is the UIManagerModule. With Fabric, UIManager will also not be a native module anymore. This diff removes all the work done for creating the list and assumes that UIManagerModule is the only place that is interested in OnBatchComplete call - and calls it directly.

Reviewed By: achen1

Differential Revision: D9186651

fbshipit-source-id: 473586b37c2465ccd041985dcdd56132026f34f1
2018-08-08 14:18:07 -07:00
Dulmandakh 69912495f9 Bump imagepipeline-okhttp3 to 1.10.0 (#20580)
Summary:
This is a small missing piece from b6f2aad9c0 and will complete fresco version bump.
Pull Request resolved: https://github.com/facebook/react-native/pull/20580

Differential Revision: D9228658

Pulled By: hramos

fbshipit-source-id: 9cf1509a590cedfe4c3358006cfb62533058e946
2018-08-08 14:02:26 -07:00
Jordan Brown 0101a98af2 add RN github .flowconfig.android and platform specific fixme sites
Summary:
Adds a .github.flowconfig.android.

Also, adds the optional _ios and _android to the sites.

Reviewed By: TheSavior

Differential Revision: D9189935

fbshipit-source-id: 5274701b9425525337d5c4684ce4ffee841fef52
2018-08-08 12:31:37 -07:00
Jordan Brown b64b9dbece Replace '@flow strict(-local)' with '@flow' in .android.js files
Summary:
Flow doesn't check .android.js files yet anyway.

I'm going to be adding suppressions in a followup diff. It would be nice to not have >1k suppressions saying that we can't do certain things in `flow strict` when we don't even typecheck with regular `flow` just yet

I ran these commands to produce this diff:
`find . -name '*.android.js' -exec sed -i 's/flow strict-local/flow/g' {} +`
`find . -name '*.android.js' -exec sed -i 's/flow strict/flow/g' {} +`

Followed https://unix.stackexchange.com/questions/112023/how-can-i-replace-a-string-in-a-files to do it.

The controller you requested could not be found.

Reviewed By: TheSavior

Differential Revision: D9143783

fbshipit-source-id: e9af4fe695ebdba4db4083de1697cc248d48eb0d
2018-08-08 10:48:19 -07:00
Miguel Jimenez Esun 8f7372fe1b Fix "http" monkeypatch
Summary:
Some time ago I had to add a monkeypatch to the `http` library to enforce IPv6, due to the lack of support in Node for that. In version 2.2.0 of `node-fecth`, this has been fixed, and `family: 6` can be enforced via `agent`, which is what this diff does.

I also simplified `Promise` handling at the `test-console-call` level by removing an un-needed `.then()` nesting.

Reviewed By: rafeca

Differential Revision: D9200515

fbshipit-source-id: fe06acddd8e3539f590f88eef3468b02c4242afc
2018-08-08 03:46:22 -07:00
Ziqi Chen 893e4d19a9 Added 5 examples of new Accessibility API to RN Tester on Android
Summary:
I added three examples to the RN Tester in order to test the new accessibility props I've added to the accessibility API.

These examples test the following properties on views and touchables:
* AccessibilityRole
* AccessibilityStates
* AccessibilityHint

Reviewed By: PeteTheHeat

Differential Revision: D9167874

fbshipit-source-id: 4971b9ae43ad4f35c6be7e8548cc31393c3f0a33
2018-08-08 01:31:46 -07:00
Ziqi Chen 91b3a3055a changed documentation for accessibilityHint
Summary:
Changed documentation for accessibility Hint so that its no longer only available on iOS

Also added full description of documentation for accessibility Role as it was missing earlier

Reviewed By: PeteTheHeat

Differential Revision: D9072572

fbshipit-source-id: c8d20f30df588717d9ec37721c2aa3c86a0664c6
2018-08-08 01:31:46 -07:00
Ziqi Chen d3f0919816 added accessibilityHints implementation on Android
Summary:
Implemented a version of accessibility Hints on android by adding hint text to the end of contentDescription. There is already an existing prop on js and iOS implementation.

Changes involve:
* adding a prop on native android code for accessibilityHints
* setting the accessibilityDelegate after the props are all loaded.
* Instead of directly updating the accessibility delegate, the prop setters now update state by setting the values of the variables. Once all props are set, the accessibility delegate is set based on the props
   * BaseViewManager keeps track of whether or not accessibility props have been set
   * AccessibilityDelegateUtil keeps track of what the props have been set to. (Renamed AccessibilityRoleUtil to AccessibilityDelegateUtil)

Currently, this is the easiest way of emulating the way accessibility hints work on iOS, and I think having an android counter part is better than having nothing.

It's different from iOS in that it will announce the hint before the role, and also cannot be turned off.

Ex:

if I set the accessibility like this:
```
      <View
        style={styles.container}
        accessible={true}
        accessibilityLabel="accessibility label"
        accessibilityRole="button"
        accessibilityStates={['selected']}
        accessibilityHint="accessibility Hint">
        <Text> Tester </Text>
      </View>
```

Talk back will read:
`accessibility label, accessibility Hint, button, selected`

In the future for next steps, I plan on investigating the process of making a second announcement after the first

Reviewed By: achen1

Differential Revision: D9037226

fbshipit-source-id: 8d484e1114eb69aa5f5314b3755b351b8ea80b09
2018-08-08 01:02:24 -07:00
gengjiawen cf3cdeeb90 switch to yarn in appveyor (#20566)
Summary:
switch to yarn to keep consistent. Windows android  build pass: https://ci.appveyor.com/project/gengjiawen/react-native/build/job/xyof6052yg2uhnmw.
pass all current ci.
none
 [GENERAL] [INTERNAL] [CI] - switch to yarn.
Pull Request resolved: https://github.com/facebook/react-native/pull/20566

Differential Revision: D9213415

Pulled By: hramos

fbshipit-source-id: 35183c143f831e29aa0d0c0b90baacb6a7cd7837
2018-08-07 21:46:39 -07:00
Kevin Gozali 235d9017cf added small UI indicator for fabric-based surfaces
Summary: To make debugging/testing easier, optionally display fabric label on the top-right of the surface if it's rendered on fabric mode.

Reviewed By: mdvacca

Differential Revision: D9206473

fbshipit-source-id: ef6f0396ff749f2a0415688b1cf4fe1a4b83124d
2018-08-07 21:35:54 -07:00
Joshua Wang c298e0ae06 Update template to Xcode 9.4 and fix project settings warnings (#19626)
Summary:
Motivation: Fix Xcode Project Settings Warnings
![screenshot 2018-06-08 10 58 23](https://user-images.githubusercontent.com/5353594/41173274-1a4fbb3e-6b0b-11e8-973b-8290794a4f8b.png)

Should still build and pass all tests since project settings changes should be safe changes.

No documentation change is required

[IOS][MINOR][XcodeProjs] Upgraded Project settings to be compatible with Xcode 9.4
Pull Request resolved: https://github.com/facebook/react-native/pull/19626

Differential Revision: D9211230

Pulled By: hramos

fbshipit-source-id: ef8692871bffbdb5dd0214f65220fd171c203c6c
2018-08-07 19:46:23 -07:00
Mayank Patke ccf5dfbe3f v0.78 in fbsource
Summary: The controller you requested could not be found.

Reviewed By: pakoito

Differential Revision: D9174188

fbshipit-source-id: 4ec9ef5b6f802964a83b6bc0bd29db7f47b37c21
2018-08-07 16:03:09 -07:00
Janic Duplessis 476a831ea0 Un-deprecate TextInput.State.focusTextInput and TextInput.State.blurTextInput (#20326)
Summary:
In https://github.com/facebook/react-native/pull/18936 we decided to deprecate `focusTextInput` and `blurTextInput` but since then I found a valid use case for it that is pretty much impossible to implement otherwise.

React Navigation uses it to blur / re-focus the input during the swipe back gesture. Blur can be done with Keyboard.dismiss but without this api we cannot re-focus the text field that was focused if the swipe back gesture is cancelled. See https://github.com/react-navigation/react-navigation/blob/master/src/navigators/createKeyboardAwareNavigator.js#L21-L34

I think it is best to just bring back this api.
Pull Request resolved: https://github.com/facebook/react-native/pull/20326

Differential Revision: D9182810

Pulled By: hramos

fbshipit-source-id: 3740421ffafb8f814522d15788f3466324177c16
2018-08-06 15:01:50 -07:00
Héctor Ramos fb223e7675 Consolidate e2e steps and run Detox tests before e2e (#20550)
Summary:
Run Detox before the flaky e2e iOS tests in order to get better signal.
Pull Request resolved: https://github.com/facebook/react-native/pull/20550

Differential Revision: D9183655

Pulled By: hramos

fbshipit-source-id: e499daad86249961cd6d0b8fc22c846392622056
2018-08-06 13:02:58 -07:00
Tvrqvoise 6d65e8b4ed Add support for linking scoped packages (#18766) (#19828)
Summary:
Currently, when the cli tries to determine the package name, it accidentally trims out the entire package name.  This makes it appear to the rest of the program as if `react-native link The controller you requested could not be found./my-package` was just `react-native link`.  This adds a little regex to prevent that from happening, so that scopes can be passed as parts of packages.

Fixes #18766
Pull Request resolved: https://github.com/facebook/react-native/pull/19828

Differential Revision: D8704742

Pulled By: hramos

fbshipit-source-id: d8183f9b55e8656b8a0acae842e1361a1f428102
2018-08-06 12:32:25 -07:00
Tom Atterton 5219585ef9 Ignore DevDependencies when generating template. (#20542)
Summary:
Regarding [Add devDependenices support for templates](c4ab03a18e).

Once a project is created using the custom template command with devDependencies inside, the devDependenices.json file is also copied to the new projects directory.

By adding this to the ignore paths we stop the devDependenices being copied into the new projects directory.
Pull Request resolved: https://github.com/facebook/react-native/pull/20542

Differential Revision: D9182795

Pulled By: hramos

fbshipit-source-id: 543c8ca67612a981c22fc83c8d54a25ddc0ca5fc
2018-08-06 12:32:24 -07:00
David Aurelio 151ec411aa Back to JNI storage
Summary:
@public

This reverts the Yoga/Java storage experiment. I will follow up with any learnings.

Reviewed By: pasqualeanatriello

Differential Revision: D9168405

fbshipit-source-id: fb227fb9353bd4c4e3bebbe9b04eec1132e532e8
2018-08-06 02:16:22 -07:00
David Aurelio 73d5746122 Add `Unsafe` based storage backend
Summary:
@public

Adds another version of property storage for `YogaNode`, using `sun.misc.Unsafe`.

Adopts the stub concept from Litho for `Unsafe`, as it is hidden by the Android SDK.

Reviewed By: pasqualeanatriello

Differential Revision: D9140103

fbshipit-source-id: a4b376eca341b724a00f873467ae8bf8eaac69f4
2018-08-05 16:46:26 -07:00
Valentin Shergin 1d93d70af4 Fabric: `ShadowNodeCloneFunction` signature was unified with ShadowNode copy constructor
Summary:
@public
Now it accepts `const ShadowNode &` instead of `std::shared_ptr<const ShadowNode>` which is more reasonable (and more performant) becasue the function must not retain ownershipt.

Reviewed By: mdvacca

Differential Revision: D9073921

fbshipit-source-id: c24c475615e0f81b3e004e118dea7565d8e757b4
2018-08-04 09:47:31 -07:00
Valentin Shergin 6230147e73 Fabric: Removed unnecessary `YGValue::operator==`
Summary:
@public
We backported that into Yoga recently, so we don't need it here anymore.

Reviewed By: mdvacca

Differential Revision: D8988439

fbshipit-source-id: 01a538ff291e25d92eeb01b1fdee3a6868b2448b
2018-08-04 09:47:31 -07:00
Valentin Shergin 3770d4df45 Fabric: Using `const &` type for `ShadowNodeFragment`'s fields
Summary:
@public
To avoid unnecessary copying of `shared_ptr`s inside ShadowNodeFragment, now we store them as `const &` references.

Reviewed By: mdvacca

Differential Revision: D8988388

fbshipit-source-id: 0b3582e57ce7577b8fa819392bf33f34e1a60b59
2018-08-04 09:47:31 -07:00
Valentin Shergin 06e62440d3 Fabric: Using `ShadowNodeFragment` in `ComponentDescriptor`
Summary:
@public
Now we use same data structure to specify a shape of shadow node as we use in ShadowNode (sub)clases.

Reviewed By: mdvacca

Differential Revision: D8988387

fbshipit-source-id: 475298b2c71ee7ee2b197db009f7b8313b54f5df
2018-08-04 09:47:30 -07:00
Valentin Shergin 52ed882332 Fabric: Using `const ShadowNode &` as a parameter in ShadowNode copy constructor
Summary:
@public
When we copy-construct ShadowNode, we don't need to retain a source shadow node, so there is no need to pass it as a `shared_ptr`. Passing an argument to constructor as `const &` is also more idiomatic in C++.

Reviewed By: mdvacca

Differential Revision: D8988384

fbshipit-source-id: 1279d9185fa1b4b82fd26e3040bd62fa9495b4d3
2018-08-04 09:47:30 -07:00
Valentin Shergin 938e1d51c4 Fabric: ShadowNode::children_ is now managed in copy-on-write manner
Summary:
@public
ShadowNode class is designed to share `props` and `children` objects between instances. Given that all *Props classes are immutable, it's very easy to share them and we do this from the day one. The `children_` collection is more tricky though because ShadowNode class has a couple of mutation methods. Previously, we dealt with it very simply by copying the whole vector in constructors, and that was far from optimal. Now we store a special flag that indicates that the children list is shared among nodes, and we clone this before the first mutation.
Sharing a `shared_ptr` should be much more efficient (cost of atomic refcount increment) than instantiating whole new collection (an allocation).

Reviewed By: mdvacca

Differential Revision: D8988386

fbshipit-source-id: cb2f6b2fccac70a35e070a1aa108d135f77cd041
2018-08-04 09:47:30 -07:00
Valentin Shergin d74346b616 Fabric: `ShadowNode::getChildren()` now returns `vector`, not `shared_ptr`
Summary: TBD

Reviewed By: mdvacca

Differential Revision: D8988385

fbshipit-source-id: 1d1c7e0b87b32b242c69bbce44cf70fb0899cf93
2018-08-04 09:47:30 -07:00
Valentin Shergin ca6d263d6d Fabric: ConcreteViewShadowNode::BaseShadowNode type alias
Summary:
@public
Just a type alias to make the code prettier, nothing more.

Reviewed By: mdvacca

Differential Revision: D8988383

fbshipit-source-id: 3f21de0ec0cb9a2270eccfc4a67a3d1108535e42
2018-08-04 09:47:30 -07:00
Valentin Shergin 95074e6c12 Fabric: ShadowNode::Fragment
Summary:
@public
This diff changes a way how we specify a shape of newly created and/or cloned of ShadowNode. Previously we pass those values as a list of arguments, now those values are coupled into a new data structure called ShadowNodeFragment. All that makes suppose to make code much more easy to read and maintain, this is especially important because we want to add a couple of new entities in this set.

Reviewed By: mdvacca

Differential Revision: D8988389

fbshipit-source-id: 1835f646e1ecc6a1f413feaf1900f3d3ad0ebc05
2018-08-04 09:47:30 -07:00
Valentin Shergin 682fd43f3b Fabric: Removed ConcreteShadowNode specialized constructors
Summary:
@public
Apparently we don't need them.

Reviewed By: mdvacca

Differential Revision: D8944766

fbshipit-source-id: e3b78f98d3d805ab0aaf5a167efeb7e058c0394e
2018-08-04 09:47:30 -07:00
Valentin Shergin 67a79010ca Fabric: Simplified way to specialize ComponentName in ConcreteShadowNode class template
Summary:
@public
Previously, all ConcreteShadowNode subclasses had to override `getComponentName()` function to specialize a name of the component. And often it was all that those subclasses do. Now, it's a template argument; and many ShadowNode classes can be created as oneliners via *just* specializing  ConcreteShadowNode template.

Unfortunately, C++ does not allow to use `std::string`s or string literals as template arguments, but it allows to use pointers. Moreover, those pointers must point to some linked data, hence, those values must be declared in .cpp (not .h) files. For simplicity, we put those constants in Props classes, (but this is not a strong requirement).

Reviewed By: mdvacca

Differential Revision: D8942826

fbshipit-source-id: 4fd517e2485eb8f8c20a51df9b3496941856d8a5
2018-08-04 09:47:30 -07:00
Valentin Shergin 88293d391a Fabric: Using `const &` pattern everywhere in RCTConversions
Summary:
@public
Trivial.

Reviewed By: mdvacca

Differential Revision: D8923599

fbshipit-source-id: 06f760ad7940af247ca81396fd48b08fbcd562c6
2018-08-04 09:47:30 -07:00
Valentin Shergin 5d0b51b107 Fabric: Making Sealable debug-only thing
Summary:
@public
Now, Sealable is already error-preventing-only mechanism, no business logic relies on that.
So, it makes sense to make it debug-only to illuminate possible performance impact.

Reviewed By: mdvacca

Differential Revision: D8923597

fbshipit-source-id: 80aa9097c4b719e91de73ac59f38d3a4751f0b06
2018-08-04 09:47:29 -07:00
CFKevinRef da6a5e0439 Better Android Gradle Plugin 3.x integration (#20526)
Summary:
Mirrors #17967 which was imported and reverted

Original:

Better integration with the Android Gradle-based build process, especially the changes introduced by the [Android Gradle Plugin 3.x and AAPT2](https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html).

Fixes #16906, the `android.enableAapt2=false` workaround is no longer required.

Bases the task generation process on the actual application variants present in the project. The current manual process of iterating build types and product flavors could break down when more than one dimension type is present (see https://developer.android.com/studio/build/build-variants.html#flavor-dimensions).

This also exposes a very basic set of properties in the build tasks, so that other tasks can more reliably access them:

```groovy
android.applicationVariants.all { variant ->
    // This is the generated task itself:
    def reactBundleTask = variant.bundleJsAndAssets
    // These are the outputs by type:
    def resFileCollection = reactBundleTask.generatedResFolders
    def assetsFileCollection = reactBundleTask.generatedAssetsFolders
}
```

I've tested various combinations of product flavors and build types ([Build Variants](https://developer.android.com/studio/build/build-variants.html)) to make sure this is consistent. This is a port of what we're currently deploying to our CI process.

[ ANDROID ] [ BUGFIX ] [ react.gradle ] - Support Android Gradle Plugin 3.x and AAPT2
[ ANDROID ] [ FEATURE ] [ react.gradle ] - Expose the bundling task and its outputs via ext properties

Pull Request resolved: https://github.com/facebook/react-native/pull/20526

Differential Revision: D9164762

Pulled By: hramos

fbshipit-source-id: 544798a912df11c7d93070ddad5a535191cc3284
2018-08-03 17:02:12 -07:00
Janic Duplessis 7a0af55674 Enable nullish coalescing in flow config (#20516)
Summary:
Follow up to a9792ac4c8. I assume it's enabled for fb flow config so we can avoid future breakages if someone decide to use this syntax.
Pull Request resolved: https://github.com/facebook/react-native/pull/20516

Differential Revision: D9169244

Pulled By: TheSavior

fbshipit-source-id: 3736d2aed65a0cb4392c175f7d652594cf6a1518
2018-08-03 16:47:01 -07:00
Janic Duplessis 44c1012cca Enable optional chaining and nullish coalescing in flowconfig template (#20517)
Summary:
Follow up to a9792ac4c8 and #20516

This makes sure new projects typecheck properly since RN can use this syntax.
Pull Request resolved: https://github.com/facebook/react-native/pull/20517

Differential Revision: D9169268

Pulled By: TheSavior

fbshipit-source-id: f2b08598bdc6979931e987c9a275d75f08751754
2018-08-03 16:32:11 -07:00
gengjiawen a286c0e753 Fix RNTester on Windows (#19974)
Summary:
Currrent, RNTester can not work on windows.
* Fixes https://github.com/facebook/react-native/issues/19654.
Pull Request resolved: https://github.com/facebook/react-native/pull/19974

Differential Revision: D9150453

Pulled By: rafeca

fbshipit-source-id: 1bd2046fbe0e8eaadf249604357c2e6acd80455e
2018-08-03 13:32:49 -07:00
Trish Saylor f17047e230 Add flow strict-local annotation to the dismissKeyboard module
Summary: The `dismissKeyboard` module is widely used but did not have flow typing on it, preventing other js modules that use it from annotating themselves as flow strict-local. This diff adds a flow annotation to the `dismissKeyboard` module of the strictest type supported for this module, which is flow strict-local.

Reviewed By: gkz

Differential Revision: D9143671

fbshipit-source-id: af2367e6c59276402dcbcb9cf0f64b44ff42f531
2018-08-03 11:47:19 -07:00
Ives van Hoorne 72b0238242 Bump metro to 0.43.4
Summary: New version for metro.

Reviewed By: rafeca

Differential Revision: D9148300

fbshipit-source-id: 77a520aba8be7111da0bf71898684cd6922ff556
2018-08-03 11:17:35 -07:00
Kevin Gozali ee42606a0b ios: disable assertion for bridge deallocation during SST/redbox test
Summary: There's still a mysterious issue where the bridge wasn't deallocated properly, but there's already a test for it separately. Let's disable the assertion for SST/redbox.

Reviewed By: PeteTheHeat

Differential Revision: D9138634

fbshipit-source-id: 9cfa0f970e079774428caccaede1150292cccba6
2018-08-03 09:01:38 -07:00
Valentin Shergin 96238e03b6 Fabric: Support for Yoga's `overflow` property on iOS
Summary:
@public
Quite trivial.

Reviewed By: mdvacca

Differential Revision: D9146963

fbshipit-source-id: 3cdace99c172a3aea3c0af07ecb82488437d0311
2018-08-03 08:32:56 -07:00
Valentin Shergin 50b80a9ef8 Fabric: Fixed image URLs parsing
Summary:
@public
It's a basically reimplementation of `+[RCTConvert NSURL:]`.

Reviewed By: mdvacca

Differential Revision: D9146850

fbshipit-source-id: 57ecac1eb35b57b0d417b599371bd0c4a3988116
2018-08-03 08:32:56 -07:00
Héctor Ramos a9792ac4c8 Enable optional_chaining in open source Flow config
Summary:
There's a couple of Flow errors in open source, following D9081343:

```
yarn run v1.6.0
$ flow check
Error --------------------------------------------------------------------- Libraries/Components/Switch/Switch.js:139:31

Experimental optional chaining (`?.`) usage. Optional chaining is an active early-stage feature proposal that may
change. You may opt in to using it anyway by putting `esproposal.optional_chaining=enable` into the `[options]` section
of your `.flowconfig`.

   139|     let _trackColorForFalse = trackColor?.false;
                                      ^^^^^^^^^^^^^^^^^

Error --------------------------------------------------------------------- Libraries/Components/Switch/Switch.js:140:30

Experimental optional chaining (`?.`) usage. Optional chaining is an active early-stage feature proposal that may
change. You may opt in to using it anyway by putting `esproposal.optional_chaining=enable` into the `[options]` section
of your `.flowconfig`.

   140|     let _trackColorForTrue = trackColor?.true;
                                     ^^^^^^^^^^^^^^^^
```

See https://circleci.com/gh/facebook/react-native/48701

We have a different Flow config for open source, .github.flowconfig, that needs to be updated to ensure Flow passes in oss.

Reviewed By: TheSavior

Differential Revision: D9141134

fbshipit-source-id: 7b546ef4c9a91bdd66472242f38a6fc8bcf86364
2018-08-02 16:17:04 -07:00
Ram N 407e033b34 Remove the flag about Lazy native modules
Summary: The method removes all settings for mLazyReactModules since Lazy and non lazy modules can exist in a single application now

Reviewed By: achen1

Differential Revision: D9012312

fbshipit-source-id: 0420149654f8146453250d83d4de4b4c2fd31e9f
2018-08-02 16:02:36 -07:00