Граф коммитов

15821 Коммитов

Автор SHA1 Сообщение Дата
Matt Hargett 36916ee99d Fix portability issues to Linux, FreeBSD, and older libc++
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/21764

Differential Revision: D13902907

Pulled By: hramos

fbshipit-source-id: 640cde865b1bcc5ca43c17d00574b8e2f78ceaf4
2019-01-31 17:45:20 -08:00
Kevin Gozali 1e6f5344d6 avoid double lookup of a nativemodule when resolving turbomodule
Summary: A simple optimization to not access `NativeModules` property twice.

Reviewed By: RSNara

Differential Revision: D13908128

fbshipit-source-id: d41cd5f855fb0176170d6bdc3ac93df5593eeca5
2019-01-31 16:58:58 -08:00
Ramanpreet Nara 0ceefb40d5 Enable module lookup in TurboModules
Summary:
NativeModules are instantiated by the bridge. If they choose, they can capture the bridge instance that instantiated them. From within the NativeModule, the bridge can then be used to lookup other NativeModules. TurboModules have no way to do such a lookup.

Both NativeModules and TurboModules need to be able to query for one another. Therefore, we have four cases:
1. NativeModule accesses NativeModule.
2. NativeModule accesses TurboModule.
3. TurboModule accesses NativeModule.
4. TurboModule accesses TurboModule.

In summary, this solution extends the bridge to support querying TurboModules. It also introduces a `RCTTurboModuleLookupDelegate` protocol, which, implemented by `RCTTurboModuleManager`, supports querying TurboModules:
```
protocol RCTTurboModuleLookupDelegate <NSObject>
- (id)moduleForName:(NSString *)moduleName;
- (id)moduleForName:(NSString *)moduleName warnOnLookupFailure:(BOOL)warnOnLookupFailure;
- (BOOL)moduleIsInitialized:(NSString *)moduleName
end
```

If TurboModules want to query other TurboModules, then they need to implement this protocol and synthesize `turboModuleLookupDelegate`:

```
protocol RCTTurboModuleWithLookupCapabilities
property (nonatomic, weak) id<RCTTurboModuleLookupDelegate> turboModuleLookupDelegate;
end
```

NativeModules will continue to use `RCTBridge` to access other NativeModules. Nothing needs to change.

When we attach the bridge to `RCTTurboModuleManager`, we also attach `RCTTurboModuleManager` to the bridge as a `RCTTurboModuleLookupDelegate`. This allows the bridge to query TurboModules, which enables our NativeModules to transparently (i.e: without any NativeModule code modification) query TurboModules.

In an ideal world, all modules would be TurboModules. Until then, we're going to require that TurboModules use the bridge to query for NativeModules or TurboModules.

`RCTTurboModuleManager` keeps a map of all TurboModules that we instantiated. We simply search in this map and return the TurboModule.

This setup allows us to switch NativeModules to TurboModules without compromising their ability to use the bridge to search for other NativeModules (and TurboModules). When we write new TurboModules, we can have them use `RCTTurboModuleLookupDelegate` to do access other TurboModules. Eventually, after we migrate all NativeModules to TurboModules, we can migrate all old callsites to use `RCTTurboModuleLookupDelegate`.

Reviewed By: fkgozali

Differential Revision: D13553186

fbshipit-source-id: 4d0488eef081332c8b70782e1337eccf10717dae
2019-01-31 11:35:05 -08:00
Eric Rozell dfcbf9729f Adds fixes for react-native-windows UWP (#848)
Summary:
Specifically, updates the UWP .vcxproj for MSBuild and also exposes the UseLegacyStretchBehaviour API for use with react-native-windows.
Pull Request resolved: https://github.com/facebook/yoga/pull/848

Reviewed By: SidharthGuglani

Differential Revision: D13848609

Pulled By: davidaurelio

fbshipit-source-id: eab046ff3c47e49706f515e209d8aaf750c2198f
2019-01-31 09:35:10 -08:00
Richard Zito c435ff382e Revert D13895627: [react-native][PR] [iOS] Enhance image freshness check before stored into cache
Differential Revision:
D13895627

Original commit changeset: aa377511c31b

fbshipit-source-id: 7785644d48d750fb75b2d7652a4b68da27c5fc3f
2019-01-31 04:52:51 -08:00
zhongwuzw e98d5a289a Enhance image freshness check before stored into cache (#23226)
Summary:
Currently, before we store the image to cache, we only respect `Cache-Control`, actually, we also may need to check `Expires`、`Last-Modified`, refer to [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching#Freshness), and  [okhttp](568a91c44a/okhttp/src/main/java/okhttp3/internal/cache/CacheStrategy.java (L268)) respect the `MDN`, so in iOS, we can also respect this.

[iOS] [Fixed] - Respect `MDN` cache strategy before cache the image.

After `PR`, if image's response do not contains `Cache-Control`, it would also checks `Expires`、`Last-Modified` refers to  [MDN docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching#Freshness).
Pull Request resolved: https://github.com/facebook/react-native/pull/23226

Differential Revision: D13895627

Pulled By: cpojer

fbshipit-source-id: aa377511c31badd752d7887ed6cbcdf6be4b80b3
2019-01-31 03:57:49 -08:00
scisci e405e84fc3 Fix Native Rotation Android (#18872)
Summary:
Fixes #14161
Android crashes in some cases if an animated transform config contains a string value, like a rotation.
This PR fixes that by ensuring all values sent to the native side are doubles. It adds `__transformDataType` to AnimatedTransform.js.

Added integration test `ReactAndroid/src/androidText/js/AnimatedTransformTestModule.js` This test fails with the following error `INSTRUMENTATION_RESULT: longMsg=java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Double`, if the changes to AnimatedTransform.js are reverted.

[Android] [Fixed] - Fixes Android crash on animated style with string rotation
Pull Request resolved: https://github.com/facebook/react-native/pull/18872

Differential Revision: D13894676

Pulled By: cpojer

fbshipit-source-id: 297e8132563460802e53f3ac551c3ba9ed943736
2019-01-31 01:36:21 -08:00
Ram N 02697291ff Remove TabbarIOS from OSS
Reviewed By: fkgozali

Differential Revision: D13858496

fbshipit-source-id: ba9dd9912f4abcbeb3326f412ec91be9bee9cfd3
2019-01-30 23:41:40 -08:00
Kevin Gozali 8a50bc3ab3 iOS: Make each module implement getTurboModuleWithJsInvoker: instead of having centralized provider
Summary:
For better modularity, each module conforming to RCTTurboModule should provide a getter for the specific TurboModule instance for itself. This is a bit more extra work for devs, but simplify tooling and allow better modularity vs having a central function that provides the correct instance based on name.

Note: Android may or may not follow this new pattern -- TBD.

Reviewed By: RSNara

Differential Revision: D13882073

fbshipit-source-id: 6d5f82af67278c39c43c4f7970995690d4a82a98
2019-01-30 17:32:16 -08:00
Oli Barnett bbcb97a29a Location Services: don't reset desiredAccuracy on every update/error (#23209)
Summary:
See https://github.com/facebook/react-native/issues/7680.

On iOS the RCTLocationObserver delegate is overriding `desiredAccuracy` every time CLLocationManager calls `didUpdateLocations` or `didFailWithError`.  `desiredAccuracy` is reset to
`RCT_DEFAULT_LOCATION_ACCURACY` (100 meters) This effectively makes it impossible for a react-native app to use any location accuracy other than the default.

This commit simply removes the code which resets the desired accuracy, as there seems to be no rationale for doing so. The reset code was added as part of [a large general
change](705a8e0144) so the original intention is unclear from the history. If somebody can explain it to me, I'm happy to rework this PR accordingly.

Changelog:
----------
[iOS] [Fixed] - Location Services accuracy constantly reset to default of 100 meters.
Pull Request resolved: https://github.com/facebook/react-native/pull/23209

Differential Revision: D13879497

Pulled By: cpojer

fbshipit-source-id: f3c6c9c5ef698b23b99c407fd764ac990d69bf8c
2019-01-30 10:23:58 -08:00
Ranjan Shrestha 4c10f9321c Make perspective transformation look exactly same on iOS and Android (#18302)
Summary:
There is a variation in iOS and Android output while performing perspective transformation. The variation exists even when used in Android devices with different screen density.
Pull Request resolved: https://github.com/facebook/react-native/pull/18302

Differential Revision: D13877483

Pulled By: cpojer

fbshipit-source-id: e48be047a8047c7562722923a67666cb098243d8
2019-01-30 09:56:58 -08:00
cpojer 7bb7f0159d Update Pull Request and Issue templates. (#23187)
Summary:
As a maintainer, I noticed that the description for a PR is often missing, which makes it hard to understand why a change is made. Because some of the text isn't using HTML comments, the same text explaining how to fill out the changelog and test plan pops up and isn't removed by people. This PR fixes both of these issues.

I also made another small update to the main issue template to urge people to use one of the other templates, with an explanation that we will close poorly formatted issues.

Changelog:
----------

[General] [Changed] - Updated GitHub templates
Pull Request resolved: https://github.com/facebook/react-native/pull/23187

Differential Revision: D13877752

Pulled By: cpojer

fbshipit-source-id: 8ed88cde9151a41931848cccc669208cabe1e9ef
2019-01-30 08:36:50 -08:00
David Vacca 6feb3dc837 Include PreAllocateViewMountItem into the eager initialization of Fabric classes
Summary: simple diff to eager initialize the PreAllocateViewMountItem class with the rest of the Fabric classes

Reviewed By: sahrens

Differential Revision: D13860612

fbshipit-source-id: d1fbc653420c1c1546bbf605c682ad5bb611d76b
2019-01-30 00:15:25 -08:00
David Vacca 16a6e51045 Optimize pre-allocation of views
Summary: This diff changes the way pre-allocation of views are executed in Fabric. Before this diff the execution of view preallocation was schedulled at the end of the UIThread queue, now the views are pre-allocated in the next "tick"

Reviewed By: sahrens

Differential Revision: D13857614

fbshipit-source-id: 386bf966d3c8a0d5c0bd626119a92810465aecb7
2019-01-30 00:15:25 -08:00
Kevin Gozali 4c69ccd0fb Revert D13860038: [react-native][PR] Add ability to control scroll animation duration for Android
Differential Revision:
D13860038

Original commit changeset: f06751d063a3

fbshipit-source-id: 5d89137aed0d549004e790068c1e4998ebccdaf1
2019-01-29 18:00:54 -08:00
David Aurelio c16fadb7c3 Track how much measure cache entries are used
Summary:
@public

Adds the maximum number of measure cache entries in use to the metrics for `YGMarkerLayout`

Reviewed By: SidharthGuglani

Differential Revision: D13844731

fbshipit-source-id: fa66dbf1b7a1799494f72ecc17dfaef04d0b56e4
2019-01-29 15:54:19 -08:00
Héctor Ramos 47a5bcbca2 Remove TabBarExample from Screenshot Tests (#23206)
Summary:
Fixes https://github.com/facebook/react-native/issues/23108. The TabBarIOS component is scheduled to be removed from core any day now, so it's OK to remove it from our test suite.

Changelog:
----------

[iOS] [Removed] - Remove TabBarExample SST
Pull Request resolved: https://github.com/facebook/react-native/pull/23206

Differential Revision: D13864064

Pulled By: hramos

fbshipit-source-id: f65da75e2789d384dcd713a27ca5528f0faa7526
2019-01-29 14:38:31 -08:00
David Aurelio f506019e8b count cache hits
Summary:
@public

Adds cache hit counts to layout stats.

Reviewed By: SidharthGuglani

Differential Revision: D13844022

fbshipit-source-id: 906b4ec5fe3314287911cee2c37d77c4aac76455
2019-01-29 11:41:36 -08:00
David Aurelio 0dafa0de6b Layout marker metadata
Summary:
@public

Adds marker meta data to `YGMarkerLayout`: the number of measures, and the numbers of layouts for all nodes in the tree.

Reviewed By: SidharthGuglani

Differential Revision: D13838975

fbshipit-source-id: d575c26a3d5a4f0b66834eb6bedecadc3f3ca265
2019-01-29 11:41:36 -08:00
David Aurelio fc6a4b6dbb Pass layout marker data along
Summary:
pubic

Passes layout marker data through the recursive calls of the layout algorithm, in order to allow for collecting metrics.

Reviewed By: SidharthGuglani

Differential Revision: D13819444

fbshipit-source-id: cdca04964fba6a03ca3eeaca4d169107019ba457
2019-01-29 11:41:36 -08:00
David Aurelio c723029242 Introduce first marker
Summary: @public Adds a marker section for a complete layout pass

Reviewed By: SidharthGuglani

Differential Revision: D13819447

fbshipit-source-id: 21a80f0fe3d325d804a968508761d115c50d3dc1
2019-01-29 11:41:36 -08:00
David Aurelio f1a3137b41 Add `MarkerSection`
Summary:
@public

Adds a class for triggering markers.

This calls `startMarker()` on construction, and `endMarker()` on destruction, thus being usable like a "scope guard": the object is instantiated, and automatically destroyed when going out of scope.

Reviewed By: SidharthGuglani

Differential Revision: D13817589

fbshipit-source-id: fd88884af970c1c0933d9ca6843f3f8f5d28b9e6
2019-01-29 11:41:36 -08:00
Elliott Sprehn 27b4d21564 Always write the manifest in multiRemove (#18613)
Summary:
RCTAsyncLocalStorage did not write the manifest after removing a value that was larger than RCTInlineValueThreshold. This meant that the values would still be on disk as null in the manifest.json, and if the app didn't do anything to make the manifest get written out again the null values would persist in the AsyncStorage and be returned by getAllKeys. We need to always write out the manifest.json even if the value is in the overflow storage files.

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.

Fixes #9196.

Not sure where the tests are for this?

none.

[IOS] [BUGFIX] [AsyncStorage] - Correctly remove keys of large values from AsyncStorage.

tadeuzagallo nicklockwood dannycochran
Pull Request resolved: https://github.com/facebook/react-native/pull/18613

Differential Revision: D13860820

Pulled By: cpojer

fbshipit-source-id: ced1cd40273140335cd9b1f29fc1c1881ab8cebd
2019-01-29 09:15:30 -08:00
Teddy Martin 7b8235a95a Expose AsyncLocalStorage get/set methods (#18454)
Summary:
Currently, if an app uses AsyncStorage on the JS side, there is no public interface to access stored data from the native side.

In our app, written in Swift, I have written a [helper](https://gist.github.com/ejmartin504/d501abe55c28450a0e52ac39aee7b0e6) that pulls out the data. I accomplished this by reverse-engineering the code in RCTAsyncLocalStorage.m. It would have been far easier had this code been exposed to native.

I made this change locally and tested out getting the data from Swift code. This worked like a charm:

```swift
let storage = RCTAsyncLocalStorage()
let cacheKey = "test"
storage.methodQueue?.async {
    self.storage.multiGet([cacheKey]) { values in
        print(values)
    }
}
```

[IOS ][ENHANCEMENT ][RCTAsyncLocalStorage.h] - Expose AsyncLocalStorage get/set methods to native code.

<!--
  **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 ] [ {Filename}  ]
  [ IOS      ] [ FEATURE     ] [ {Directory} ]   |-----------|
  [ ANDROID  ] [ MINOR       ] [ {Framework} ] - | {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
-->
Pull Request resolved: https://github.com/facebook/react-native/pull/18454

Differential Revision: D13860333

Pulled By: cpojer

fbshipit-source-id: b33ee5bf1ec65c8291bfcb76b0d6f0df39376a7e
2019-01-29 08:54:16 -08:00
Shaun Stanworth 745484c892 Remove height styling when keyboard closed (#16965)
Summary:
Closes #13754

Fixing previously reported bug #13754

Video here https://imgur.com/a/3IgqP

[GENERAL] [BUGFIX] [KeyboardAvoidingView] - Correct height behaviour when keyboard closed
Pull Request resolved: https://github.com/facebook/react-native/pull/16965

Differential Revision: D13860208

Pulled By: cpojer

fbshipit-source-id: 9ae7f81fd24999518a6ae85016d4f75dac3c4274
2019-01-29 07:31:47 -08:00
Michał Osadnik 7e8b810499 Add ability to control scroll animation duration for Android (#22884)
Summary:
Motivation:
----------
This is one of the more sought after feature requests for RN:
react-native.canny.io/feature-requests/p/add-speed-attribute-to-scrollto

This PR adds the support to add a "duration" whenever using "scrollTo" or "scrollToEnd" with
a scrollView. Currently this only exists for Android as the iOS implementation will be somewhat more involved.

This PR is also backwards compatible and does not yet deprecate the "animated" boolean. It may not make sense to ever deprecate "animated", as it could be the flag that is used when devs want the system default duration (which is 250ms for Android). I'm not sure what it is for iOS. It would simplify things to remove "animated", though.
Pull Request resolved: https://github.com/facebook/react-native/pull/22884

Differential Revision: D13860038

Pulled By: cpojer

fbshipit-source-id: f06751d063a33d7046241c95348b6abbb327d36f
2019-01-29 07:18:09 -08:00
rogerkerse 8afa0378cd SystemUiVisibility overwritten bug (#17370)
Summary:
Make StatusBar style respect previously set systemUiVisibility

<!--
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!

-->

I tried to set `SystemUiVisibility` flag to `SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR` to enable Android's light soft navigation bar, but when I had `<StatusBar />` component in my view, then it was always overwritten. This is how I found the bug and fixed it.

1. In MainActivity you can set systemUiFlags like this in onCreate method
```
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
            Window window = getWindow();
            View rootView = window.getDecorView().getRootView();
            rootView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
        }
```
2. Add <StatusBar /> to a view
3. In `android/app/build.gradle` file set `targetSdkVersion` to **27** instead of 22 or something like that
4. In `android/app/src/main/res/values/styles.xml` add 2 lines to `AppTheme`
```
        <item name="android:windowDrawsSystemBarBackgrounds">true</item>
        <item name="android:navigationBarColor">#ffffff</item>
```
5. Run the app.
6. Test. Previously bottom soft navigation bar was set to white and buttons also to white (so they weren't visible anymore), because StatusBar was overwriting previously set systemUiVisibility Flags. Now the bar should be white and buttons dark as expected.

Previous buggy android bottom navbar
<img width="379" alt="screen shot 2017-12-27 at 17 11 57" src="https://user-images.githubusercontent.com/571171/34385126-2a3edc44-eb29-11e7-812e-846cfd2fb88b.png">

New fixed android bottom navbar
<img width="379" alt="screen shot 2017-12-27 at 17 12 07" src="https://user-images.githubusercontent.com/571171/34385137-3e82517c-eb29-11e7-8af9-a3b7a41ae8e2.png">

This pull request does not change any existing feature. It only makes StatusBar coloring work more properly without affecting bottom navigation bar on android or any other system ui visibility feature.

<!--
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
-->
[ANDROID] [BUGFIX] [StatusBar] - Fixed StatusBar overwriting previously set SystemUiVisibility flags
Pull Request resolved: https://github.com/facebook/react-native/pull/17370

Differential Revision: D13860079

Pulled By: cpojer

fbshipit-source-id: a0bca7acb7601eb78f0842239ea4dee76a63d1fd
2019-01-29 07:12:41 -08:00
David Aurelio 52d9f2627b Remove unused constexpr
Summary:
@public

Removes unused constexpr variables from YGStyle. Not polluting the global namespace is a good thing.

Reviewed By: SidharthGuglani

Differential Revision: D13816817

fbshipit-source-id: e4c27a8f2de466ccb759bbe52cdaea6fe451b961
2019-01-29 04:11:25 -08:00
David Aurelio 43601f1a17 Add function to set marker callbacks
Summary:
@public

Adds a function to allow to configure markers. The function is declared in `YGMarker.h`

Reviewed By: SidharthGuglani

Differential Revision: D13819111

fbshipit-source-id: f9158b3d4e5727da4e151c84b523c7c7e8158620
2019-01-29 03:51:37 -08:00
David Aurelio 1db55803f1 Add `YGMarkerLayout`
Summary: @public adds a first `YGMarker`, and the accompanying data type.

Reviewed By: SidharthGuglani

Differential Revision: D13817588

fbshipit-source-id: 6007eb09d19cf4021989bad5b5e880adb16364a0
2019-01-29 03:51:37 -08:00
David Aurelio e804124e6f Rename `YGMarkerType` to `YGMarker`
Summary:
@public

this will lead to nicer enum member names.

Reviewed By: SidharthGuglani

Differential Revision: D13817587

fbshipit-source-id: 85355328f7977b4fb29a9474532f2d578a3cbf79
2019-01-29 03:51:36 -08:00
Rafael Lincoln ac90c4fd6d Fix warnings in JSI (#23201)
Summary:
His PR is related to #22609

There are still some warnings related to folly, but I plan to make the correction and send the PR to the repo of the folly.

Changelog:
[IOS][Changed] - Fix warning in JSCRuntime
Pull Request resolved: https://github.com/facebook/react-native/pull/23201

Differential Revision: D13859393

Pulled By: cpojer

fbshipit-source-id: 95df2b76b28b460f890d11e1395fddb6b1cc8fed
2019-01-29 03:31:50 -08:00
danibonilha 7ff9456f2e - create missing AndroidDrawable flow types in ViewPropTypes.js. (#23192)
Summary:
Related to #22100

Enhance last ViewPropTypes flow types.

- [x] yarn run prettier
- [x] yarn run flow-check-ios
- [x] yarn run flow-check-android

[GENERAL] [ENHANCEMENT] [ViewPropTypes.js] - Enhance Flow types definitions
Pull Request resolved: https://github.com/facebook/react-native/pull/23192

Differential Revision: D13858907

Pulled By: cpojer

fbshipit-source-id: 3633eb019eca2076bb68393b09d06555876f2c48
2019-01-29 00:10:03 -08:00
Mike Grabowski 9a9370481f Fix Detox tests after upgrading to latest CLI (#23191)
Summary:
Latest changes inside CLI now require that Metro configuration is provided when building RNTester app. This is to let CLI know that instead of looking for "react-native" under "node_modules" (that is obviously not present since we are running from source), it should check the paths provided.

When running "npm start", it finds the configuration at the root. However, when building through Xcode (e.g. "react-native bundle" or "xcodebuild" in Release scheme), it runs "react-native-xcode.sh" that works in different folder and makes Metro not detect the configuration file.

This PR explicitly sets path to the configuration via `BUNDLE_CONFIG`.

It also removes `pwd` from being prepended to all `BUNDLE_CONFIG` values. In my case, `pwd` was `/Users/grabbou` and the RNTester files where inside `/Users/grabbou/Repositories/react-native`. I was unable to point the script to correct location without making it aware of the folder structure - which is not going to work on the CI.
Pull Request resolved: https://github.com/facebook/react-native/pull/23191

Differential Revision: D13851741

Pulled By: hramos

fbshipit-source-id: d920353fd68d39468bd33bd1ad47e03b017a7727
2019-01-28 20:29:58 -08:00
David Vacca 0bf6a8e914 Remove ReactInstanceManager out of FabricJSIModuleProvider
Summary: easy cleanup in FabricJSIModuleProvider

Reviewed By: shergin

Differential Revision: D13838336

fbshipit-source-id: 12738572394e9c091e559817f9886fa3aaf23570
2019-01-28 19:44:29 -08:00
David Vacca 2b356590f8 Remove components out of Bindings
Summary: This diff removes the components dependencies out of the Fabric/jsi/jni project

Reviewed By: shergin

Differential Revision: D13734001

fbshipit-source-id: 65182bfa5ee9fcd526a9afc40bd9fd6f0b86c5a5
2019-01-28 19:44:29 -08:00
Riley Dulin cf0c37b08b Remove UIProp class from redex and proguard rules, it doesn't exist
Summary:
`com.facebook.react.uimanager.UIProp` doesn't exist anymore in React Native.
Remove all the old references to it in various redex and proguard configurations.

Reviewed By: int3, minjang, justinjhendrick

Differential Revision: D13847084

fbshipit-source-id: 366fb0b25f446903cc2885686850810778779e5e
2019-01-28 14:42:03 -08:00
Joshua Gross 88bc80c518 Update hash functions to use folly:#️⃣:hash_combine
Summary: Following hashing best practices.

Reviewed By: shergin

Differential Revision: D13827893

fbshipit-source-id: 3786f1e42b176a973890989be7b33efce4825ac6
2019-01-28 14:36:30 -08:00
Joshua Gross 6418e30e90 Small changes to get Profile build working
Summary: Small changes to get Profile build working. Compiler errors or immediate crashes occur without these lines, when running a profile build on device.

Reviewed By: fkgozali

Differential Revision: D13823136

fbshipit-source-id: a1777d5337d8bd78ef3eb11bbeeb7e23c383ab83
2019-01-28 14:36:30 -08:00
David Vacca 10b521815c Add QPL marker to track time it takes to load .so file from RN
Summary: Simple diff that adds QPL marker to track time it takes to load .so file from RN

Reviewed By: fkgozali

Differential Revision: D13845379

fbshipit-source-id: 6c2272605ba3fb08ab8ebce867f84c6a488438d0
2019-01-28 13:00:05 -08:00
Albert Sun ec9fe48819 Back out "[react-native][PR] [fix] Fixing overscrolling issue on Virtualized List"
Summary:
Reverting this change since it broke some initial scroll positions. It seems the proper API to use to limit overscrolling should be overScrollMode='never'

Original commit changeset: 2ec5787218ec

Reviewed By: olegbl

Differential Revision: D13845053

fbshipit-source-id: 673aa529ef5171f26ce138573ee36f31f5d9799e
2019-01-28 11:55:32 -08:00
Bruno Nallis Villanova a159a33c02 Added: informational error message on getting Android drawable folder… (#17751)
Summary:
… suffix for asset

Better informational error message on getting Android drawable folder suffix error using the asset name scale.

<!--
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!

-->

I've got an not well described error when trying to bundle my React Native project package.

You can test the React Native bundle command like this:

node node_modules/react-native/local-cli/cli.js bundle --platform android --dev false --reset-cache --entry-file index.android.js --bundle-output /project/android/app/build/intermediates/assets/release/index.android.bundle --assets-dest /project/android/app/build

(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
-->
Pull Request resolved: https://github.com/facebook/react-native/pull/17751

Differential Revision: D13840597

Pulled By: cpojer

fbshipit-source-id: f755ef665b76ce3dd9c96e575fbc71e9aaf43a44
2019-01-28 09:10:33 -08:00
Sunny Luo 46aaa02274 Make the load-script-error less misleading (#17055)
Summary:
For most cases, people saw this error when they are running a debug version. So they should check metro server first. However, they were misled to search for "bundle" keywords and finally they executed "react-native bundle" command and got an app that can never reload.
Pull Request resolved: https://github.com/facebook/react-native/pull/17055

Differential Revision: D13421737

Pulled By: cpojer

fbshipit-source-id: 8e108df06b7d416a74c33581457f3213b28306c1
2019-01-28 08:21:38 -08:00
Kesha Antonov 54534e79d7 CameraRoll support for Videos and Photos showed in same time (#16429)
Summary:
Right now you can choose to show Videos OR Photos.
This PR allows to show both in the same time.

[ANDROID][ENHANCEMENT] - Can show videos and photos from CameraRoll in the same time
Pull Request resolved: https://github.com/facebook/react-native/pull/16429

Differential Revision: D13839638

Pulled By: cpojer

fbshipit-source-id: 5edc039552888c3ba8a40f39e262919fa7c00b39
2019-01-28 07:39:59 -08:00
Connor McEwen 11df0eae5f Add rejectResponderTermination prop to TextInput (#16755)
Summary:
This is a new attempt to get #11251 merged. I just cherry-picked the relevant commits. TextInputs are set to always ignore responder termination requests, which is not desirable when they are enclosed inside a swipeable area like a ListView

Create a TextInput inside a ListView and set the `rejectResponderTermination` prop to false. Otherwise, all TextInputs should have the same behavior they do now.

[IOS] [ENHANCEMENT] [TextInput] - Add `rejectResponderTermination` prop to to TextInput. This enables TextInputs inside Swipeables to function properly.
Pull Request resolved: https://github.com/facebook/react-native/pull/16755

Differential Revision: D7846365

Pulled By: cpojer

fbshipit-source-id: eb21140061ae1f475fbd83fc63a23819e931787d
2019-01-28 07:30:39 -08:00
Chris Lewis 7cbdd7b6ac Remove replaceOkHttpClient method (#16972)
Summary:
This method was originally intended to replace the OkHttp client used by React Native's networking library. However it has effectively been a noop since 0a71f48b13 (diff-177100ae5a977e4060b54cc2b34c79a7), when the Networking library was modified to create a new client rather than use the reference provided by OkHttpClientProvider.

Leaving this code in place is dangerous. There is no indication to users upgrading React Native that the method is no longer replacing the OkHttpClient used by the Networking library. Any functionality reliant on overriding the client will silently break. This caused us some problems internally.

There's been a PR out for some time that seeks to reintroduce this functionality: https://github.com/facebook/react-native/pull/14068

I've also put up a new PR that adds an interface for replacing the client without introducing breaking changes: https://github.com/facebook/react-native/pull/17237

Do our unit tests continue to pass? Should be safe as this method is not used anywhere inside React Native.

[ANDROID] [BREAKING] [Networking] - removed replaceOkHttpClient method in OkHttpClientProvider.
Pull Request resolved: https://github.com/facebook/react-native/pull/16972

Differential Revision: D13838805

Pulled By: cpojer

fbshipit-source-id: 43606d1d141afb9b5dda4dd64e5ac5448771b45c
2019-01-28 05:20:58 -08:00
Rafael Lincoln 5a87093e1a Fix Warnings in Xcode (#23184)
Summary:
His PR is related to #22609

Changelog:
----------

[IOS][Changed] - Fix warning in RCTImage
[IOS][Changed] - Fix warning in RCTNetwork
Pull Request resolved: https://github.com/facebook/react-native/pull/23184

Differential Revision: D13838680

Pulled By: cpojer

fbshipit-source-id: 698303e44bb85a4819abff7d71e0b75936c09dc8
2019-01-28 03:57:42 -08:00
zhongwuzw d0cd3cae13 Add ImageIO related C nullable check to prevent crash (#23186)
Summary:
Changelog:
----------

[iOS] [Fixed] - Add ImageIO related C nullable check to prevent crash
Pull Request resolved: https://github.com/facebook/react-native/pull/23186

Differential Revision: D13838590

Pulled By: cpojer

fbshipit-source-id: 14bfa826ce75c32129e6a980a04bb85fb35411a0
2019-01-28 03:36:57 -08:00
Janic Duplessis 959a13363a Disable no-inline-styles lint rule for RNTester (#23169)
Summary:
We have a million of inline styles in RNTester which causes a lot of noise with the lint bot in PRs. The rule makes sense for the main libraries but for RNTester it usually makes examples easier to read to just use inline styles.  Also reduces lint warnings from 357 to 77.

Changelog:
----------

[General] [Changed] - Disable no-inline-styles lint rule for RNTester
Pull Request resolved: https://github.com/facebook/react-native/pull/23169

Differential Revision: D13838529

Pulled By: cpojer

fbshipit-source-id: 474e159e0b0c07bce42878db2b214b8903b49c08
2019-01-28 03:26:12 -08:00
Dustin Savery 4d5f85ed42 Fixing overscrolling issue on Virtualized List (#23181)
Summary:
Changelog:
----------
[iOS][fixed] Fixed overscroll behavior on iOS virtualized lists (Fixes #18098)
Pull Request resolved: https://github.com/facebook/react-native/pull/23181

Differential Revision: D13838579

Pulled By: cpojer

fbshipit-source-id: 2ec5787218ecca0e01aaf31bfbb7d630cf9f1f09
2019-01-28 03:26:12 -08:00