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

4000 Коммитов

Автор SHA1 Сообщение Дата
Marc Horowitz 65d3167a80 If JSC fails to load when starting RN, expose that error to the caller
Summary:
See the comments for more info.

Changelog: [Android] [Changed] - Improve exception message when JSC loading fails

Reviewed By: tmikov

Differential Revision: D19917034

fbshipit-source-id: d846f542c31e9c94edcee240c2935d77d48d1f2a
2020-02-18 12:27:51 -08:00
Marc Horowitz ef021eac9c Add es6Proxy to RuntimeConfig
Summary:
Also clean up some unused items

Changelog: [Internal]

Reviewed By: willholen

Differential Revision: D19917035

fbshipit-source-id: dd5a0af135bdbdb7fb1a98475d99db1ec281eeba
2020-02-18 12:27:50 -08:00
Emily Janzer d4a498aba2 Allow focusing TextInput when already focused
Summary:
Right now, `requestFocus()` is a no-op if the EditText view thinks it's already focused. In certain cases, though, we still want to focus the view even if it's already focused - for example, if TalkBack is enabled and you dismiss the keyboard, you want to be able to tap on the TextInput again to bring back the keyboard, even though the View never thinks it lost focus.

What I'm doing instead is basically disregarding the View's current focus state if we *would* focus the TextInput, which is in 3 circumstances:

- When the view is attached to a window, if autofocus is true
- When the focus is being requested by JS
- When the focus is being requested by an accessibility action from the OS

Changelog: [Android][Fixed] Change how TextInput responds to requestFocus to fix a11y focus issue

Reviewed By: mdvacca

Differential Revision: D19750312

fbshipit-source-id: 30b9fab40af4a083fa98f57aba7e586540238bea
2020-02-18 12:14:17 -08:00
Sidharth Guglani d8ff5a515b fix lint errors
Summary:
Changelog: [Internal][Yoga] Fixed lint errors

```arc lint --apply-patches --take CLANGFORMAT --paths-cmd 'hg files xplat/yoga'
```
Added .clang-tidy file

Reviewed By: zertosh

Differential Revision: D19948702

fbshipit-source-id: f77a16d6f2c532267597a84a9caded0aae68c3aa
2020-02-18 08:12:18 -08:00
Rick Hanlon af710ab177 Switch from YellowBox.ignoreWarnings to LogBox.ignoreLogs
Summary:
Migrates internal calls from ignoreWarnings to ignoreLogs so we can remove YellowBox.

Changelog: [Internal]

Reviewed By: TheSavior

Differential Revision: D19813781

fbshipit-source-id: 16c7b3f2cd38cba1901eccb4d5b9a2396a37ba1b
2020-02-18 06:19:46 -08:00
Rick Hanlon 3c4c2f27aa Migrate console.disableYellowBox to LogBox.ignoreAllLogs()
Summary:
Migrates internal usages of console.disableYellowBox to LogBox.ignoreAllLogs()

Changelog: [Internal]

Reviewed By: TheSavior

Differential Revision: D19813776

fbshipit-source-id: 8c78e64596b4ba2fe94ab838881cbff6cee43e5b
2020-02-18 06:19:45 -08:00
Joshua Gross 5aae380f2d Differentiate between Fabric and non-Fabric UIManager logs
Summary:
Both the UIManagers use ReactConstants.TAG currently, so certain logs are ambiguous. Use FabricUIManager's tag instead for all logs to disambiguate.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D19945587

fbshipit-source-id: 0a9d62b5c0276688b2ad3acf8d893b523c26560a
2020-02-18 00:29:02 -08:00
Emily Janzer 8c493804f3 Fix TextInputTestCase
Summary:
https://github.com/facebook/react-native/pull/22166 removed inline styles from TextInputTestModule but applied the incorrect style to some of the TextInputs - instead of setting the text color, it set the margin. This caused the test to fail because no color was applied.

Changelog: [Android] [Fixed] Fixed style in TextInputTestCase

Reviewed By: zackargyle

Differential Revision: D19912362

fbshipit-source-id: d5068114b726ee7583842e5f6f323862b0c28e44
2020-02-14 15:03:58 -08:00
David Vacca 2b5283e39f Replace android.util.log for FLog
Summary:
We must use FLog instead of android.util.log, this diff moves the current callsites of android.util.log to FLog

changeLog:[internal]

Reviewed By: JoshuaGross

Differential Revision: D19884741

fbshipit-source-id: 300f7d691961aa51f0b525c37da7ae3d64fe5131
2020-02-13 14:43:54 -08:00
Samuel Susla b07a65b9d9 Fix ScrollView state not being set if scrollTo command was called
Summary:
# Problem
`UIManager::getRelativeLayoutMetrics`  returns incorrect `frame.origin.y` value.

Just quick reiteration how calculation of `frame.origin` works. We take frame of the target shadow node, travers hierarchy to the root and keep adding `frame.origin` of each ancestor to target shadow node's origin.

One more important piece of information, to calculate scroll view's `frame.origin`, we need to have its contentOffset which gets passed to Fabric core through state.

# So where does it go wrong?
Problem is that on Android, calling view command `scrollTo` doesn't set its internal state correctly. So when we calculate the layoutmetrics, scroll view's `frame.origin` is off by whatever value was used in `scrollTo`.

# The fix
In `ReactScrollView`, correctly set state after `scrollTo` is called on it.

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D19835549

fbshipit-source-id: d56e7b0b05023c0497e52c8b46fdcf58ca78b4a5
2020-02-13 13:01:07 -08:00
Joshua Gross 6dfcc09986 Add debug logging for T62192299
Summary:
Add debug logs for T62192299, which will hopefully tell us why RN is being destroyed in otherwise useless logs.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D19866793

fbshipit-source-id: 6656c305c8ef567335ea7fe82e4e1c68092a49d2
2020-02-13 11:29:28 -08:00
Andres Suarez ff22722e47 Daily `arc lint --take GOOGLEJAVAFORMAT`
Summary:
Changelog:
[Internal]

Differential Revision: D19875191

fbshipit-source-id: 3a1e22a4342d523f556c847a9fa780a898a96771
2020-02-13 05:50:42 -08:00
Pascal Hartig 0a6f058b6b Bump SoLoader version to 0.8.2
Summary:
New release with some fixes for RN consumers. See
https://github.com/facebook/SoLoader/releases/tag/v0.8.2

## Changelog

[Android] [Chore] Update SoLoader to 0.8.2

Reviewed By: cpojer

Differential Revision: D19856837

fbshipit-source-id: 77a8fe1aa62db951413931e8a7d5e05325beb24e
2020-02-12 10:10:39 -08:00
Pascal Hartig 917878992d Bump SoLoader buck targets
Summary:
Just released a new version. No changes impacting us here.

Changelog: [Android] [Chore] Upgrade soloader targets

(Note: this ignores all push blocking failures!)

Reviewed By: cpojer

Differential Revision: D19856603

fbshipit-source-id: bab56be19fe231ac70040fca772ce3bc77269692
2020-02-12 10:03:42 -08:00
Janic Duplessis 2c1913f0b3 Implement `adjustsFontSizeToFit` on Android (#26389)
Summary:
This adds support for `adjustsFontSizeToFit` and `minimumFontScale` on Android. The implementation tries to match closely the behaviour on iOS (hardcoded 4px min size for example). It uses a simpler linear algorithm for now, opened to improving it now if it is a deal breaker or in a follow up.

See https://twitter.com/janicduplessis/status/1171147709979516929 for a more detailed thread about the implementation

## Changelog

[Android] [Added] - Implement `adjustsFontSizeToFit` on Android
Pull Request resolved: https://github.com/facebook/react-native/pull/26389

Test Plan: Tested by adding the existing `adjustsFontSizeToFit` example from the iOS text page to android. Also added a case for limiting size by using `maxHeight` instead of `numberOfLines`.

Reviewed By: mdvacca

Differential Revision: D17285473

Pulled By: JoshuaGross

fbshipit-source-id: 43dbdb05e2d6418e9a390d11f921518bfa58e697
2020-02-10 15:00:41 -08:00
Emily Janzer c32ec1f2ab Add @DoNotStrip annotation to JavaTimerManager.deleteTimer()
Summary:
This method is being stripped in release builds because it's used directly from C++ and not referenced in Java. Adding `DoNotStrip` to prevent this.

Changelog: [Internal]

Reviewed By: PeteTheHeat, mdvacca

Differential Revision: D19708826

fbshipit-source-id: a572f0295ab3b49e5884d0a6c723d65e4bbc9226
2020-02-05 15:26:11 -08:00
Emily Janzer 73427561f7 Use JavaScriptModuleRegistry.getJSModuleName()
Summary:
It turns out that in release builds, proguard is doing something weird with inner classes, so that getSimpleName() is actually returning "OuterClass$InnerClass" in some cases. We have logic to handle this case already in JavaScriptModuleRegistry, so I'm moving that out to a static method that I can access in bridgeless mode.

Also adding tests for it.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D19701703

fbshipit-source-id: 625737bfb50ca8ba2bd26034e2a74c682783ba8a
2020-02-05 15:26:11 -08:00
David Vacca 8dcab66e4b Add android log when trying to add a view into a non viewGroup
Summary:
Easy diff to add extra logging when Fabric tries to add a view inside a view that is not a ViewGroup

changelog: [internal]

Reviewed By: JoshuaGross

Differential Revision: D19737506

fbshipit-source-id: ecb858820de7befc385e725c45b537359e39c0e7
2020-02-04 18:54:22 -08:00
Emily Janzer bf32023e50 The life-changing magic of clang-tidying up
Summary:
Adding a `.clang-tidy` to a bunch of dirs under `react-native-github/ReactAndroid` and `react-native-github/ReactCommon`.

I don't want to add a single `.clang-tidy` at the root because we'll need more fine-grained control over what checks are enabled in different parts of the codebase; for example, fabric will and TM will probably have more checks enabled than older parts of the codebase that we're not actively modernizing, and the Hermes team probably wants its own config to be consistent with the rest of their codebase.

Starting off each `.clang-tidy` by only enabling clang-diagnostic; this is just to test that it's working. In the future, we'll work with the community to gradually enable more checks.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D19705749

fbshipit-source-id: 979cea053b645ac4a9790340033bfcfb49ca0f97
2020-02-04 11:09:30 -08:00
David Vacca 9312313c3c Add Support for Emojis in Fabric for Text and TextInput components
Summary:
This diff refactors Text and Text input components in Fabric to support customizable emojis

changelog: [internal]

Reviewed By: JoshuaGross

Differential Revision: D19679391

fbshipit-source-id: 358aa97064209d28d317ba4ca5fff84245c9b1bb
2020-02-03 21:09:17 -08:00
David Vacca d1e2c9435e Extend RN Android text input to support customizable emojis
Summary:
This diff refactors RN Android text input to support customizable emojis.

changelog: [internal]

Reviewed By: JoshuaGross

Differential Revision: D19679392

fbshipit-source-id: b673e3a59f876ff9a822c2f32c9db4ff4efe007b
2020-02-03 21:09:16 -08:00
David Vacca 86d1153586 Refactor ReactShadowNode to add emoji support for TextInput and Fabric
Summary:
This diff refactors support of emojis in RN classic in order to make it easy to extend support for text input and fabric (as part of this stack)

changelog:[internal]

Reviewed By: JoshuaGross

Differential Revision: D19679394

fbshipit-source-id: 45eff49800b3db281721088f107494005d390fff
2020-02-03 21:09:16 -08:00
David Vacca acaef83a27 Delete commented code in ReactTextInputManager
Summary:
This diff deletes commented code in ReactTextInputManager.java

changeLog: [internal]

Reviewed By: JoshuaGross

Differential Revision: D19679393

fbshipit-source-id: 23b1ac9b6f427827b8faebd59f5d2446acede8f5
2020-02-03 21:09:15 -08:00
Janic Duplessis cfcf5eba43 Add new DoNotStrip class to proguard config (#27934)
Summary:
JNI now comes from https://github.com/facebookincubator/fbjni and it uses a different DoNotStrip class (https://github.com/facebookincubator/fbjni/blob/master/java/com/facebook/jni/annotations/DoNotStrip.java) so we need to include it in the proguard config.

## Changelog

[Android] [Fixed] - Add new DoNotStrip class to proguard config
Pull Request resolved: https://github.com/facebook/react-native/pull/27934

Test Plan: Test that it fixes a crash related to missing NativeRunnable class in release builds.

Differential Revision: D19690580

Pulled By: cpojer

fbshipit-source-id: cb4e2eaae35fb3a9d68f04c57cc973914207be73
2020-02-03 01:57:09 -08:00
Janic Duplessis 055a41b081 Implement native TextInput autoFocus on Android (#27924)
Summary:
Follow up to https://github.com/facebook/react-native/issues/27803. To keep consistency between the implementations this also implements autoFocus natively on Android. This will allow removing the JS auto focus logic completely.

## Changelog

[Android] [Fixed] - Implement native TextInput autoFocus on Android
Pull Request resolved: https://github.com/facebook/react-native/pull/27924

Test Plan: Test using the TextInput example in RN tester.

Differential Revision: D19674506

Pulled By: TheSavior

fbshipit-source-id: 9cbb517fc69bccd11f5292a1ccb4acea2e3713e9
2020-01-31 18:18:41 -08:00
David Vacca e4194a20a7 Return null when requesting constants for nonexistent View Managers in RN Android
Summary:
This diff changes the behavior of UIImplementation.resolveViewManager() to return null instead of throwing an exception when trying to find an unexistent viewManager during the computation of constants for view Managers.

The C++/JS code manages exceptions and null results when a view manager doesn't exists, this diff simplifies the way this method operates.

changeLog: [internal]

Reviewed By: rickhanlonii

Differential Revision: D19624423

fbshipit-source-id: df31dcfae9a588bf325b61d529cec6ead59fb19d
2020-01-31 17:06:02 -08:00
Emily Janzer d3b2ac3a84 Add @DoNotStrip to method called from cpp in bridgeless mode
Summary:
I hit a crash when testing bridgeless mode in a release build:

Error: Exception in HostFunction: java.lang.NoSuchMethodError: no non-static method "Lcom/facebook/react/modules/core/JavaTimerManager;.createTimer(IJZ)V"

It turns out that `JavaTimerManager.createTimer()` is getting stripped from release builds because it's not referenced in Java at all. Adding `DoNotStrip` annotation to keep it around. The other methods in JavaTimerManager don't need this because they're referenced by TimingModule - this is the only method that's only used directly from C++ by bridgeless mode.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D19655519

fbshipit-source-id: 8b9862475986bb84b12d81f73f677cc2e4860c67
2020-01-31 14:04:31 -08:00
Ramanpreet Nara 69bb46b55e Install TM bindings on JS thread
Summary:
Previously, users of the TurboModuleManager system would have to `TurboModuleManager.installBindings()` themselves, which synchronously attached the `__turboModuleProxy` function on the JS `global` object.

After these changes, the TurboModuleManager, when created will schedule work on the JS thread to install the global `__turboModuleProxy` function. As long as you create the TurboModuleManager before you run the bundle, we'll install the bindings before any TurboModules are accessed.

Changelog:
[Android][Fixed] - Install TM Bindings on JS thread

Reviewed By: ejanzer

Differential Revision: D19335956

fbshipit-source-id: 967ac2d3a0510392f6f0e42efe79b1a0ff6768c4
2020-01-31 10:04:41 -08:00
Emily Janzer b592c863ef Migrate ReactTextInputManager to be bridgeless
Summary: Migrate ReactTextinputManager to support bridgeless mode by accessing the EventDispatcher through the UIManagerHelper instead of from ReactContext.

Reviewed By: mdvacca

Differential Revision: D19614184

fbshipit-source-id: 5dd4945223d10785f8fe171e06d6f7ef42f9d834
2020-01-30 18:34:32 -08:00
Ramanpreet Nara 9ae95582e7 Clear all held jsi::Functions when jsi::Runtime is deleted
Summary:
## Description
You're not supposed to hold on to JSI objects (ex: `jsi::Function`) past the point where their `jsi::Runtime` is deleted. Otherwise, we get a dangling pointer crash, like this: T60262810! Historically, this cleanup problem has always been really tricky to get right. With this diff, I hope to fix that problem once and for all by deleting all `jsi::Function`s when we delete the global `__turboModuleProxy` function.

## Current Setup
- The TurboModules infra uses weak references to `CallbackWrapper`s to hold on to the `jsi::Function`s passed from JS to ObjC.
- The LongLivedObjectCollection holds on to strong references to `CallbackWrapper`s. This ensures that the `jsi::Function`s aren't deleted prematurely. This also means that we can use `LongLivedObjectCollection` to delete all `CallbackWrappers`.
- `TurboModuleBinding` is the abstraction we use to install the global `__turboModuleProxy` function. It is owned by `TurboModuleManager`, and `TurboModuleManager` uses it to clear all references to `jsi::Function`s, when we delete all NativeModules.

## Solution
1. Transfer ownership of `TurboModuleBinding` from `TurboModuleManager` to the `__turboModuleProxy` function.
2. Clear the `LongLivedObjectCollection` when `TurboModuleBinding` is deleted.

Changelog:
[iOS][Fixed] - Clear all held jsi::Functions when jsi::Runtime is deleted

Reviewed By: JoshuaGross

Differential Revision: D19565499

fbshipit-source-id: e3510ea04e72f6bda363a8fc3ee2be60303b70a6
2020-01-30 15:15:09 -08:00
Pasquale Anatriello c3bde6ef0c Swap child Yoga
Summary:
Changelog: [Internal]

Expose the replaceChild Yoga call to Java

Reviewed By: SidharthGuglani

Differential Revision: D19497193

fbshipit-source-id: 153243cc1d8c23dcaf2c772ca794bd59a230f652
2020-01-30 03:43:47 -08:00
David Vacca de95457b8f Annotate with @Nullable parameters of the UIManagerModule class
Summary:
This diff annotates with Nullable parameters of the UIManagerModule class.

changeLog: [internal]

Reviewed By: JoshuaGross

Differential Revision: D19624422

fbshipit-source-id: 0d6a095d0613c71087de004464974a7f5e755c34
2020-01-29 21:06:55 -08:00
Emily Janzer 8f5779cd70 Add in the optimization to check the first/least timer in the queue before iterating (#27841)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/27841

Follow up from https://github.com/facebook/react-native/pull/27539 - adding back in the optimization that Detox has in TimersIdlingResource to avoid iterating over the entire timers queue if the next timer is already within the specified range.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D19522346

fbshipit-source-id: 32609f434d1ca575a5a49ad630e288c43fa90864
2020-01-29 11:45:26 -08:00
Emily Janzer 3b55e1e877 Back out "Add @UiThread annotation to methods that update DisplayMetrics"
Summary:
Original commit changeset: f1d464f22877

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D19608308

fbshipit-source-id: 506f25654f9879d9000aa188bc3cf59582d855df
2020-01-28 16:52:59 -08:00
Rick Ratmansky f8a75d5c8f Revert D19456326: Migrate ReactTextInputManager to be bridgeless
Differential Revision:
D19456326

Original commit changeset: 5e9643793cd7

fbshipit-source-id: 07d23cc25c4ba242a8b8c04ac5e76d9c9656186d
2020-01-28 12:23:05 -08:00
Emily Janzer 88aa2b9316 Migrate ReactTextInputManager to be bridgeless
Summary:
Migrate ReactTextinputManager to support bridgeless mode by accessing the EventDispatcher through the UIManagerHelper instead of from ReactContext.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D19456326

fbshipit-source-id: 5e9643793cd764e29964f565db24cdea683ac032
2020-01-28 11:04:08 -08:00
Emily Janzer 32d095906e Migrate ReactImageView to be bridgeless
Summary:
Migrating ReactImageView to use the new API for accessing the EventDispatcher (UIManagerHelper.getEventDispatcherForReactTag) that supports bridgeless mode.

Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D19190765

fbshipit-source-id: a958dfc9c48845270e99f8d378ce034cddc8036f
2020-01-28 11:04:08 -08:00
Valentin Shergin eadc2ac493 Fabric: Improving precision and type-safety of Telemetry
Summary:
Collecting Telemetry is a crucial part of building a performant UI framework; we do that but we need to improve it to make the data more reliable, actionable and trustful.

Now we collect time points as the number of milliseconds from the start of the CLOCK_MONOTONIC epoch. That's fine but it also has problems:
Sometimes a millisecond is an eternity. We have only 16 (or fewer) of them on each frame. What if some operation takes 1ms (according to telemetry) but we have to run it a dozen times? Does it mean that it's 12 ms in total? So, we lack precision.
This is not type-safe. Do you know how many milliseconds in a microsecond? I don't. We multiply that on magical constants hoping that we copied that from some other place right.
The current implementation is not cross-platform. We have ifdefs for iOS and Android and Unix and Windows (which is now implemented).

So, this diff replaces that with using `std::chrono` which is part of the standard library that designed to fix all those concerns. We also define our type-aliases on top of that to express our concrete constrains:
We use `std::chrono::steady_clock` as the base clock which is according to the standard using `clock_gettime(CLOCK_MONOTONIC, ... )` if available. So, it's fast and compatible (the same under the hood) with Android infra.
We use nanoseconds when we store time durations (TelemetryDuration type).
 Changelog: [Internal] Fabric-specific internal change.

Reviewed By: JoshuaGross, mdvacca

Differential Revision: D19184569

fbshipit-source-id: 7a44688f4bb3bfc6e3009874f0075c531c8569a1
2020-01-27 13:26:49 -08:00
Bruno Barbieri aeaf286c77 - Origin header check shouldn't be case sensitive (#27827)
Summary:
Based on [this](https://stackoverflow.com/a/5259004), header names are not case sensitive.
That means that it's valid to pass a header `Origin` or `origin`.

With the current implementation. on Android only, if you pass `Origin`, it will get overwritten by the default origin.

This made me waste a lot of time debugging a problem while trying to connect to a websockets server that required an `origin` header and my implementation was working fine in iOS but not on Android, so I'm suggest changing the logic a little bit to take that into account.

## Changelog

[Android] [Fixed] - Support for case insensitive "Origin" headers for Websockets
Pull Request resolved: https://github.com/facebook/react-native/pull/27827

Test Plan:
Here's a screenshot of that shows the issue before the fix (`Origin` header set, but getting overridden)

![Screen Shot 2020-01-21 at 11 41 33 AM](https://user-images.githubusercontent.com/1247834/72824606-86302900-3c43-11ea-92c2-3d39881495f0.png)

The fix is not that easy to test since it requires a public websocket server that checks for a custom Origin header, but I think the code changes are very small and clear.

Differential Revision: D19578860

Pulled By: cpojer

fbshipit-source-id: d854e887d1b9e8e54da662b2da2ebe08ce65fdbc
2020-01-27 07:39:31 -08:00
Christoph Nakazawa 316b470b7f Use Hermes for RN instrumentation tests
Summary:
make ReactTestHelper always return a test object set to use
Hermes.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D19566604

fbshipit-source-id: 3c8fc680afbae000adb96bfcd079104d86cf06bd
2020-01-27 02:08:58 -08:00
Nikita Shanin 6237cfb325 disable momentum scrolling for vertical ScrollView (#27666)
Summary:
Following up changes added in https://github.com/facebook/react-native/issues/24045 I had the same use case for vertical ScrollView. This PR just enables existing `disableIntervalMomentum` property to work with vertical ScrollViews: restricts vertical pagination when page height is less than height of ScrollView.

## Changelog

[General] [Changed] - changed property `disableIntervalMomentum` to work with both horizontal and vertical ScrollViews
Pull Request resolved: https://github.com/facebook/react-native/pull/27666

Test Plan:
No new tests at the moment

`iOS`
```
All tests
Test Suite RNTesterUnitTests.xctest started
RCTAllocationTests
    ✓ testBridgeIsDeallocated (0.045 seconds)
    ✓ testContentViewIsInvalidated (0.006 seconds)
    ✓ testModuleMethodsAreDeallocated (0.002 seconds)
    ✓ testModulesAreDeallocated (0.022 seconds)
    ✓ testModulesAreInvalidated (0.017 seconds)
RCTAnimationUtilsTests
    ✓ testClampExtrapolate (0.002 seconds)
    ✓ testExtendExtrapolate (0.002 seconds)
    ✓ testIdentityExtrapolate (0.001 seconds)
    ✓ testManySegments (0.003 seconds)
    ✓ testSimpleOneToOneMapping (0.002 seconds)
    ✓ testWiderInputRange (0.003 seconds)
    ✓ testWiderOutputRange (0.002 seconds)
RCTBlobManagerTests
    ✓ testCreateFromParts (0.002 seconds)
    ✓ testRemove (0.001 seconds)
    ✓ testResolve (0.001 seconds)
    ✓ testResolveMap (0.001 seconds)
    ✓ testResolveURL (0.001 seconds)
RCTBundleURLProviderTests
    ✓ testBundleURL (0.041 seconds)
    ✓ testIPURL (0.005 seconds)
    ✓ testLocalhostURL (0.005 seconds)
RCTComponentPropsTests
    ✓ testNeedsOffscreenAlphaCompositing (0.019 seconds)
    ✓ testResetBackgroundColor (0.008 seconds)
    ✓ testResetProps (0.012 seconds)
    ✓ testSetProps (0.009 seconds)
RCTConvert_NSURLTests
    ✓ test_basic (0.002 seconds)
    ✓ test_documentsFolder (0.001 seconds)
    ✓ test_filePath (0.001 seconds)
    ✓ test_filePathWithEncodedSpaces (0.001 seconds)
    ✓ test_filePathWithSpaces (0.001 seconds)
    ✓ test_fileURL (0.001 seconds)
    ✓ test_fullURL (0.001 seconds)
    ✓ test_imageAt2XPath (0.001 seconds)
    ✓ test_imageFile (0.001 seconds)
    ✓ test_imageURL (0.001 seconds)
    ✓ test_imageURLWithSpaces (0.001 seconds)
    ✓ test_null (0.001 seconds)
    ✓ test_unicodeURL (0.001 seconds)
    ✓ test_urlWithEncodedSpaces (0.001 seconds)
    ✓ test_urlWithSpaces (0.001 seconds)
    ✓ testDataURL (0.003 seconds)
RCTConvert_YGValueTests
    ✓ testNumberPoints (0.002 seconds)
    ✓ testStringPercent (0.002 seconds)
    ✓ testUndefined (0.001 seconds)
RCTDevMenuTests
    ✓ testClosingActionSheetAfterAction (0.009 seconds)
    ✓ testShowCreatingActionSheet (0.017 seconds)
RCTEventDispatcherTests
    ✓ testBasicCoalescingReturnsLastEvent (0.006 seconds)
    ✓ testCoalescingEventIsImmediatelyDispatched (0.001 seconds)
    ✓ testDifferentEventTypesDontCoalesce (0.001 seconds)
    ✓ testDifferentViewTagsDontCoalesce (0.001 seconds)
    ✓ testLegacyEventsAreImmediatelyDispatched (0.001 seconds)
    ✓ testMultipleEventsResultInOnlyOneDispatchAfterTheFirstOne (0.001 seconds)
    ✓ testNonCoalescingEventIsImmediatelyDispatched (0.001 seconds)
    ✓ testRunningTheDispatchedBlockResultInANewOneBeingEnqueued (0.001 seconds)
    ✓ testSameEventTypesWithDifferentCoalesceKeysDontCoalesce (0.001 seconds)
RCTFontTests
    ✓ testFamily (0.029 seconds)
    ✓ testFamilyAndStyle (0.001 seconds)
    ✓ testFamilyAndWeight (0.002 seconds)
    ✓ testFamilyStyleAndWeight (0.002 seconds)
    ✓ testInvalidFont (0.002 seconds)
    ✓ testSize (0.001 seconds)
    ✓ testStyle (0.003 seconds)
    ✓ testStyleAndWeight (0.002 seconds)
    ✓ testVariant (0.002 seconds)
    ✓ testWeight (0.002 seconds)
RCTFormatErrorTests
    ✓ testSymbolication (0.002 seconds)
RCTGzipTests
    ✓ testDontRezipZippedData (0.004 seconds)
    ✓ testGzip (0.002 seconds)
    ✓ testRequestBodyEncoding (0.003 seconds)
RCTImageLoaderTests
    ✓ testImageDecoding (0.010 seconds)
    ✓ testImageLoaderUsesImageDecoderWithHighestPriority (0.003 seconds)
    ✓ testImageLoaderUsesImageURLLoaderWithHighestPriority (0.004 seconds)
    ✓ testImageLoading (0.004 seconds)
RCTImageUtilTests
    ✓ testLandscapeSourceLandscapeTarget (0.001 seconds)
    ✓ testPortraitSourceLandscapeTarget (0.001 seconds)
    ✓ testPortraitSourcePortraitTarget (0.001 seconds)
    ✓ testRounding (0.001 seconds)
    ✓ testScaling (0.001 seconds)
RCTJSONTests
    ✓ testDecodingArray (0.001 seconds)
    ✓ testDecodingMutableArray (0.001 seconds)
    ✓ testDecodingObject (0.001 seconds)
    ✓ testDecodingString (0.001 seconds)
    ✓ testEncodingArray (0.001 seconds)
    ✓ testEncodingNSError (0.023 seconds)
    ✓ testEncodingObject (0.001 seconds)
    ✓ testEncodingString (0.001 seconds)
    ✓ testErrorPointer (0.002 seconds)
    ✓ testLeadingWhitespace (0.001 seconds)
    ✓ testNaN (0.001 seconds)
    ✓ testNotJSONSerializable (0.001 seconds)
    ✓ testNotUTF8Convertible (0.004 seconds)
RCTMethodArgumentTests
    ✓ testAttributes (0.001 seconds)
    ✓ testGenericArray (0.001 seconds)
    ✓ testGenericDictionary (0.001 seconds)
    ✓ testGenericSet (0.001 seconds)
    ✓ testNamespacedCxxStruct (0.001 seconds)
    ✓ testNestedGenericArray (0.001 seconds)
    ✓ testNewlines (0.001 seconds)
    ✓ testNullability (0.001 seconds)
    ✓ testOneArgument (0.001 seconds)
    ✓ testSemicolonStripping (0.001 seconds)
    ✓ testSpaces (0.001 seconds)
    ✓ testTwoArguments (0.001 seconds)
    ✓ testUnnamedArgs (0.001 seconds)
    ✓ testUntypedUnnamedArgs (0.001 seconds)
    ✓ testUnused (0.001 seconds)
RCTModuleInitNotificationRaceTests
    ✓ testViewManagerNotInitializedBeforeSetBridgeModule (0.009 seconds)
RCTModuleInitTests
    ✓ testCustomInitModuleInitializedAtBridgeStartup (0.005 seconds)
    ✓ testCustomSetBridgeModuleInitializedAtBridgeStartup (0.006 seconds)
    ✓ testExportConstantsModuleInitializedAtBridgeStartup (0.005 seconds)
    ✓ testInjectedModulesInitializedDuringBridgeInit (0.003 seconds)
    ✓ testLazyInitModuleNotInitializedDuringBridgeInit (0.005 seconds)
RCTModuleMethodTests
    ✓ testFunctionType (0.001 seconds)
    ✓ testNonnull (0.001 seconds)
    ✓ testNumbersNonnull (0.001 seconds)
    ✓ testReturnsNilForDefaultFunction (0.001 seconds)
    ✓ testReturnsValueForSyncFunction (0.001 seconds)
    ✓ testReturnTypeForSyncFunction (0.001 seconds)
    ✓ testStructArgument (0.001 seconds)
    ✓ testWhitespaceTolerance (0.001 seconds)
RCTMultipartStreamReaderTests
    ✓ testMultipleParts (0.001 seconds)
    ✓ testNoCloseDelimiter (0.001 seconds)
    ✓ testNoDelimiter (0.001 seconds)
    ✓ testSimpleCase (0.001 seconds)
RCTNativeAnimatedNodesManagerTests
    ✓ testAdditionNode (0.002 seconds)
    ✓ testAnimationCallbackFinish (0.001 seconds)
    ✓ testCritcallyDampedSpringAnimation (0.003 seconds)
    ✓ testDecayAnimation (0.004 seconds)
    ✓ testDecayAnimationLoop (0.012 seconds)
    ✓ testFramesAnimation (0.001 seconds)
    ✓ testFramesAnimationLoop (0.002 seconds)
    ✓ testHandleStoppingAnimation (0.002 seconds)
    ✓ testInterpolationNode (0.002 seconds)
    ✓ testMultiplicationNode (0.001 seconds)
    ✓ testNativeAnimatedEventDoNotUpdate (0.001 seconds)
    ✓ testNativeAnimatedEventDoUpdate (0.002 seconds)
    ✓ testNodeValueListenerIfListening (0.001 seconds)
    ✓ testNodeValueListenerIfNotListening (0.001 seconds)
    ✓ testSpringAnimationLoop (0.007 seconds)
    ✓ testSpringTrackingRetainsSpeed (0.007 seconds)
    ✓ testTracking (0.002 seconds)
    ✓ testTrackingPausesWhenEndValueIsReached (0.001 seconds)
    ✓ testUnderdampedSpringAnimation (0.003 seconds)
    ✓ testViewReceiveUpdatesIfOneOfAnimationHasntStarted (0.001 seconds)
    ✓ testViewReceiveUpdatesWhenOneOfAnimationHasFinished (0.001 seconds)
RCTPerformanceLoggerTests
    ✓ testLabelCountInSyncWithRCTPLTag (0.001 seconds)
RCTShadowViewTests
    ✓ testAncestorCheck (0.001 seconds)
    ✓ testApplyingLayoutRecursivelyToShadowView (0.002 seconds)
    ✓ testAssignsSuggestedHeightDimension (0.001 seconds)
    ✓ testAssignsSuggestedWidthDimension (0.001 seconds)
    ✓ testDoesNotAssignSuggestedDimensionsWhenStyledWithFlexAttribute (0.001 seconds)
    ✓ testDoesNotOverrideDimensionStyleWithSuggestedDimensions (0.001 seconds)
RCTUIManagerTests
    ✓ testManagingChildrenToAddRemoveAndMove (0.001 seconds)
    ✓ testManagingChildrenToAddViews (0.001 seconds)
    ✓ testManagingChildrenToRemoveViews (0.001 seconds)
RCTURLUtilsTests
    ✓ testAppendParam (0.001 seconds)
    ✓ testDuplicateParamTakesLatter (0.001 seconds)
    ✓ testGetEncodedParam (0.001 seconds)
    ✓ testGetQueryParam (0.001 seconds)
    ✓ testIsLocalAssetsURLParam (0.001 seconds)
    ✓ testNilURLAppendQueryParam (0.001 seconds)
    ✓ testNilURLGetQueryParam (0.001 seconds)
    ✓ testQueryParamNotFound (0.001 seconds)
    ✓ testRemoveParam (0.001 seconds)
    ✓ testReplaceEncodedParam (0.001 seconds)
    ✓ testReplaceParam (0.001 seconds)
RCTUnicodeDecodeTests
    ✓ testEmojis (0.001 seconds)
    ✓ testNiqqud (0.001 seconds)

         Executed 167 tests, with 0 failures (0 unexpected) in 0.530 (0.667) seconds
```
`Android`
```
PASS      8.4s  7 Passed   0 Skipped   0 Failed   com.facebook.react.animated.NativeAnimatedInterpolationTest
PASS     16.7s 23 Passed   0 Skipped   0 Failed   com.facebook.react.animated.NativeAnimatedNodeTraversalTest
PASS     13.5s  4 Passed   0 Skipped   0 Failed   com.facebook.react.bridge.BaseJavaModuleTest
PASS     341ms  4 Passed   0 Skipped   0 Failed   com.facebook.react.bridge.FallbackJSBundleLoaderTest
PASS    <100ms  1 Passed   0 Skipped   0 Failed   com.facebook.react.bridge.JavaOnlyArrayTest
PASS     13.0s 10 Passed   0 Skipped   0 Failed   com.facebook.react.devsupport.JSDebuggerWebSocketClientTest
PASS      6.3s  4 Passed   0 Skipped   0 Failed   com.facebook.react.devsupport.MultipartStreamReaderTest
PASS      6.1s  5 Passed   0 Skipped   0 Failed   com.facebook.react.devsupport.StackTraceHelperTest
PASS     13.9s  6 Passed   0 Skipped   0 Failed   com.facebook.react.modules.blob.BlobModuleTest
PASS      6.7s  5 Passed   0 Skipped   0 Failed   com.facebook.react.modules.camera.ImageStoreManagerTest
PASS      5.2s  1 Passed   0 Skipped   0 Failed   com.facebook.react.modules.clipboard.ClipboardModuleTest
PASS      3.8s  5 Passed   0 Skipped   0 Failed   com.facebook.react.modules.dialog.DialogModuleTest
PASS    <100ms 10 Passed   0 Skipped   0 Failed   com.facebook.react.modules.network.HeaderUtilTest
PASS      3.3s 14 Passed   0 Skipped   0 Failed   com.facebook.react.modules.network.NetworkingModuleTest
PASS      1.4s  9 Passed   0 Skipped   0 Failed   com.facebook.react.modules.network.ProgressiveStringDecoderTest
PASS      1.6s  4 Passed   0 Skipped   0 Failed   com.facebook.react.modules.network.ReactCookieJarContainerTest
PASS      2.2s  2 Passed   0 Skipped   0 Failed   com.facebook.react.modules.share.ShareModuleTest
PASS      5.1s  6 Passed   0 Skipped   0 Failed   com.facebook.react.modules.storage.AsyncStorageModuleTest
PASS      2.7s  9 Passed   0 Skipped   0 Failed   com.facebook.react.modules.timing.TimingModuleTest
PASS      9.2s  9 Passed   0 Skipped   0 Failed   com.facebook.react.packagerconnection.JSPackagerClientTest
PASS      7.3s  4 Passed   0 Skipped   0 Failed   com.facebook.react.uimanager.layoutanimation.InterpolatorTypeTest
PASS      8.9s  2 Passed   0 Skipped   0 Failed   com.facebook.react.uimanager.BaseViewManagerTest
PASS      6.7s  4 Passed   0 Skipped   0 Failed   com.facebook.react.uimanager.MatrixMathHelperTest
PASS      8.8s  3 Passed   0 Skipped   0 Failed   com.facebook.react.uimanager.SimpleViewPropertyTest
PASS    <100ms  1 Passed   0 Skipped   0 Failed   com.facebook.react.util.JSStackTraceTest
PASS      9.5s  1 Passed   0 Skipped   0 Failed   com.facebook.react.views.image.ImageResizeModeTest
PASS     15.7s  4 Passed   0 Skipped   0 Failed   com.facebook.react.views.image.ReactImagePropertyTest
PASS      9.2s  4 Passed   0 Skipped   0 Failed   com.facebook.react.CompositeReactPackageTest
PASS      9.2s  2 Passed   0 Skipped   0 Failed   com.facebook.react.RootViewTest
```

Differential Revision: D19576473

Pulled By: shergin

fbshipit-source-id: 35a6bce9f7dd3efec0cfcdbb00796852e1a79d6c
2020-01-26 19:10:01 -08:00
Emily Janzer 53ce7b2183 Add @UiThread annotation to methods that update DisplayMetrics
Summary:
It seems like DisplayMetricsHolder doesn't have any thread safety policy, but in practice it only updates DisplayMetrics from the main thread. Let's formalize that by adding some annotations to that effect.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D19417331

fbshipit-source-id: f1d464f228776197fd0df2978c9e8edbaab67850
2020-01-24 15:15:34 -08:00
Joshua Gross 27d61388bd TextInput: update selection on native when JS calls view command
Summary:
We should have been calling this already. Trivial fix. The intent of the view command was always to update selection, I just forgot to add it. See test videos.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D19548178

fbshipit-source-id: 14a1bdc11d84c05f2435c48c3bb96b64e8c68cb4
2020-01-23 19:27:56 -08:00
Janic Duplessis d72e078df4 Add missing NativeEventListener methods to NativeDevSettings (#27838)
Summary:
Since migrating to Turbomodules (8fe04cf) the addMenuItem method crashes because the NativeEventListener methods are missing from the codegen flow type. Added the same methods based on what we do in AppState which is another native module that extends NativeEventListener.

## Changelog

[Internal] [Fixed] - Add missing NativeEventListener methods to NativeDevSettings
Pull Request resolved: https://github.com/facebook/react-native/pull/27838

Test Plan:
|Before|After|
|{F226978596}|{F226978628}

Differential Revision: D19518474

Pulled By: PeteTheHeat

fbshipit-source-id: acddba9f18dd558df1d6df78b539689fdfd0062f
2020-01-23 13:20:53 -08:00
Riley Dulin e6f3388541 Change HermesRuntime to jsi::Runtime in RuntimeAdapter
Summary:
Changelog: [Internal]

The inspector API doesn't really need a `HermesRuntime`, all it needs is a `jsi::Runtime` and a `Debugger &`.
Change the return type of `RuntimeAdapter::getRuntime` to be `jsi::Runtime`.
This will allow the inspector to use the tracing runtime instead of the direct hermes runtime.

Reviewed By: willholen

Differential Revision: D18973867

fbshipit-source-id: 6809e52452a35e62be9ca8143aeaba8964c98eaa
2020-01-23 13:16:47 -08:00
David Vacca 2db0c75cd4 Migrate events on ReactRootView and ScrollView to be bridgeless
Summary:
This diff migrates ScrollView events to be compatible with Bridgeless React mode
Changelog: [internal]

Reviewed By: makovkastar

Differential Revision: D19383061

fbshipit-source-id: d303d104a7f3bde8ba54c7be830691146c19072e
2020-01-23 12:00:24 -08:00
David Vacca 7fff4679d2 Refactor UIManagerHelper.getUIManager
Summary:
This diff refactors the UIManagerHelper.getUIManager to allow the caller determine if it should return null when catalyst Istance is not active.
This is necessary in order to keep backward compatibility for the getEventDispatcher method.

changelog: [internal]

Reviewed By: makovkastar

Differential Revision: D19383063

fbshipit-source-id: 8a46b61d212480be91ea78929bbfa7248d5f3ad9
2020-01-23 12:00:23 -08:00
Joshua Gross 26d5faf379 Fix toggling between hidden and visible password
Summary:
A previous PR broke toggling between visible and non-visible password (basically once a password field was made visible, future updates to the keyboardType were effectively ignored, so the password would always be visible).

Original PR: https://github.com/facebook/react-native/pull/27523

Changelog: [Internal]

Reviewed By: mdvacca, rodrigos-facebook

Differential Revision: D19527245

fbshipit-source-id: a5ab343c8a0c6a608171dbfa5afc7536ff241826
2020-01-22 18:49:22 -08:00
David Vacca 39089b4c45 Refactor calls to UIManagerHelper.getUIManager
Summary:
This diff refactors the usages of UIManagerHelper.getUIManager() to make sure we always consider null objects.
Some of the callsites were throwing a NullPointerExcetpion, now they throw a more explicit exception.

changelog: [internal]

Reviewed By: makovkastar

Differential Revision: D19383064

fbshipit-source-id: 1806a37528e80cab1c8fdff5eb631aaf47bde819
2020-01-22 17:50:13 -08:00
David Vacca edcbfb9821 Bump Android build-tools to 29.0.2, compileSdk to 29
Summary:
bump Android build-tools to 29.0.2, compileSdk to 29

changelog: Bump Android build-tools to 29.0.2, compileSdk to 29

Reviewed By: hramos

Differential Revision: D19182040

fbshipit-source-id: f2fc1b953a16c14e33d561078ac50b5a47eaaa13
2020-01-22 17:02:36 -08:00