Summary: trivial change of the default font size from 12 to 14 to make it backward compatible with current version of RN
Reviewed By: shergin
Differential Revision: D13108543
fbshipit-source-id: e5e384c4459f2c87ee9589c4e00a0ab5d0c8a06a
Summary: Scrolling with multiple fingers produced a redbox in Fabric
Reviewed By: shergin
Differential Revision: D13108544
fbshipit-source-id: 7b70b3f55f325448191adc48c782f2014b502ad6
Summary: These methods and variables were used by Android implementation of Fabric, these are not used anymore.
Reviewed By: shergin
Differential Revision: D13108547
fbshipit-source-id: d169eb58ba20f3bfe117a124f0494ff3a4fb5dce
Summary:
Apparently, if a gesture recognizer got 'reset', OS does not call `touchesCancelled:` method, so we have to do it manually.
To implement this we have to split `_dispatchTouches:eventType:` into two methods: the first converts Objective-C touches to C++ touches, the second consumes that. We have to do this because during reset we don't have a collection of UIKit touches.
Reviewed By: mdvacca
Differential Revision: D13072807
fbshipit-source-id: 677e2febf9f96dcdfaadfadf5b9ab3893f93e796
Summary: Every C++ engineer (except me several months ago) knows that `operator []` can mutate the collection (Yeah! Don't ask), so this is especially dangerous if your hash function is broken (see the previous diff).
Reviewed By: mdvacca
Differential Revision: D13072805
fbshipit-source-id: 4436a8ff12fb27a57bfb6ee0ff986d7a9a825549
Summary:
Without this fix the PointerHasher hashed not a pointer, but an address where the pointer is stored, which is obviously incorrect.
The incorrect hash function compromised the whole `_activeTouches` caused many issues with logically invalid invariants (e.g. removing element from the collection silently didn't work).
Reviewed By: mdvacca
Differential Revision: D13072804
fbshipit-source-id: d68289e940fe21e2df08a31439619b7e2fe0fa13
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/22316
Pull Request resolved: https://github.com/facebook/react-native/pull/22315
In order for TLS Mutual Auth to work for webviews, the caller must present a credential. Expose a setter that can be called to set a credential.
Reviewed By: RSNara
Differential Revision: D13095969
fbshipit-source-id: d136556a0030f799651d574b6e47ce38295b108e
Summary: A simple test for WritableNativeMap. Also includes a test to verify that the key name exists in the error message if a dynamic cast exception occurs (this will be implemented in the future)
Reviewed By: mdvacca
Differential Revision: D12914375
fbshipit-source-id: 654674b1b32e7b3f38cc1364a2302d1ce08ec33e
Summary:
Back it out again. This time really not sure why this is breaking, but it seems to be production only. The error seems to be "RCTSinglelineTextInputView" was not found in the UIManager" but the relavent logic is not changed in this diff, just moved around, so unclear why it would trigger a failure.
Reverting to be safe. When we re-apply the diff, we'll need to test a full OTA to prod to verify the fix.
Reviewed By: blairvanderhoof
Differential Revision: D13108463
fbshipit-source-id: 5f877a0c1a08dc114ce45921d6d92bf619575977
Summary: Adds a `bounce` method that just bounces the element without invoking any callbacks.
Differential Revision: D13085800
fbshipit-source-id: 310b273b260c924fbde32bfad1de7226d068bd57
Summary:
This pull request silences build warnings like this in open-source:
```
{snip}/ReactCommon/cxxreact/CxxNativeModule.cpp:134:85: warning: lambda capture 'callId' is not used [-Wunused-lambda-capture]
messageQueueThread_->runOnQueue([method, params=std::move(params), first, second, callId] () {
```
These are variables used by "fbsystrace", which is not open-sourced.
An unused statement has been added to the affected files in the `#else` for the `#ifdef WITH_FBSYSTRACE` conditionals
Pull Request resolved: https://github.com/facebook/react-native/pull/22240
Differential Revision: D13031358
Pulled By: shergin
fbshipit-source-id: 8ccfc226b65e32abda6abb573f77a6589bd19dcd
Summary: D10515754 reapplied by backing out D12989604 and then fixed by manually forwarding the instance methods to the host function instead of using `forwardRef`. This also removes the need for the $flowFixMe.
Reviewed By: TheSavior
Differential Revision: D13048482
fbshipit-source-id: ff2447aff123e0960eddaef645f7dc976a426e14
Summary: Adds a basic test that would have prevented S168585. We should expand coverage of this and other components as well.
Reviewed By: TheSavior
Differential Revision: D13038064
fbshipit-source-id: 14cf4742efd53d7bca2a3f8d1c5c34ebc6227674
Summary:
resizeMode applies to Image.defaultSource, because depending on screen resolution sometimes we see padding around defaultSource image while source loading. Now we can control scale of both source and defaultSource.
Changelog:
----------
[Android] [Fixed] - Image.resizeMode will apply to defaultSource, enhanced user experience. Previously, resizeMode didn't applied to defaultSource, therefore depending on screen resolution sometimes we see padding around defaultSource image while source loading.
Pull Request resolved: https://github.com/facebook/react-native/pull/22216
Differential Revision: D13088220
Pulled By: mdvacca
fbshipit-source-id: 92c66cf6228f3b7666b9ef2404d034f0005b5234
Summary:
Now, Objective-C part of RN is in `xplat` directory, so global Objective-C clang-format does not affect that.
Explicit clang-format is also useful for external contributors who don't have access to the rest of monorepo.
The actual rules are copy-paste from ReactCommon folder with small changes (like 120 characters max line length) that conform to regular Facebook code style and which make sense only for Objective-C.
Reviewed By: fkgozali
Differential Revision: D13093150
fbshipit-source-id: 79d64b4fba6eeb94e9b8d87ef9c3f86b3a5ed94e
Summary: Changed front-facing camera so that it shows consistent image during capture and preview
Reviewed By: mmmulani
Differential Revision: D13012715
fbshipit-source-id: 043cd9178fc49ef9e8e628a866dd8e52434f7306
Summary:
Constructing `Buffer` using the constructor [[https://nodesource.com/blog/understanding-the-buffer-deprecation-in-node-js-10/ | has been deprecated in Node 10 due to security considerations]].
This is a simple and straightforward conversion.
Reviewed By: mjesun
Differential Revision: D13080655
fbshipit-source-id: 100d8f28c3b255422b26e820aaadcc4f32f41e0d
Summary:
Fixes two problems I uncovered with React Native:
1. `FBCore/Prelude` points to `React.unstable_AsyncMode` which is not defined. (This type was renamed to `React.unstable_ConcurrentMode` in React v16.6.0. **As a result** people in the "react_native:async_rendering" GK will no longer get runtime errors on app start.
2. Updates `react-devtools` and (more importantly) `react-devtools-core` to 3.4.2 to handle the React-internal tag/type refactoring that happened prior to the release of 16.6.0. **As a result** DevTools will no longer cause a runtime error when connected to React Native.
For the second change, I ran `js1 upgrade react-devtools -v ^3.4.2`
Reviewed By: sebmarkbage
Differential Revision: D13030590
fbshipit-source-id: 603f7f6259f282839039820bcdba4310064a7965
Summary:
@public
Restores the yearless format of the MIT license.
Reviewed By: SidharthGuglani
Differential Revision: D13082510
fbshipit-source-id: f5a849b06652cedf68547d4a7963398b2627915f
Summary:
This is a safe workaround to an issue in Android P: https://issuetracker.google.com/issues/112385925
It is based on a fact that even though `fling` receive a wrong sign in `velocityY`, `mOnScrollDispatchHelper.getYFlingVelocity()` still returns a fling direction.
Fixes#19434
Pull Request resolved: https://github.com/facebook/react-native/pull/21117
Differential Revision: D13082740
Pulled By: hramos
fbshipit-source-id: 1b28586d2c7bdcae4a111d3cead4a0455cebb99a
Summary: If a root node is being removed and has an id of NO_ID, it was likely already removed previously, likely due to a race condition caused by RN's async nature. In those cases, let's avoid crashing the app and instead silently ignore the root view removal.
Reviewed By: mdvacca
Differential Revision: D13055140
fbshipit-source-id: ec10f4c79f2ba21614f52f57557f6b3d734c9461
Summary:
In preparation for D12843022, starting using folly::none instead of
nullptr to indicate an empty optional.
Reviewed By: nlutsenko
Differential Revision: D13052075
fbshipit-source-id: ed869f98b5fb1556bca1e01e3ac3e44ea914dc52
Summary: There are cases where we're trying to drop a view that is not associated with a ViewManager. This is likely caused by race conditions that can occur if we're dropping a view from JS (when it's no longer used) but at the same time dropping it from native (when layout animation ends, when the rootview gets unmounted). In either of those cases, it should be safe to ignore the drop operation because the view was likely dropped already.
Reviewed By: mdvacca
Differential Revision: D13036643
fbshipit-source-id: 260ffb56d32a0d670ad08f449b8df165b2533195
Summary:
Unused loads still take time to process and pollute
execution environment.
drop-conflicts
Reviewed By: passy
Differential Revision: D13054018
fbshipit-source-id: a8fe58d1c55c031925c2c0267e24e67f021cd91d
Summary: This diff fixes the dispaching of Async Events in Android C++ layer to ensure proper asynchronouns dispatching in the JS thread.
Reviewed By: shergin
Differential Revision: D12988348
fbshipit-source-id: 7aa60b11e2c264c2e68354ed83eb75139060d211
Summary:
@public
Currently only parent can tell the layout to align its children based on baseline. But if one of the children is a column or row then basealign does not work as expected.
We have added an api setReferenceBaseline which when set to true would mean that it's baseline would be considered as the reference baseline for parent amongst its siblings. If there are more than one siblings with referenceBaseline set, the first one would be considered.
Reviewed By: davidaurelio
Differential Revision: D12883323
fbshipit-source-id: 19beccfc47d98bb38f81f5b66ba764e83680f821
Summary:
This regression was caused by 199c918 - property values are initialized to true rather than a string that matches the property name now.
Pull Request resolved: https://github.com/facebook/react-native/pull/22262
Differential Revision: D13048839
Pulled By: hramos
fbshipit-source-id: 09471334c37f3930aae7e35066943f33f8e617e5
Summary:
When the remote server closes the websocket, the app doesn't get a 'close' event in Android, There is no issue on iOS.
Pull Request resolved: https://github.com/facebook/react-native/pull/22248
Differential Revision: D13047556
Pulled By: hramos
fbshipit-source-id: c5c56ea8418cfdf734fb51f863b3066856de6512
Summary: Testing is a __DEV__ time only, so let's optimize for prod bundles.
Reviewed By: ejanzer
Differential Revision: D13050583
fbshipit-source-id: a96e35e4d5f3bd09c235c11d4ece3e4d07882de7
Summary:
Some module classes may not be loaded yet, so looking up via classes may not always give the correct instance. This diff added a new lookup method that delegate to the bridge delegate to force load the modules as needed.
The existing moduleForName: method was left untouched because it's solely used by RCTUIManager at the moment.
Reviewed By: dshahidehpour
Differential Revision: D13033876
fbshipit-source-id: 4082fcd68498004f678b4b95adc82b5b134fefdf
Summary:
When writing a native module in C++ using CxxModule, its not currently possible to write async methods which take two callbacks, that shouldn't be projected to JS as a promise. I hit this when trying to implement the AppState module in c++. AppState has a single method on it, getCurrentAppState, which takes two callbacks (a success and a failure callback).
This change adds a couple of new CxxModule::Method ctors, which allow devs to specify that they want two callbacks, but not a promise. This is done using an extra tag in the ctor, similar to how you specify that you want to make a synchronous method. I used the existing AsyncTag to indicate that the 2 callback version should be async, and not a promise.
Pull Request resolved: https://github.com/facebook/react-native/pull/21586
Reviewed By: shergin
Differential Revision: D10520204
Pulled By: fkgozali
fbshipit-source-id: bcb2dbd91cba3c1db987dc18960247218fdbc032
Summary:
@public
We're seeing a crash on line 191 when we do `CFRelease(self->_firstTimeReachability);`. My thinking is that there's a race condition between the deallocation coming from calling `getCurrentConnectivity` twice in a row and the callback coming back.
Reviewed By: PeteTheHeat
Differential Revision: D12982772
fbshipit-source-id: d3d882a074b67a5e547e7f480f561fcaf8d79ec4
Summary:
GraphNotFoundError: When the user moves the app to the background on Android, restarts the Metro server and reopens the app, since the client hasn't requested either a delta or a bundle, the graph cache of the server is empty and thus we can't compute an update for the client (what if changes happened when the metro server was down?).
RevisionNotFoundError: I didn't manage to reproduce that one. It could happen if two clients live side-by-side, requesting the exact same bundle. In the future, if we want to handle that case, we'll need to manage a list of clients listening to a single graph so that we don't try to update the same graph multiple times for a single file change.
Disconnection: Same as GraphNotFoundError, but happens when the user moves the app to the background on iOS.
Reviewed By: mjesun
Differential Revision: D12960939
fbshipit-source-id: 5ac1dc7fd12bad5e0ee8dfa5a21c112773454ee5
Summary: Adds support for the `deleted` key to remove modules from the bundle. Without this, source maps would break after removing a module, since it would still end up in the patched bundle but not in the source map.
Reviewed By: mjesun
Differential Revision: D12874011
fbshipit-source-id: 79239756854cb2c02f14ec8b0bb2b649766393fe
Summary:
This pull request fixes a path name to be a proper case in `UITemplateProcessor`, which fixes this build warning:
```
{snip}/react/uimanager/UITemplateProcessor.cpp:17:10: warning: non-portable path to file '<react/core/ComponentDescriptor.h>';
specified path differs in case from file name on disk [-Wnonportable-include-path]
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<react/core/ComponentDescriptor.h>
1 warning generated.
```
Pull Request resolved: https://github.com/facebook/react-native/pull/22239
Differential Revision: D13020871
Pulled By: shergin
fbshipit-source-id: 77555018cd569880518ff884ed8768effc4ea97e
Summary: This diff changes the behavior of the Scheduler.schedulerDidRequestPreliminaryViewAllocation to avoid pre-allocating views that are non-layoutables
Reviewed By: shergin
Differential Revision: D12962008
fbshipit-source-id: cb2670beafdcbd2116fbdaf2dc5d1b4726330ec2
Summary: We are moving to more stable APIs removing all mentiones of the effort name from the codebase.
Reviewed By: mdvacca
Differential Revision: D12912894
fbshipit-source-id: 4a0c6b9e7454b8b14e62d419e9e9311dc0c56e7a
Summary:
androidID was a constant that was exposed as a Platform constant, but it seems to use slightly expensive methods when they need to be computed. Moving this to a method so that it is computed only when needed.
Test Plan
Reviewed By: ejanzer
Differential Revision: D6563853
fbshipit-source-id: 3c5929fcbc947c13c3a25f2bf473e145ac4bf73e
Summary:
D12911108 fixed a UBN race condition by adding a flag for module registry.
This flag was never reset if react instance gets reset, causing an assert to fire in IG.
Reviewed By: fkgozali
Differential Revision: D13010651
fbshipit-source-id: e20453f3c546d759a58fd7fb93553f774410905f
Summary: I recently changed the implementation of `getServerHost` to be more expensive. I am excluding it from constants in non-debug builds, since loading that module lies on a critical path.
Reviewed By: axe-fb
Differential Revision: D12982150
fbshipit-source-id: eaaa50418726dbb2da2d517d0810f39b0dc7fac2