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

19732 Коммитов

Автор SHA1 Сообщение Дата
Joshua Gross fb9a7be2bd Fix TextInput left/right padding
Summary:
This fixes two things:

1) Currently it only respects Start and End padding, and if there's a Theme default, it will override Left/Right padding. Whoops.
2) Currently it doesn't respect when a TextInput starts with padding, but then is removed.

This resolves both.

It still does not account for RTL support.

Changelog: [Internal] Fix AndroidTextInput padding

Reviewed By: mdvacca

Differential Revision: D20573151

fbshipit-source-id: e89791641b6699e728cde9dbd661a8c21485fbc8
2020-03-20 18:47:31 -07:00
Héctor Ramos 987b902dc0 Fix `test_android`: Remove references to fbsource cell (#28363)
Summary:
Fixes https://github.com/facebook/react-native/issues/28361.

## Changelog

[Internal] [CI] - Fix test_android
Pull Request resolved: https://github.com/facebook/react-native/pull/28363

Test Plan:
Prior to fix:

```
react-native $ ./scripts/circleci/buck_fetch.sh
Guessing 168a69309928ba16065cdb33b1775a4af9f924a6 as the last one used version.
Using additional configuration options from /Users/hramos/.buckconfig.d/experiments, /etc/buckconfig.d/fb_chef.ini, /etc/buckconfig.d/fb_chef_override.ini
Invalidating internal cached state: Watchman failed to start. This may cause slower builds.
Parsing buck files: finished in 1.5 sec
Buck wasn't able to parse /Users/hramos/git/react-native/ReactAndroid/src/main/java/com/facebook/fbreact/specs/BUCK:
IOError: [Errno 2] No such file or directory: '/Users/hramos/git/react-native/tools/build_defs/platform_defs.bzl'
Call stack:
  File "/Users/hramos/git/react-native/.buckd/resources/168a69309928ba16065cdb33b1775a4af9f924a6/buck_server/buck_parser/profiler.py", line 507, in wrapped
    return func(*args, **kwargs)
  File "/Users/hramos/git/react-native/ReactAndroid/src/main/java/com/facebook/fbreact/specs/BUCK", line 1
    load("//tools/build_defs:platform_defs.bzl", "ANDROID")
  File "/Users/hramos/git/react-native/.buckd/resources/168a69309928ba16065cdb33b1775a4af9f924a6/buck_server/buck_parser/profiler.py", line 507, in wrapped
    return func(*args, **kwargs)

This error happened while trying to get dependency '//ReactAndroid/src/main/java/com/facebook/fbreact/specs:FBReactNativeSpec' of target '//ReactAndroid/src/main/java/com/facebook/react/devsupport:devsupport'
```
After fix:

```
react-native $ ./scripts/circleci/buck_fetch.sh
+ buck fetch ReactAndroid/src/test/java/com/facebook/react/modules
Guessing 168a69309928ba16065cdb33b1775a4af9f924a6 as the last one used version.
Using additional configuration options from /Users/hramos/.buckconfig.d/experiments, /etc/buckconfig.d/fb_chef.ini, /etc/buckconfig.d/fb_chef_override.ini
Invalidating internal cached state: Watchman failed to start. This may cause slower builds.
Parsing buck files: finished in 1.1 sec
Configuration 'ANDROID_SDK' points to an invalid directory '/opt/android_sdk'.
    When creating rule //ReactAndroid/src/main/java/com/facebook/hermes/instrumentation:instrumentation.
```

> Note: I don't have the Android SDK configured in this machine.

Verified on Circle CI. `test_android` is now green: https://circleci.com/gh/facebook/react-native/140682?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link

Reviewed By: cpojer

Differential Revision: D20564934

Pulled By: hramos

fbshipit-source-id: 5d843b8f113c4db5391ee39addc3ff259d962290
2020-03-20 15:36:54 -07:00
Mike Grabowski a8e85026cf feat: improve monorepo support by removing redundant PROJECT_ROOT (#28354)
Summary:
Historically, React Native didn't support a lot of custom project structures apart from the standard flat directory with `ios` and `android` folders. The CLI had to be explicitly started from the project root, otherwise Metro didn't work right.

In order to resolve the project root in the most accurate way, React Native assumed that project root is always `../../` from its location in `node_modules` - this is not true when the installation gets hoisted (e.g. in a monorepo).

To address that, janicduplessis brought support for custom [`PROJECT_ROOT`](9ccde378b6) that allowed overriding the `../../` in case it wasn't true.

Today, CLI is able to automatically resolve the project root, no matter where it's started. It will traverse the tree of the directories upwards and stop as soon as it meets `package.json`.

As a result, it doesn't really matter from where we start the CLI anymore as a part of `react-native-xcode.sh`.

By replacing the default value of `$REACT_NATIVE_DIR/../../` with `$PWD, that is default for all Xcode scripts, we can make the setup for monorepo easier - nobody will need to set `$PROJECT_ROOT` in order to override the incorrect defaults.

By default, all scripts defined in Xcode run from `$PWD` directory, which is the location of the iOS project. In the future, we will be able to remove `cd` entirely.

To better understand this PR, let's look a few hypothetical structures as an example:

#### Monorepo:

> tl;dr works out of the box, no need to mess around with paths

```
- package.json
- packages/
  - my-app/
     - index.js
     - package.json
     - ios/
        - MyApp.xcodeproj
```

**Before this PR**, the `react-native-xcode.sh` will start the CLI like this:

```bash
cd $REACT_NATIVE_DIR/../../
node <absolute_path_to_cli.js> bundle --entry-point index.js
```

- Because we change the directory to the root of monorepo, CLI throws an error. All in all, there's no `react-native` dependency at the workspace root.

- Some users turn `no hoist` in an act of troubleshooting the errors, which resolves the problem - `react-native` is moved under `my-app/node_modules` which makes this mechanism resolve properly.

- Some users find out about `PROJECT_ROOT` and set it to overwrite the default value. For example, setting `export PROJECT_ROOT = "$PWD/../` will set the directory to `my-app`, which has a dependency on `react-native` in a `package.json` and makes the CLI happy.

**After this PR**, the `react-native-xcode.sh` will start the CLI like this:

```bash
cd $PWD
node <absolute_path_to_cli.js> bundle --entry-point index.js
```

- The `$PWD` is `packages/my-app/ios/` because that's where the Xcode project is located. CLI will automatically set the root to `../` because that's where it finds `package.json` with `react-native` dependency. It will pass that root to Metro, unless users have set a different one themselves. Thanks to that, all paths to JavaScript files remain working and unaffected.

- No need to set `PROJECT_ROOT` anymore.

- We don't rely on the location of `node_modules`, which is cleaner and future proof.

#### Standard:

> tl;dr no changes

```
- ios/
   - MyApp.xcodeproj
- index.js
- package.json
```

**Before this PR**, the `react-native-xcode.sh` will start the CLI like this:

```bash
cd $REACT_NATIVE_DIR/../../
node <absolute_path_to_cli.js> bundle --entry-point index.js
```

- Everything works fine. Path from `react-native` inside `node_modules` is correct - the project root is set right to `/`

**After this PR**, the `react-native-xcode.sh` will start the CLI like this:

```bash
cd $PWD
node <absolute_path_to_cli.js> bundle --entry-point index.js
```

- The root will be set to where Xcode project is located, which is `/ios`. This is the PWD for all Xcode scripts.

CLI will look for the `package.json` going upwards from `ios` folder. Will stop at `/`, find out it has `react-native` dependency, load it and its commands and proceed further.

## Changelog

[iOS] [Feature] - Better monorepo support when building release apk
Pull Request resolved: https://github.com/facebook/react-native/pull/28354

Test Plan:
- All projects (standard/monorepo) run without issues.
- PROJECT_ROOT is not needed.

CC: Titozzz (who wrote monorepo guide), alloy, bartolkaruza

Reviewed By: cpojer

Differential Revision: D20558005

Pulled By: hramos

fbshipit-source-id: 2551120beadcfd4c2f1393ce8a2c2fa6b93c9290
2020-03-20 11:36:46 -07:00
Tommy Nguyen 175589bff0 Add diffing to app bundle size reports (#28284)
Summary:
Add diffing to app bundle size reports.

## Changelog

[Internal] [Changed] - Add diffing to app bundle size reports

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

Test Plan:
- App bundle size reports should now display a diff where available
  - Right now, the database contains only one entry for the last known good iOS build
- Triggering a new build should not create additional comments

Reviewed By: cpojer

Differential Revision: D20450158

Pulled By: hramos

fbshipit-source-id: 720772275f24d3ff0a49705f4dada2efe2e99bd3
2020-03-20 07:15:11 -07:00
Sam Mathias Weggersen f2ffa03139 Change nightly build from hourly to nightly (daily at 00:00) (#28346)
Summary:
We initially added the nightly build test to run every hour, in order to more quickly validate it. Now that it has been validated we can run it every night as it is intended to do.

cc hramos

## Changelog

[General] [Changed] - Change nightly build from hourly to nightly
Pull Request resolved: https://github.com/facebook/react-native/pull/28346

Reviewed By: cpojer

Differential Revision: D20550143

Pulled By: hramos

fbshipit-source-id: 9487c6785684ad6ea7e877290d50a33118090a7f
2020-03-20 00:33:38 -07:00
Joshua Gross b54257c628 Introduce early dispatch of ViewCommands in FabricUIManager
Summary:
Earlier this week I introduced a change in the old, non-Fabric renderer (D20378633 D20427803) that (gated behind a feature-flag) executes ViewCommands before all other types of commands, as a perf optimization and (I think) a potential fix for a category of race conditions.

I've added more details in comments here.

The Fabric renderer uses the same feature-flag that I introduced for the non-Fabric renderer.

Changelog: [Internal] Fabric

Reviewed By: mdvacca

Differential Revision: D20449186

fbshipit-source-id: bb3649f565f32c417a6247369902333989a043aa
2020-03-19 23:02:05 -07:00
Joshua Gross 0fe548aa2a Only retry ViewCommand mount items if exception is marked as "Retryable"
Summary:
Instead of just blindly retrying all ViewCommands if they fail - which could be dangerous, since it's arbitrary imperative commands we'd be executing twice, potentially with bad app state - we only retry if the ViewCommand throws a "RetryableMountingLayerException".

Changelog: [Internal] Optimization to ViewCommands

Reviewed By: mdvacca

Differential Revision: D20529985

fbshipit-source-id: 0217b43f4bf92442bcc7ca48c8ae2b9a9e543dc9
2020-03-19 23:02:04 -07:00
Joshua Gross 7561adac77 Consolidate "dispatchMountItems" reentrancy prevention code, and retry code, in one function
Summary:
Simplifying the dispatchMountItems reentrance and retry logic.

Motivation: cleanup so I can work on dispatching ViewCommands before anything else.

Importantly, this gives us the properties that:
1) Only one function is responsible for calling dispatchMountItems
2) Only one function is responsible for deciding if we shouldn't call dispatchMountItems due to reentrance
3) Only one function is responsible for all cleanup
4) Only one function maintains all of the relevant flags (except dispatchPreMountItems... two total now, instead of 4 before)

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D20437035

fbshipit-source-id: 5370366790eb25f653bee6c1950e747458374a61
2020-03-19 23:02:04 -07:00
Ramanpreet Nara 950826f6b5 Back out "Track animations and flush them"
Summary:
Original commit changeset: b594d0e6e9b6

D20319824 introduced a problem in LayoutAnimations, which makes surfaced as the problem in T63911344. This diff reverts D20319824.

Changelog: [Internal]

Reviewed By: lunaleaps

Differential Revision: D20541918

fbshipit-source-id: ff72b839f57d39051122920a38b2632cbb5ec362
2020-03-19 20:49:36 -07:00
Rick Hanlon 9c64bd5739 Properly handle LogBox errors during tests
Summary:
This diff fixes an issue where errors in LogBox during tests would cause the tests to crash.

The crash is due to the NativeExceptionsManager module not being mocked (as all native module need to be in tests). The fix is to properly mock the NativeExceptionManger.

This fix exposed an infinite loop issue where failures in LogBox will be logged to the ExceptionManager, which logs to the console, which logs to LogBox, creating a loop. This diff also fixes that look by moving the LogBox internal error check to the top of the monkey patched console methods.

Changelog: [Internal]

Differential Revision: D20428590

fbshipit-source-id: 7289a480c99ba8dee67772178b7629afb40b330a
2020-03-19 20:31:01 -07:00
Sergio Estevao 5a3c6faee9 Fix mock for TextInput (#28332)
Summary:
This PR adds the `isFocused` method to the mock of the TextInput component. My understanding some of the latest changes on the TextInput to make it use a forwardRef change the way this method is mock giving an error when trying to use in on a mock.
The change suggested here fixes the issue.

## Changelog

[JavaScript] [Fixed] - Fix the mock for TextInput to support the `isFocused` method
Pull Request resolved: https://github.com/facebook/react-native/pull/28332

Reviewed By: cpojer

Differential Revision: D20538044

Pulled By: TheSavior

fbshipit-source-id: be734af105ab62ffdf9ed4017bd70845e207f8cd
2020-03-19 11:44:55 -07:00
Christoph Nakazawa 18a8c8580d Upgrade to Metro 0.59
Summary:
Upgrades RN to Metro 0.59.

Changelog: [Internal] Metro Upgrade

Reviewed By: motiz88

Differential Revision: D20533864

fbshipit-source-id: 3c5fb8e37d2363edf0b9a1a8cfbdefba00763415
2020-03-19 07:22:25 -07:00
Valentin Shergin ad34c63d9e Fabric: Exposing `RCTParagraphComponentView::attributedText`
Summary:
The new prop on RCTParagraphComponentView is meant to be used only by external introspection tools, not the RN core.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: nscoding

Differential Revision: D20523078

fbshipit-source-id: 4c457d070fd2c172d681c5aa7f731d2d52bba291
2020-03-18 19:09:58 -07:00
Ramanpreet Nara 652fa1b8d4 Add a perfLogger argument to getTurboModuleWithJSInvoker:
Summary:
## Purpose
We must modify the `getTurboModuleWithJsInvoker:` method of all our NativeModules to also accept a `id<RCTTurboModulePerformanceLogger>` object. This performance logger object should then be forwarded to the `Native*SpecJSI` constructor.

## Script
Run the following script via Node:
```
var withSpaces = (...args) => args.join('\s*')

var regexString = withSpaces(
  '-',
  '\(',
  'std::shared_ptr',
  '<',
  '(?<turboModuleClass>(facebook::react::|react::|::|)TurboModule)',
  '>',
  '\)',
  'getTurboModuleWithJsInvoker',
  ':',
  '\(',
  'std::shared_ptr',
  '<',
  '(?<callInvokerClass>(facebook::react::|react::|::|)CallInvoker)',
  '>',
  '\)',
  'jsInvoker',
  '{',
  'return',
  'std::make_shared',
  '<',
  '(?<specName>(facebook::react::|react::|::|)Native[A-Za-z0-9]+SpecJSI)',
  '>',
  '\(',
  '(?<arg1>[A-Za-z0-9]+)',
  ',',
  '(?<arg2>[A-Za-z0-9]+)',
  '\)',
  ';',
  '}',
)

var replaceString = `- (std::shared_ptr<$<turboModuleClass>>)
    getTurboModuleWithJsInvoker:(std::shared_ptr<$<callInvokerClass>>)jsInvoker
                     perfLogger:(id<RCTTurboModulePerformanceLogger>)perfLogger
{
  return std::make_shared<$<specName>>($<arg1>, $<arg2>, perfLogger);
}`

const exec = (cmd) => require('child_process').execSync(cmd, { encoding: 'utf8' });
const abspath = (filename) => `${process.env.HOME}/${filename}`;
const relpath = (filename) => filename.replace(process.env.HOME + '/', '');
const readFile = (filename) => require('fs').readFileSync(filename, 'utf8');
const writeFile = (filename, content) => require('fs').writeFileSync(filename, content);

function main() {
  const tmFiles = exec('cd ~/fbsource && xbgs -n 10000 -l getTurboModuleWithJsInvoker:').split('\n').filter(Boolean);

  tmFiles
    .filter((filename) => !filename.includes('microsoft-fork-of-react-native'))
    .map(abspath)
    .forEach((filename) => {
      const source = readFile(filename);
      const newSource = source.replace(new RegExp(regexString, 'g'), replaceString);

      if (source == newSource) {
        console.log(relpath(filename));
      }

      writeFile(filename, newSource);
    });
}

if (!module.parent) {
  main();
}
```

Also, run: `pushd ~/fbsource && js1 build oss-native-modules-specs -p ios && js1 build oss-native-modules-specs -p android && popd;`

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D20478718

fbshipit-source-id: 89ee27ed8a0338a66a9b2dbb716168a4c4582c44
2020-03-18 11:01:15 -07:00
Ramanpreet Nara 39aae1038b Perflogger codemod manual changes
Summary:
Just includes the manual changes to get the perf logger moved to the ObjCTurboModule constructor.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D20498443

fbshipit-source-id: e607588f47ccc8ae199cd97043b09dfaff7a72dd
2020-03-18 11:01:15 -07:00
Ramanpreet Nara 9c4eb14213 Pass PerfLogger to ObjCTurboModule constructor
Summary:
Previously, I had logic inside `RCTTurboModuleManager` to attach the `id<RCTTurboModulePerformanceLogger>` to the `ObjCTurboModule` object

```
/**
 * By default, all TurboModules are long-lived.
 * Additionally, if a TurboModule with the name `name` isn't found, then we
 * trigger an assertion failure.
 */
auto turboModule = [strongSelf provideTurboModule:moduleName];

/**
 * TODO(T63718299): Move this setter into the ObjCTurboModule constructor
 */
if (performanceLogger) {
  if (auto objCTurboModule = std::dynamic_pointer_cast<facebook::react::ObjCTurboModule>(turboModule)) {
    objCTurboModule->setRCTTurboModulePerformanceLogger(performanceLogger);
  };
}
```

This diff removes that logic in `RCTTurboModuleManager`, and it also removes `ObjCTurboModule::setRCTTurboModulePerformanceLogger`. Henceforth, we'll instead pass the `id<RCTTurboModulePerformanceLogger>` into `ObjCTurboModule`'s constructor. I've made all the necessary changes to the codegen scripts in this diff as well.

This should also resolve T63903079 by simply eliminating the code that's crashing production FB apps.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D20480971

fbshipit-source-id: c3899981f880aa5d1354b5c3f4018c8fd57c3bae
2020-03-18 11:01:15 -07:00
Héctor Ramos 2ef9200a4d Enable 'Needs Attention' action (#28338)
Summary:
The ['Needs Attention'](https://github.com/hramos/needs-attention) action will remove the "Needs: Author Feedback" label and replace it with "Needs: Attention" whenever the original author of an issue adds a comment.

Removes the `no-response` GitHub integration. The 'close after 21 days' functionality from `no-response` is not present in the 'Needs Attention' action. We'll need to add this back some other way. Considering we were not closing issues that were in the Needs Response state until recently, I think it's OK to proceed here.

## Changelog

[Internal] [CI] - Enable 'Needs Attention' action
Pull Request resolved: https://github.com/facebook/react-native/pull/28338

Test Plan: https://github.com/hramos/needs-attention/issues/1

Reviewed By: cpojer

Differential Revision: D20506380

Pulled By: hramos

fbshipit-source-id: a5a0a7fc330821b7c51aabc0905f520d5caa829a
2020-03-18 00:41:44 -07:00
Jesse Katsumata 5e472b314b chore(switch): migrate to es6 import/export (#28333)
Summary:
Migrate Switch component to use ES6 import/exports

motivation: trying to slowly migrate each files to use es6 import/exports to make this discussion happen
https://github.com/react-native-community/discussions-and-proposals/issues/201#issuecomment-588454552

## Changelog

[General] [Changed] - Use es6 import/export syntax for Switch component
Pull Request resolved: https://github.com/facebook/react-native/pull/28333

Test Plan: Test on RNTester

Reviewed By: TheSavior

Differential Revision: D20493110

Pulled By: hramos

fbshipit-source-id: 25279ec41955b0dbda1abab6e45b93ca1c28fa32
2020-03-17 18:35:22 -07:00
Ramanpreet Nara 91c5ff4a12 Guard against nil methodQueue in RCTBlobManager
Summary:
## Description
In T63516227, we're seeing a crash that occurs because `networking.methodQueue` is `nil`, and we try to `dispatch_async` to it.

## Hypothesis
This looks like a problem with NativeModule cleanup:
1. Some JS executes a call to `RCTBlobManager.addNetworkingHander`. This schedules an async method call on the `RCTBlobManager` method queue.
2. In `RCTCxxBridge invalidate`, on the JS thread, we loop through all the `RCTModuleData`s, and invalidate them. This invalidates our NativeModules (perhaps not all but only `RCTNetworking`).
3. The `RCTBlobManager.addNetworkingHander` method call finally executes, with `RCTNetworking`'s methodQueue set to nil, which throws this error.

Changelog:
[iOS][Fixed] - Fix RCTBlobManager cleanup crash

Reviewed By: PeteTheHeat

Differential Revision: D20498096

fbshipit-source-id: d2d60984637ddf883278289258aa9b2ae81bb172
2020-03-17 14:56:14 -07:00
Samuel Susla 48fe460ed9 When resolving borders, respect leading/trailing semantics before left/right
Summary:
Changelog: [Internal]

When resolving borders, leading/trailing semantics should take priority over left/right.

Reviewed By: shergin

Differential Revision: D20422951

fbshipit-source-id: 7a464c88f881a77732929a155aaa9b2e150bba74
2020-03-17 14:09:28 -07:00
Samuel Susla 71c7e80bfd Add RTL support
Summary:
Changelog: [internal]

layoutDirectionPass down layoutDirection from `RCTSurfacePresenter` down to `YogaLayutableShadowNode`.

In `ParagraphShadowNode`, we propagate layoutDirection from yoga node to `TextAttributes.layoutDirection`.

Reviewed By: shergin

Differential Revision: D20420041

fbshipit-source-id: 86e01d31ea9415acb8579c44c470cac870ec1b8f
2020-03-17 14:09:28 -07:00
Samuel Susla 678f1c4490 Fix crash in slider with custom image
Summary:
Changelog: [Internal]

# Why was it crashing?
Crash was caused by `data.getTrackImageRequest()` returning NULL. The crash happened inside `getCoordinator` method. If you look at the implementation of the method below

```
if (request) {
    return &request->getObserverCoordinator();
} else {
    return nullptr;
}
```

you might notice that we check for NULL, why is it crashing then? And why is it only crashing in production?

The reason is compiler's optimiser, which looks at `data.getTrackImageRequest()`, this method returns `ImageRequest const &` and sees that this method will always return a value, never NULL. Compiler then looks at our `getCoordinator` function, sees that we check there for nullity but since it can never be null, removes that branch.

# Solution
Create new SliderState with non null image observer.

Reviewed By: shergin

Differential Revision: D20491367

fbshipit-source-id: 17b7cf31feabbe6f8ece324a3d329902b2ef6a2d
2020-03-17 13:56:46 -07:00
Eloy Durán 79490d91ad Seed ssh-agent with github's fingerprint (#28304)
Summary:
Fixes https://github.com/facebook/react-native/issues/28295

Currently [the publish job](https://circleci.com/gh/facebook/react-native/138343) fails with:

```
The authenticity of host 'github.com (192.30.253.113)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)?
```

As per the [CircleCI docs](https://support.circleci.com/hc/en-us/articles/115015628247-Are-you-sure-you-want-to-continue-connecting-yes-no-), I’ve added a step to seed the ssh-agent with [github’s SHA256 RSA fingerprint](https://help.github.com/en/github/authenticating-to-github/githubs-ssh-key-fingerprints).

## Changelog

[Internal] [Fixed] - Make automated publishing of packages from CI work again
Pull Request resolved: https://github.com/facebook/react-native/pull/28304

Test Plan: We’ll have to see during the next round of releasing.

Reviewed By: cpojer

Differential Revision: D20490766

Pulled By: hramos

fbshipit-source-id: 9edfebb24226e7324855e5cb9c83875729492219
2020-03-17 09:42:34 -07:00
Nick Gerleman 161b910494 Do not explicitly include ".js" in Library imports (#28311)
Summary:
A few recent imports have explicitly added ".js" to the end of their path. This prevents Metro from resolving platform-specific JS files, e.g. "Foo.android.js" or "Foo.windows.js" instead of "Foo.js".

React Native Windows provides its own implementation of files in a few cases where stock React Native will share them between Android and iOS. We hope to reduce/eliminate these long term, but requiring explicit ".js" files currently breaks us in a couple of places where we have custom implementations.

This change is a quick regex replace of ES6 and CommonJS imports in 'Libraries/" to eliminate ".js".

## Changelog

[General] [Fixed] - Do not explicitly include ".js" in Library imports
Pull Request resolved: https://github.com/facebook/react-native/pull/28311

Test Plan: I haven't done any manual validation of this, but `flow-check` should catch any issues with this during CI.

Reviewed By: cpojer

Differential Revision: D20486466

Pulled By: TheSavior

fbshipit-source-id: 31e1ccc307967417d7d09c34c859f0b2b69eac84
2020-03-17 02:11:53 -07:00
Hans Halverson 4482e531d8 Move suppressions to primary locations in xplat/js
Reviewed By: gkz

Differential Revision: D20446329

fbshipit-source-id: 2713e7713f6b0e8d1dfd9ab8c0ccb27294177589
2020-03-16 21:28:17 -07:00
Joshua Gross bb7f4dc818 Early ViewCommand dispatch: retry exactly once, log soft errors in one place
Summary:
As a followup to T63997094, I think it is better to attempt to execute early once, and then to execute the ViewCommand after the current batch of mount instructions if that fails. If both fail, then log a soft exception.

This is to support the use-case here, when ScrollView.scrollToEnd is called during the render pass, before any Views are mounted on the screen: https://our.intern.facebook.com/intern/diffusion/FBS/browse/master/xplat/js/RKJSModules/Apps/Profile/ProfileEdit/ui/featured_highlights_migration/ProfileEditFeaturedHighlightsMigrationProfilePreview.js?commit=75f66a9077abb81b7797079b567df759dd023a79&lines=221-229

Changelog: [Internal] Fix for dispatching ViewCommands early

Reviewed By: mdvacca

Differential Revision: D20478681

fbshipit-source-id: 052b3ecf4913a0096f590637faf0f68a072e2427
2020-03-16 19:41:47 -07:00
Valentin Shergin 44618c80ed Revert D20464278: Make Lambda function called in NativeModule mutable to improve performance
Differential Revision:
D20464278

Original commit changeset: 846a8bc6c61c

fbshipit-source-id: 71b69687ab3c279ec4e14f633700355af2291705
2020-03-16 16:21:28 -07:00
Joshua Gross 5296a740a7 Dispatching ViewCommands to a non-existent tag should log SoftException, but not crash
Summary:
Patch for T63997094.

Will still crash in debug mode, and log soft errors, so as not to entirely hide errors.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D20473855

fbshipit-source-id: 8b052b1ae3c886f83d6a7922feb158172cdcd33d
2020-03-16 13:28:08 -07:00
Luna Ruan bac9e69593 React Native sync for revisions 241c446...b5c6dd2
Summary:
This sync includes the following changes:
- **[b5c6dd2de](https://github.com/facebook/react/commit/b5c6dd2de )**: Don't use Spread in DevTools Injection (#18277) //<Sebastian Markbåge>//
- **[a463fef31](https://github.com/facebook/react/commit/a463fef31 )**: Revert "[React Native] Add getInspectorDataForViewAtPoint (#18233)" //<Sebastian Markbage>//
- **[dc7eedae3](https://github.com/facebook/react/commit/dc7eedae3 )**: Encode server rendered host components as array tuples (#18273) //<Sebastian Markbåge>//
- **[bf351089a](https://github.com/facebook/react/commit/bf351089a )**: [React Native] Add getInspectorDataForViewAtPoint (#18233) //<Ricky>//
- **[99d737186](https://github.com/facebook/react/commit/99d737186 )**: [Flight] Split Streaming from Relay Implemenation (#18260) //<Sebastian Markbåge>//
- **[160505b0c](https://github.com/facebook/react/commit/160505b0c )**: ReactDOM.useEvent: Add more scaffolding for useEvent hook (#18271) //<Dominic Gannaway>//
- **[526c12f49](https://github.com/facebook/react/commit/526c12f49 )**: Enable enableProfilerCommitHooks flag for FB (#18230) //<Brian Vaughn>//
- **[29534252a](https://github.com/facebook/react/commit/29534252a )**: ReactDOM.useEvent add flag and entry point (#18267) //<Dominic Gannaway>//
- **[704c8b011](https://github.com/facebook/react/commit/704c8b011 )**: Fix Flow type for AnyNativeEvent (#18266) //<Dominic Gannaway>//
- **[bdc5cc463](https://github.com/facebook/react/commit/bdc5cc463 )**: Add Relay Flight Build (#18242) //<Sebastian Markbåge>//
- **[7a1691cdf](https://github.com/facebook/react/commit/7a1691cdf )**: Refactor Host Config Infra (getting rid of .inline*.js) (#18240) //<Sebastian Markbåge>//
- **[238b57f0f](https://github.com/facebook/react/commit/238b57f0f )**: [Blocks] Make it possible to have lazy initialized and lazy loaded Blocks (#18220) //<Sebastian Markbåge>//
- **[235a6c4af](https://github.com/facebook/react/commit/235a6c4af )**: Bugfix: Dropped effects in Legacy Mode Suspense (#18238) //<Andrew Clark>//
- **[562cf013d](https://github.com/facebook/react/commit/562cf013d )**: Add a flag to disable module pattern components (#18133) //<Dan Abramov>//
- **[115cd12d9](https://github.com/facebook/react/commit/115cd12d9 )**: Add test run that uses www feature flags (#18234) //<Andrew Clark>//
- **[4027f2a3b](https://github.com/facebook/react/commit/4027f2a3b )**: Break up require/import statements in strings (#18222) //<Christoph Nakazawa>//
- **[024a76431](https://github.com/facebook/react/commit/024a76431 )**: Implemented Profiler onCommit() and onPostCommit() hooks (#17910) //<Brian Vaughn>//
- **[d35f8a581](https://github.com/facebook/react/commit/d35f8a581 )**: feat: honor displayName of context types (#18224) //<Brian Vaughn>//
- **[3ee812e6b](https://github.com/facebook/react/commit/3ee812e6b )**: Revert "feat: honor displayName of context types (#18035)" (#18223) //<Dominic Gannaway>//
- **[6a0efddd8](https://github.com/facebook/react/commit/6a0efddd8 )**: Modern Event System: export internal FB flag for testing (#18221) //<Dominic Gannaway>//
- **[fa03206ee](https://github.com/facebook/react/commit/fa03206ee )**: Remove _ctor field from Lazy components (#18217) //<Sebastian Markbåge>//
- **[2fe0fbb05](https://github.com/facebook/react/commit/2fe0fbb05 )**: Use accumulateTwoPhaseDispatchesSingle directly (#18203) //<Dominic Gannaway>//
- **[503fd82b4](https://github.com/facebook/react/commit/503fd82b4 )**: Modern Event System: Add support for internal FB Primer (#18210) //<Dominic Gannaway>//
- **[45c172d94](https://github.com/facebook/react/commit/45c172d94 )**: feat: honor displayName of context types (#18035) //<Brian Vaughn>//
- **[ec652f4da](https://github.com/facebook/react/commit/ec652f4da )**: Bugfix: Expired partial tree infinite loops (#17949) //<Andrew Clark>//
- **[d2158d6cc](https://github.com/facebook/react/commit/d2158d6cc )**: Fix flow types (#18204) //<Brian Vaughn>//
- **[7e83af17c](https://github.com/facebook/react/commit/7e83af17c )**: Put React.jsx and React.jsxDEV behind experimental build (#18023) //<Luna Ruan>//
- **[8cb2fb21e](https://github.com/facebook/react/commit/8cb2fb21e )**: Refine isFiberSuspenseAndTimedOut (#18184) //<Dominic Gannaway>//
- **[62861bbcc](https://github.com/facebook/react/commit/62861bbcc )**: More event system cleanup and scaffolding (#18179) //<Dominic Gannaway>//
- **[8ccfce460](https://github.com/facebook/react/commit/8ccfce460 )**: Only use Rollup's CommonJS plugin for "react-art" (#18186) //<Sebastian Markbåge>//
- **[c26506a7d](https://github.com/facebook/react/commit/c26506a7d )**: Update react-shallow-renderer from 16.12.0 to 16.13.0 (#18185) //<Minh Nguyen>//
- **[26aa1987c](https://github.com/facebook/react/commit/26aa1987c )**: [Native] Enable and remove targetAsInstance feature flag. (#18182) //<Eli White>//
- **[4469700bb](https://github.com/facebook/react/commit/4469700bb )**: Change ReactVersion from CJS to ES module (#18181) //<Sebastian Markbåge>//
- **[58eedbb02](https://github.com/facebook/react/commit/58eedbb02 )**: Check in a forked version of object-assign only for UMD builds (#18180) //<Sebastian Markbåge>//
- **[053347e6b](https://github.com/facebook/react/commit/053347e6b )**: react-test-renderer: improve findByType() error message (#17439) //<Henry Q. Dineen>//
- **[4ee592e95](https://github.com/facebook/react/commit/4ee592e95 )**: Add an early invariant to debug a mystery crash (#18159) //<Dan Abramov>//
- **[7ea4e4111](https://github.com/facebook/react/commit/7ea4e4111 )**: Fix typo in warning text (#18103) //<Sophie Alpert>//
- **[79a25125b](https://github.com/facebook/react/commit/79a25125b )**: feat: add recommended config eslint rule (#14762) //<Simen Bekkhus>//
- **[ae60caacf](https://github.com/facebook/react/commit/ae60caacf )**: [Fabric] Fix targetAsInstance dispatchEvent "cannot read property of null" (#18156) //<Joshua Gross>//
- **[d72700ff5](https://github.com/facebook/react/commit/d72700ff5 )**: Remove runtime dependency on prop-types (#18127) //<Dan Abramov>//
- **[549e41883](https://github.com/facebook/react/commit/549e41883 )**: Move remaining things to named exports (#18165) //<Sebastian Markbåge>//
- **[739f20bed](https://github.com/facebook/react/commit/739f20bed )**: Remove Node shallow builds (#18157) //<Sebastian Markbåge>//
- **[3e809bf5d](https://github.com/facebook/react/commit/3e809bf5d )**: Convert React Native builds to named exports (#18136) //<Sebastian Markbåge>//
- **[869dbda72](https://github.com/facebook/react/commit/869dbda72 )**: Don't build shallow renderer for FB (#18153) //<Dan Abramov>//
- **[293878e07](https://github.com/facebook/react/commit/293878e07 )**: Replace ReactShallowRenderer with a dependency (#18144) //<Minh Nguyen>//
- **[b4e314891](https://github.com/facebook/react/commit/b4e314891 )**: Remove unused flag (#18132) //<Dan Abramov>//
- **[849e8328b](https://github.com/facebook/react/commit/849e8328b )**: Remove unnecessary warnings (#18135) //<Dan Abramov>//
- **[f9c0a4544](https://github.com/facebook/react/commit/f9c0a4544 )**: Convert the rest of react-dom and react-test-renderer to Named Exports (#18145) //<Sebastian Markbåge>//
- **[c1c5499cc](https://github.com/facebook/react/commit/c1c5499cc )**: update version numbers for 16.13 (#18143) //<Sunil Pai>//
- **[e1c7e651f](https://github.com/facebook/react/commit/e1c7e651f )**: Update ReactDebugHooks to handle composite hooks (#18130) //<Brian Vaughn>//
- **[d28bd2994](https://github.com/facebook/react/commit/d28bd2994 )**: remove OSS testing builds (#18138) //<Sunil Pai>//
- **[8e13e770e](https://github.com/facebook/react/commit/8e13e770e )**: Remove /testing entry point from 'react' package (#18137) //<Sebastian Markbåge>//
- **[60016c448](https://github.com/facebook/react/commit/60016c448 )**: Export React as Named Exports instead of CommonJS (#18106) //<Sebastian Markbåge>//
- **[8d7535e54](https://github.com/facebook/react/commit/8d7535e54 )**: Add nolint to FB bundle headers (#18126) //<Dominic Gannaway>//
- **[bf13d3e3c](https://github.com/facebook/react/commit/bf13d3e3c )**: [eslint-plugin-react-hooks] Fix cyclic caching for loops containing a… (#16853) //<Moji Izadmehr>//
- **[501a78881](https://github.com/facebook/react/commit/501a78881 )**: runAllPassiveEffectDestroysBeforeCreates's feature flag description typo fixed (#18115) //<adasq>//
- **[09348798a](https://github.com/facebook/react/commit/09348798a )**: Codemod to import * as React from "react"; (#18102) //<Sebastian Markbåge>//
- **[78e816032](https://github.com/facebook/react/commit/78e816032 )**: Don't warn about unmounted updates if pending passive unmount (#18096) //<Brian Vaughn>//
- **[2c4221ce8](https://github.com/facebook/react/commit/2c4221ce8 )**: Change string refs in function component message (#18031) //<Sebastian Markbåge>//
- **[65bbda7f1](https://github.com/facebook/react/commit/65bbda7f1 )**: Rename Chunks API to Blocks (#18086) //<Sebastian Markbåge>//
- **[8b596e00a](https://github.com/facebook/react/commit/8b596e00a )**: Remove unused arguments in the reconciler (#18092) //<Dan Abramov>//
- **[5de5b6150](https://github.com/facebook/react/commit/5de5b6150 )**: Bugfix: `memo` drops lower pri updates on bail out (#18091) //<Andrew Clark>//
- **[abfbae02a](https://github.com/facebook/react/commit/abfbae02a )**: Update Rollup version to 1.19.4 and fix breaking changes (#15037) //<Kunuk Nykjær>//
- **[b789060dc](https://github.com/facebook/react/commit/b789060dc )**: Feature Flag for React.jsx` "spreading a key to jsx" warning (#18074) //<Sunil Pai>//
- **[3f85d53ca](https://github.com/facebook/react/commit/3f85d53ca )**: Further pre-requisite changes to plugin event system (#18083) //<Dominic Gannaway>//
- **[ea6ed3dbb](https://github.com/facebook/react/commit/ea6ed3dbb )**: Warn for update on different component in render (#17099) //<Andrew Clark>//
- **[085d02133](https://github.com/facebook/react/commit/085d02133 )**: [Native] Migrate focus/blur to call TextInputState with the host component (#18068) //<Eli White>//
- **[1000f6135](https://github.com/facebook/react/commit/1000f6135 )**: Add container to event listener signature (#18075) //<Dominic Gannaway>//
- **[a12dd52a4](https://github.com/facebook/react/commit/a12dd52a4 )**: Don't build some packages for WWW (#18078) //<Dan Abramov>//
- **[2512c309e](https://github.com/facebook/react/commit/2512c309e )**: Remove Flare bundles from build (#18077) //<Dominic Gannaway>//
- **[4912ba31e](https://github.com/facebook/react/commit/4912ba31e )**: Add modern event system flag + rename legacy plugin module (#18073) //<Dominic Gannaway>//
- **[4d9f85006](https://github.com/facebook/react/commit/4d9f85006 )**: Re-throw errors thrown by the renderer at the root in the complete phase (#18029) //<Andrew Clark>//
- **[14afeb103](https://github.com/facebook/react/commit/14afeb103 )**: Added missing feature flag //<Brian Vaughn>//
- **[691096c95](https://github.com/facebook/react/commit/691096c95 )**: Split recent passive effects changes into 2 flags (#18030) //<Brian Vaughn>//
- **[56d8a73af](https://github.com/facebook/react/commit/56d8a73af )**: [www] Disable Scheduler `timeout` w/ dynamic flag (#18069) //<Andrew Clark>//
- **[d533229fb](https://github.com/facebook/react/commit/d533229fb )**: Fix Prettier //<Dan Abramov>//
- **[56a8c3532](https://github.com/facebook/react/commit/56a8c3532 )**: eslint-plugin-react-hooks@2.4.0 //<Dan Abramov>//
- **[93a229bab](https://github.com/facebook/react/commit/93a229bab )**: Update eslint rule exhaustive deps to use new suggestions feature (#17385) //<Will Douglas>//
- **[9def56ec0](https://github.com/facebook/react/commit/9def56ec0 )**: Refactor DOM plugin system to single module (#18025) //<Dominic Gannaway>//
- **[2d6be757d](https://github.com/facebook/react/commit/2d6be757d )**: [Native] Delete NativeComponent and NativeMethodsMixin (#18036) //<Eli White>//
- **[d4f2b0379](https://github.com/facebook/react/commit/d4f2b0379 )**: Add Auto Import to Babel Plugin  (#16626) //<Luna Ruan>//
- **[8777b44e9](https://github.com/facebook/react/commit/8777b44e9 )**: Add Modern WWW build (#18028) //<Dan Abramov>//
- **[a607ea4c4](https://github.com/facebook/react/commit/a607ea4c4 )**: Remove getIsHydrating (#18019) //<Dan Abramov>//
- **[f7278034d](https://github.com/facebook/react/commit/f7278034d )**: Flush all passive destroy fns before calling create fns (#17947) //<Brian Vaughn>//
- **[529e58ab0](https://github.com/facebook/react/commit/529e58ab0 )**: Remove legacy www config from Rollup build (#18016) //<Dominic Gannaway>//
- **[42918f40a](https://github.com/facebook/react/commit/42918f40a )**: Change build from babylon to babel (#18015) //<Dominic Gannaway>//
- **[df5faddcc](https://github.com/facebook/react/commit/df5faddcc )**: Refactor commitPlacement to recursively insert nodes (#17996) //<Dominic Gannaway>//
- **[517de74b0](https://github.com/facebook/react/commit/517de74b0 )**: Tweak comment wording (#18007) //<Dan Abramov>//
- **[b63cb6f6c](https://github.com/facebook/react/commit/b63cb6f6c )**: Update ReactFiberExpirationTime.js (#17825) //<haseeb>//
- **[89c6042df](https://github.com/facebook/react/commit/89c6042df )**: fix: typo in test (#18005) //<Jesse Katsumata>//
- **[4f71f25a3](https://github.com/facebook/react/commit/4f71f25a3 )**: Re-enable shorthand CSS property collision warning (#18002) //<Sophie Alpert>//
- **[c55c34e46](https://github.com/facebook/react/commit/c55c34e46 )**: Move React Map child check to behind flags or __DEV__ (#17995) //<Dominic Gannaway>//
- **[3f814e758](https://github.com/facebook/react/commit/3f814e758 )**: Fix Flow type for React Native (#17992) //<Dan Abramov>//
- **[256d78d11](https://github.com/facebook/react/commit/256d78d11 )**: Add feature flag for removing children Map support (#17990) //<Dominic Gannaway>//
- **[9dba218d9](https://github.com/facebook/react/commit/9dba218d9 )**: [Mock Scheduler] Mimic browser's advanceTime (#17967) //<Andrew Clark>//
- **[d6e08fe0a](https://github.com/facebook/react/commit/d6e08fe0a )**: Remove Suspense priority warning (#17971) //<Dan Abramov>//
- **[812277dab](https://github.com/facebook/react/commit/812277dab )**: Fix onMouseEnter is fired on disabled buttons (#17675) //<Alfredo Granja>//
- **[3e9251d60](https://github.com/facebook/react/commit/3e9251d60 )**: make testing builds for React/ReactDOM (#17915) //<Sunil Pai>//
- **[ace9e8134](https://github.com/facebook/react/commit/ace9e8134 )**: Simplify Continuous Hydration Targets (#17952) //<Sebastian Markbåge>//
- **[7df32c4c8](https://github.com/facebook/react/commit/7df32c4c8 )**: Flush `useEffect` clean up functions in the passive effects phase (#17925) //<Brian Vaughn>//
- **[434770c3b](https://github.com/facebook/react/commit/434770c3b )**: Add beforeRemoveInstance method to ReactNoop (#17959) //<Dominic Gannaway>//
- **[6ae2c33a7](https://github.com/facebook/react/commit/6ae2c33a7 )**: StrictMode should call sCU twice in DEV (#17942) //<Brian Vaughn>//
- **[9dbe1c54d](https://github.com/facebook/react/commit/9dbe1c54d )**: Revert "Bugfix: Expiring a partially completed tree (#17926)" (#17941) //<Andrew Clark>//
- **[b2382a715](https://github.com/facebook/react/commit/b2382a715 )**: Add ReactDOM.unstable_renderSubtreeIntoContainer warning flag (#17936) //<Dominic Gannaway>//
- **[01974a867](https://github.com/facebook/react/commit/01974a867 )**: Bugfix: Expiring a partially completed tree (#17926) //<Andrew Clark>//

Changelog:
[General][Changed] - React Native sync for revisions 241c446...b5c6dd2

Reviewed By: gaearon

Differential Revision: D20347361

fbshipit-source-id: e9e6282474ab6471585e8e7fb6ea8518aa48390d
2020-03-16 13:09:54 -07:00
Valentin Shergin e602b22bfb Fabric: Tests for `traitCast<>`
Summary:
Subject.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D20462834

fbshipit-source-id: 13e3c3b45537e22002b948f967a2576bc52145e8
2020-03-16 10:21:41 -07:00
Valentin Shergin c6e224ee90 Fabric: Removing `yogaStyleFromLayoutConstraints` from RootShadowNode
Summary:
We don't need it anymore because the same logic is already implemented in `YogaLayoutableShadowNode::layoutTree()`.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D20464175

fbshipit-source-id: 3dd2293ee102a9b67a856104720d3a7dc4103d7f
2020-03-16 10:11:11 -07:00
Samuel Susla 1f4535c175 Fix state.padding being out of sync with safe area view
Summary:
Changelog: [Internal]

# Problem

SafeAreaView is getting reused, its previous `safeAreaInsets` is top: 44, bottom: 34 so `safeAreaInsetsDidChange` doesn't get called because it doesn't change. Therefore state gets never updates because `safeAreaInsetsDidChange` is never called.

# Solution

Update state whenever a new state is assigned.

Reviewed By: shergin

Differential Revision: D20444198

fbshipit-source-id: 75d1458450c70d74647df4962ddad88d5f6a38d2
2020-03-16 02:43:29 -07:00
Samuel Susla c774cb8ec5 Remove unwanted animations
Summary:
Changelog: [internal]

# Problem
Assigning `CALayer.contents` implicitly animates the difference. As we keep `UIView` in recycle pool between usages, they keep their previous state. This was causing animation of border when the views were being reused.

# Solution
Wrapping application of mutations in `CATTransaction`.

Reviewed By: shergin

Differential Revision: D20442045

fbshipit-source-id: 214d6c422f23f399dec46b5bf1a38a7b64758160
2020-03-16 02:43:29 -07:00
Jesse Katsumata 66e7a4c1aa Fix outdated urls (#28285)
Summary:
Fixed some url in the code that was outdated.

## Changelog

[Internal] [Fixed] - Fix outdated url in Image Example of RNTester and comment in StyleSheet Type
Pull Request resolved: https://github.com/facebook/react-native/pull/28285

Test Plan: Url can be accessed, and content displayed makes sense.

Differential Revision: D20464293

Pulled By: shergin

fbshipit-source-id: f0c97f7a95ed2a3d6c396cff6cda0bdaab7f5c35
2020-03-15 22:58:14 -07:00
maschad 5290047d09 Make Lambda function called in NativeModule mutable to improve performance (#28297)
Summary:
Fixes https://github.com/facebook/react-native/issues/28271
As explained by mmallet-youilabs , if the parameters passed to the `move` function are too expensive, this can have an impact on performance. Thus making these parameters captured by value mutable, the parameters are not movable.

## Changelog

[iOS] [Fixed] - Message
Pull Request resolved: https://github.com/facebook/react-native/pull/28297

Test Plan: Steps to reproduce (and expected results) are not applicable (unless running with a profiler).

Differential Revision: D20464278

Pulled By: shergin

fbshipit-source-id: 846a8bc6c61cb4aa21fbd96b419c3775190a2c84
2020-03-15 22:54:10 -07:00
maschad bcf2a716fb Removed core RCTConvert CoreLocation Libraries as well as reference i… (#28300)
Summary:
This PR is to address https://github.com/facebook/react-native/issues/28200

Even though GeoLocation was extracted from the Core, there are still libraries i.e. the CoreLocation.h library included which cause Apple to reject Apps, as mentioned here.

This removed all references to the CoreLocation library that where remaining.

## Changelog

[iOS] [Removed] - Message
Pull Request resolved: https://github.com/facebook/react-native/pull/28300

Test Plan:
- Flow check passes.
- RNTest built successfully.

Differential Revision: D20441145

Pulled By: shergin

fbshipit-source-id: 03faa4d20dc15cea931b42f34f13814df9c94a01
2020-03-15 22:36:53 -07:00
Valentin Shergin 65d6f5afbb Fabric: Removing taking zIndex into account in hit-testing algorithm
Summary:
Now we have `zIndex` feature implemented in the Core, we don't need to take `view.layer.zIndex` into account when we do hit-testing, so now we don't need to sort *all subviews* on *all levels of hierarchy* every time we process touch down event.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D20425987

fbshipit-source-id: 025bd968ae948b9b0a4188845efc0de950fb5cdf
2020-03-15 20:52:12 -07:00
Valentin Shergin efa74c4c23 Fabric: Removing applying `zIndex` to `layout.zIndex` on iOS mounting layer
Summary:
Now we have `zIndex` feature implemented in the Core, we don't need to have it implemented on the mounting layer.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D20432156

fbshipit-source-id: f77b96919bab21b6628472b9fe58c5f4e3233318
2020-03-15 20:52:12 -07:00
Valentin Shergin 14a174c237 Fabric: Implementation of `ViewProps::zIndex` feature in C++ core
Summary:
Now, having `orderIndex` feature in the core, we can use it for implementing `zIndex` feature. All we need to do is just to assign this `zIndex` value to `orderIndex`.
Then we will use this to remove some platform-specific code that implements `zIndex` on the mounting layer.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D20432155

fbshipit-source-id: b4d62b63006f45899de38e1f40b1dfbe69550ada
2020-03-15 20:52:11 -07:00
Valentin Shergin ca35bfe597 Fabric: `traitCast` now return `nullptr` if the argument is `nullptr`
Summary:
This behavior matches the behavior of `dynamic_cast` (on which some callsites rely on).

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D20456792

fbshipit-source-id: 9604da0f9f78cc7357e60ed11012756e753e4b45
2020-03-14 10:17:20 -07:00
Samuel Susla 2394108e15 Fix FindNodeAtPoint newPoint calculation
Summary:
Changelog: [Internal]

Fix newPoint calculation. This bug was revealed when testing with JS inspector.

Reviewed By: JoshuaGross, shergin, mdvacca

Differential Revision: D20369654

fbshipit-source-id: d05aac5bbd408ef5bb0e8e92f0446e287d2854a0
2020-03-14 07:35:13 -07:00
Marc Horowitz 05c17c76da Add a little headroom to the stack when converting an exception JS -> C++
Summary:
This was causing an exception cascade leading to production
errors.  Added a test which repros the problem and passes with the
fix.

Changelog: [Internal]

Reviewed By: tmikov

Differential Revision: D20408858

fbshipit-source-id: 3fa9b8669bf3bf7617bfc05ef8f23d52bc969b4e
2020-03-14 00:13:29 -07:00
David Vacca 6a6590fbdf Fix bug in TextInlineViews when using a deep nested hierarchy of Text and Images
Summary:
This fixes a bug in Android TextInlineViews that was reproducible in ActivityLog screen, see T63438920

Since Text are virtual nodes it is not necessary for these kind of views to stack views during diffing.

changelog: [internal]

Reviewed By: shergin

Differential Revision: D20448085

fbshipit-source-id: 2d852975493bf6bcc7840c80c5de5cb5f7890303
2020-03-13 22:13:57 -07:00
Jack Wang 45d7df6cf7 Adding interface callback for dynamic color scheme
Summary:
Changelog: [Android] [Added]

Adding:
- OverrideColorScheme interface to AppearanceModule
- setOverrideColorScheme method to AppearanceModule

This allows RN surfaces's color scheme to be overriden by custom theme from the app.
When set, AppearanceModule will use the value from OverrideColorScheme instead of system theme (light/dark)

Reviewed By: JoshuaGross

Differential Revision: D20405810

fbshipit-source-id: 8e562148a75231781649b615fdaf3368beeb477d
2020-03-13 22:06:04 -07:00
Valentin Shergin ee88e72c02 Fabric: Removed unused leftovers from ViewShadowNode
Summary:
This method does not have implementation and we don't use it.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D20423392

fbshipit-source-id: cfb5e4a60dbeca26a968c29d20e74dd6af0bf660
2020-03-13 22:06:04 -07:00
Héctor Ramos 07def55396 fbshipit-source-id: da15f69185e724eaf7d4bc78dbc61fcdcb3074d5 2020-03-13 21:46:45 -07:00
Héctor Ramos 10c39847a7 Re-sync with internal repository 2020-03-13 17:43:04 -07:00
Héctor Ramos 067b7a836d Revert "Merge pull request #28292 from hramos/fixup-T63861364-master"
This reverts commit 5ebca70813, reversing
changes made to 5ca1d8f260.
2020-03-13 17:35:53 -07:00
Héctor Ramos 5ebca70813
Merge pull request #28292 from hramos/fixup-T63861364-master
Re-sync with internal repository
2020-03-12 05:49:06 -07:00
Héctor Ramos 44ae0fea07 Re-sync with internal repository 2020-03-12 05:47:07 -07:00