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

21435 Коммитов

Автор SHA1 Сообщение Дата
Kacie Bawiec 46be292f67 Fix nested FlatList not firing onScrollDragEnd and onMomentum methods
Summary:
With nested FlatLists, three methods aren't firing: `onMomentumScrollBegin`, `onMomentumScrollEnd`, and `onScrollDragEnd`. This is because the nested child lists' methods are not being called.

This copies the solution for this from `onScrollBeginDrag` to the other three methods.

Changelog: [Fixed] Fix nested FlatList not firing onScrollDragEnd and onMomentum methods

Reviewed By: nadiia

Differential Revision: D24803418

fbshipit-source-id: 8685b1ab9f1bd5f67a88d93ac5de628d4bd69024
2020-11-10 09:08:07 -08:00
Paige Sun f27e305056 Fix prefetchImageWithMetadata redbox in AMA
Reviewed By: RSNara

Differential Revision: D24837264

fbshipit-source-id: b2aeef2c051fa15c06cf2eb6350c152b722196c2
2020-11-10 08:39:30 -08:00
Nadiia D 8f5656b347 Update to eslint@7.12
Summary:
Changelog:
[Internal] - Upgrades eslint to 7.12

Reviewed By: cpojer

Differential Revision: D24552901

fbshipit-source-id: ede66ac9367702512436bfe3cf0254686300e10b
2020-11-10 00:08:44 -08:00
Sebastian Markbage c7ab780360 React Native sync for revisions 454c221...c3e20f1
Reviewed By: rickhanlonii

Differential Revision: D24700276

fbshipit-source-id: 877759c60632985753f3cd02ad0ded50144b6744
2020-11-09 14:30:51 -08:00
Sebastian Markbage 69ade5996f React Native sync for revisions 4e5d7fa...454c221
Summary:
Base sync before adding Flight files.

This sync includes the following changes:
- **[454c2211c](https://github.com/facebook/react/commit/454c2211c )**: Refactor SchedulerHostConfigs ([#20025](https://github.com/facebook/react/pull/20025)) //<Ricky>//
- **[56e9feead](https://github.com/facebook/react/commit/56e9feead )**: Remove Blocks ([#20138](https://github.com/facebook/react/pull/20138)) //<Sebastian Markbåge>//
- **[3fbd47b86](https://github.com/facebook/react/commit/3fbd47b86 )**: Serialize pending server components by reference (lazy component) ([#20137](https://github.com/facebook/react/pull/20137)) //<Sebastian Markbåge>//
- **[930ce7c15](https://github.com/facebook/react/commit/930ce7c15 )**: Allow values to be encoded by "reference" to a value rather than the value itself ([#20136](https://github.com/facebook/react/pull/20136)) //<Sebastian Markbåge>//
- **[39eb6d176](https://github.com/facebook/react/commit/39eb6d176 )**: Rename ([#20134](https://github.com/facebook/react/pull/20134)) //<Sebastian Markbåge>//
- **[ffd842335](https://github.com/facebook/react/commit/ffd842335 )**: [Flight] Add support for Module References in transport protocol ([#20121](https://github.com/facebook/react/pull/20121)) //<Sebastian Markbåge>//
- **[343d7a4a7](https://github.com/facebook/react/commit/343d7a4a7 )**: Fast Refresh: Don't block DevTools commit hook ([#20129](https://github.com/facebook/react/pull/20129)) //<Brian Vaughn>//
- **[779a472b0](https://github.com/facebook/react/commit/779a472b0 )**: Prevent inlining into recursive commit functions ([#20105](https://github.com/facebook/react/pull/20105)) //<Andrew Clark>//
- **[25b18d31c](https://github.com/facebook/react/commit/25b18d31c )**: Traverse commit phase effects iteratively ([#20094](https://github.com/facebook/react/pull/20094)) //<Andrew Clark>//

Changelog:
[General][Changed] - React Native sync for revisions 4e5d7fa...454c221

Reviewed By: rickhanlonii

Differential Revision: D24698701

fbshipit-source-id: dfaf692b1051150355dece1657764a484b7ae603
2020-11-09 14:30:50 -08:00
Martin Sherburn d021000b9e Fix race condition in Inspector shutdown
Summary:
The `state_` member variable was getting destroyed before the `executor_` (because `state_` is declared after `executor_` https://stackoverflow.com/questions/2254263/order-of-member-constructor-and-destructor-calls). This lead to a race condition where items still pending on the `executor_` thread could try to run and access `state_` after it had already been reset.

Changelog:
[General][Fixed] - Fix race condition in Debug Inspector shutdown

Reviewed By: mhorowitz

Differential Revision: D24705062

fbshipit-source-id: e575d66322ab980b1a8c3e6083a0b3d40b9c944b
2020-11-09 11:24:59 -08:00
Lulu Wu 8e956b3afd Back out "Change StatusBar default style handling strategy"
Summary:
Original commit changeset: 76e7d0d45fd3

Changelog: [Internal]

Reviewed By: makovkastar

Differential Revision: D24783092

fbshipit-source-id: 876eaeaffbed63599553456f189f3675aa406e13
2020-11-09 07:24:22 -08:00
Kevin Gozali b6362c24f9 TM Android proguard: keep com.facebook.react.turbomodule.core.**
Summary:
Various TM infra classes previously were stripped by proguard. This updates the rule to not remove TM Android core infra.

Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D24812999

fbshipit-source-id: 3b713c63e25a209b17869f7e5311ee54a113a567
2020-11-09 02:24:41 -08:00
Kevin Gozali 803a26cb00 TM Android: Avoid creating TM instance if the module is not TM enabled
Summary:
There is a flow where TM registry is creating a module instance (as registered in the TurboReactPackage), only to discard it if it's not a TM enabled module. This may be fine for many modules, but for module like `UIManagerModule`, this may cause a race condition or other issues, including potential perf regression when accessing UIManager from JS (e.g. for getting native viewConfigs).

Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D24811838

fbshipit-source-id: 6e1cce6993a6e5c9763773f175083bf52925c910
2020-11-09 02:24:41 -08:00
Ramanpreet Nara 610dcf488b Implement method dispatch using TurboModuleSchema
Summary:
This is the final diff in the JS TurboModule codegen stack for Android. It implements method dispatch using the TurboModuleSchema object.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D22837486

fbshipit-source-id: f91b03f064941457d4b8c5e37e011468559dee71
2020-11-08 14:24:05 -08:00
Ramanpreet Nara 165dcccc58 Introduce TurboModuleSchema
Summary:
JavaTurboModule will use instances of this class to perform method invocation. TurboModuleSchema is created by parsing the `jsi::Value` that represents the TurboModule's schema.

Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D22832729

fbshipit-source-id: 792736e176c33a302f6a41c6f63a4812b09af585
2020-11-08 14:24:05 -08:00
Ramanpreet Nara b6a72bac69 Extend babel-plugin-codegen to generate TurboModule JS codegen
Summary:
## New Functionality
- Detect if the JS file represents a NativeModule spec.
  - **Note:** A JS file is a NativeModule spec if it contains a flow `interface` that extends `TurboModule`. This logic is copied over from the OSS Codegen, here: 7ccb67a49c/packages/react-native-codegen/src/parsers/flow/index.js (L60-L75)
- For all NativeModule specs, generate the spec's schema using the OSS Codegen for Modules, and conditionally inline it into every `TurboModuleRegistry.get(Enforcing)?` call in the spec, like so:

**Before:**
```
/**
 * flow
 */

import type {TurboModule} from 'RCTExport';
export interface Spec extends TurboModule {
  //...
}

export default TurboModuleRegistry.get<Spec>('FooModule');
```

**After:**
```
/**
 * flow
 */

import type {TurboModule} from 'RCTExport';
export interface Spec extends TurboModule {
  //...
}

export default TurboModuleRegistry.get<Spec>('FooModule', __getModuleShape());

function __getModuleShape() {
  if (!(global.RN$EnableTurboModuleJSCodegen === true)) {
    return undefined;
  }

  return {...};
}
```

Changelog: [General][Added] Extend react-native/babel-plugin-codegen to generate TurboModule JS codegen

Reviewed By: TheSavior

Differential Revision: D22803845

fbshipit-source-id: 18c157a1dbfcc575012184de31c38908acd53c36
2020-11-08 14:24:05 -08:00
Christoph Nakazawa a99b46aabb Upgrade to Babel 7.12.6
Summary:
Monthly Babel update. As usual, I wait until there are multiple point releases because the Babel team tends to always break a lot of things in the first ~3 patch releases.

Release Notes: https://github.com/babel/babel/releases from 7.12.0 -> 7.12.6 inclusive. From a check of each change, nothing immediately jumps out as something that would impact us.

Changelog: [Internal]

Reviewed By: MichaReiser

Differential Revision: D24723845

fbshipit-source-id: 7db8daa119a4e34cd1fd4f61e7a635fcaf4e4a91
2020-11-08 06:23:43 -08:00
Paige Sun 017bc91192 Log prefetched image's view controller moduleName and GraphQL queryRootName
Reviewed By: fkgozali, rubennorte

Differential Revision: D24683194

fbshipit-source-id: 5a3f37123c0d9f6f40124e131212e6bf190193cc
2020-11-07 02:23:54 -08:00
Ramanpreet Nara 00cfb0f919 Remove pipes from Object literal Flow types
Summary:
## Changes
{| ... |} -> { ... }

**Motivation:** In Flow, object literals are exact by default. So, there's no need for the pipes. Also: Now, the syntax for object literals is consistent across react-native-codegen.

Changelog: [Internal]

Reviewed By: hramos

Differential Revision: D24774771

fbshipit-source-id: 24ceb6f5876122aa8ad9e08c7e903215864ad6f5
2020-11-06 16:24:44 -08:00
Ramanpreet Nara cb7f3f4499 Setup TurboModule JS Codegen experiment
Summary:
## Android API
```
// Before we initialize TurboModuleManager
ReactFeatureFlags.useTurboModuleJSCodegen = true
```

## iOS API
```
// Before we initialize RCTBridge
RCTEnableTurboModuleJSCodegen(true);
```

## How is the JS Codegen actually enabled?
The above native flags are translated to the following global variable in JavaScript:
```
global.RN$JSTurboModuleCodegenEnabled = true;
```

Then, all our NativeModule specs are transpiled to contain this logic:
```
interface Foo extends TurboModule {
  // ...
}

function __getModuleSchema() {
  if (!global.RN$JSTurboModuleCodegenEnabled) {
    return undefined;
  }

  // Return the schema of this spec.
  return {...};
}

export default TurboModuleRegistry.get<Foo>('foo', __getModuleSchema());
```

Then, in our C++ JavaTurboModule, and ObjCTurboModule classes, we use the TurboModule JS codegen when the jsi::Object schema is provided from JavaScript in the TurboModuleRegistry.get call.

Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D24636307

fbshipit-source-id: 80dcd604cc1121b8a69df875bbfc87e9bb8e4814
2020-11-06 13:28:15 -08:00
Ramanpreet Nara f1e292b9c1 Set up experiment to dispatch promise methods asynchronously to NativeModules thread
Summary:
TurboModule methods that return promises are synchronously run on the JavaScript thread. Back in D22489338 (9c35b5b8c4), we wrote code to make them dispatch on the NativeModules thread. That code, however, was just left disabled. In this diff, I wire up the TurboModules infra to a MobileConfig, which should allow us to assess the performance impact of async dispatch of promise methods to the NativeModules thread in production, before we roll it out more widely.

Changelog: [Internal]

NOTE: This diff was reverted, beacuse we landed it it without D24685387.

Reviewed By: ejanzer

Differential Revision: D24787573

fbshipit-source-id: 324bd22ce79c2c16c7f7b6996496d255a2c6256e
2020-11-06 13:28:15 -08:00
Hank Chen 00d9deaf6b `Android`: font-family is not apply when secureTextEntry is true (#30164)
Summary:
This pr fixes: https://github.com/facebook/react-native/issues/30123 .

When secureTextEntry is true, setInputType will set the inputType of textInput to password type.
Password type default font-family will be monospace font, so we need to setTypeface after the setInputType.

## Changelog

[Android] [Fixed] - Font family is not apply when secureTextEntry is true.

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

Test Plan:
Before this pr:
![alt text](https://i.imgur.com/mAxLhnB.png)

After this pr:
![alt text](https://i.imgur.com/zoGYDxN.png)

Please initiated a new project and replaced the App.js with the following code:
```
iimport React from 'react';
import {SafeAreaView, TextInput} from 'react-native';

const App = () => {
  return (
    <SafeAreaView>
      <TextInput
        id={'email'}
        placeholder={'Email'}
        secureTextEntry={false}
        style={{fontFamily: 'Helvetica', fontSize: 14, fontWeight: '400'}}
      />

      <TextInput
        id={'password'}
        placeholder={'Password'}
        secureTextEntry={true}
        style={{fontFamily: 'Helvetica', fontSize: 14, fontWeight: '400'}}
      />
    </SafeAreaView>
  );
};

export default App;
```

Thanks you so much for your code review!

Reviewed By: cpojer

Differential Revision: D24686222

Pulled By: hramos

fbshipit-source-id: 863ebe1dba36cac7d91b2735fe6e914ac839ed44
2020-11-06 12:26:41 -08:00
Micha Reiser d8b0997aa9 Upgrade metro to 0.64.0
Summary:
Upgrade metro to 0.64.0

Changelog: [Internal]

Reviewed By: cpojer

Differential Revision: D24753886

fbshipit-source-id: af679ec912c5cd8049a998d045ce8a75bf30e5d3
2020-11-06 07:25:17 -08:00
Alessandro Sisto 2af406b88d Revert D24685389: Set up experiment to dispatch promise methods asynchronously to NativeModules thread
Differential Revision:
D24685389 (052e578ed6)

Original commit changeset: 8ceb2e6effc1

fbshipit-source-id: e48186dd0e928fe95cc7f2420fc02c00a62b8360
2020-11-06 06:26:29 -08:00
Ramanpreet Nara 052e578ed6 Set up experiment to dispatch promise methods asynchronously to NativeModules thread
Summary:
TurboModule methods that return promises are synchronously run on the JavaScript thread. Back in D22489338 (9c35b5b8c4), we wrote code to make them dispatch on the NativeModules thread. That code, however, was just left disabled. In this diff, I wire up the TurboModules infra to a MobileConfig, which should allow us to assess the performance impact of async dispatch of promise methods to the NativeModules thread in production, before we roll it out more widely.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D24685389

fbshipit-source-id: 8ceb2e6effc125abecfa76e5e90bd310676aefc9
2020-11-06 01:24:25 -08:00
Ramanpreet Nara 1ee406b9cc Pull out ReservedPropTypeAnnotation into type alias
Summary:
This type annotation was declared inline twice. Just pulling it out into a type alias in this diff.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D24723191

fbshipit-source-id: 9f2061087172979ea838dfdf2533e17b9b559c71
2020-11-05 18:30:09 -08:00
Ramanpreet Nara 0de4b514be Simplify Int32EnumTypeAnnotation and StringEnumTypeAnnotation
Summary:
Int32EnumTypeAnnotation represents a union of numbers. In the corresponding type annotation, we represent options as `$ReadOnlyArray<{value: number}>`. Since each option is a number, we could instead represent options as `$ReadOnlyArray<number>` - there's no need to use an object with a singular property (i.e: 'value'). The same is could be said of StringEnumTypeAnnotation.

In this diff, we change `Int32EnumTypeAnnotation.options` to `$ReadOnlyArray<number>`, and `StringEnumTypeAnnotation.options` to `$ReadOnlyArray<string>`.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D24723107

fbshipit-source-id: 4734cf72a4a29b6b321d8161bea70cf524ce0963
2020-11-05 18:30:09 -08:00
Ramanpreet Nara a31d7aa2d3 Standardize on one FunctionTypeAnnotation shape
Summary:
Commands are `FunctionTypeAnnotation`, but they don't have a return type. I this diff, I introduced a `FunctionTypeAnnotation<+P, +R>` utility type, and made the `CommandTypeAnnotation` be an instantiation of it, with the return type fixed to `VoidTypeAnnotation`.

Now, the shape of a FunctionTypeAnnotation is unified across the NativeModule and Component schemas.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D24719965

fbshipit-source-id: 0089c3b23f05b0c534ba28dbe336c7f2db5866b3
2020-11-05 18:30:09 -08:00
Ramanpreet Nara 0d748cf8bb Rename NativeModulePropertySchema -> NativeModulePropertyShape
Summary:
Everywhere else in the CodegenSchema, type annotation partials are suffixed with "Shape". In the NativeModule schema, we were using the suffix "Schema". In this diff, we standardize on the "Shape" suffix.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D24719395

fbshipit-source-id: 307935f5fe0681c31cd52e9cf4ae579f61c1ae68
2020-11-05 18:30:08 -08:00
Ramanpreet Nara c6b8c75b6b Remove miscellaneous exports of NativeModule Flow types in Codegen Schema
Summary:
CodegenSchema exports `NativeModuleMethodParamSchema` and `NativeModuleObjectTypeAnnotationPropertySchema`, which are partials of NativeModule type annotations. This creates unnecessary coupling between the type annotations of CodegenSchema and the files that depend on it.

**Actual Problem:** Suppose that we want to rename one of these partials. Then, all imports in all files would have to be updated, even when the actual shape of the composed type annotation wasn't changed.

This diff removes these partials, which reduces the surface area of the exports of CodegenSchema.js

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D24719396

fbshipit-source-id: c822aaa252f156c524f4ef4917ebb61b1a39ff9e
2020-11-05 18:30:08 -08:00
Ramanpreet Nara 04f235e7fb Rename Commands* -> Command*
Summary:
The names of events and props flow type annotations are singular. The names of the commands flow types are however plural. This diff renames all "Commands*" flow types to be singular.

**Motivation:** Consistency

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D24708276

fbshipit-source-id: 5d5d2123426ca1139953169d0ea764b82b2f3809
2020-11-05 18:30:08 -08:00
Ramanpreet Nara 688caa0bdc Introduce ObjectTypeAnnotation utility type
Summary:
All throughout the Codegen schema, we re-declare the following shape:
```
{
  type: 'ObjectTypeAnnotation',
  properties: $ReadOnlyArray<{
    name: string,
    optional: boolean,
    typeAnnotation: ...
  }>
}
```

This diff introduces an `ObjectTypeAnnotation<T>` utility type and replaces those re-declarations with instantiations of this type.

**Motivation:** To reduce noise in the CodegenSchema. This should be a pure refactor, and shouldn't actually change any behaviour.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D24707963

fbshipit-source-id: 6b4eb711ddd041f3a041109ade5ad5644fb16924
2020-11-05 18:30:08 -08:00
Ramanpreet Nara b9f6937288 Reorganize CodegenSchema types into "use before declaration" order
Summary:
This diff re-organizes CodegenSchema to declare the larger types first, which use smaller undeclared types. The smaller types are declared further down the file, and they themselves use even smaller undeclared types.

**Motivation:** Increase the readability of CodegenSchema.js. Now, if people want to understand the shape of the Codegen Schema, they can just read the file from top to bottom.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D24701424

fbshipit-source-id: 181e87bff5e32d998463221891f459b0df26ef52
2020-11-05 18:30:08 -08:00
Ramanpreet Nara 1231db0d7f Rename ReservedFunctionValueTypeAnnotation to ReservedTypeAnnotation
Summary:
Reserved type annotations can appear in three different contexts: commands, props, and NativeModules. For now, commands and NativeModules share the same reserved type annotations. In the future, we may want to merge these reserved type annotations with the props reserved type annotations.

**Motivation:** The meaning of FunctionValue in FunctionValueTypeAnnotation isn't clear - in fact, it's downright confusing. Therefore, this diff renames this Flow type to ReservedTypeAnnotation, which I believe sufficiently captures the intent of the type annotation.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D24701322

fbshipit-source-id: bde0273b4a89c9e7175c60ed3468ed870b320044
2020-11-05 18:30:08 -08:00
Ramanpreet Nara 856bc2978c Introduce NamedShape utility type
Summary:
Our CodegenSchema is littered with types that have the following shape
```
{
  name: string,
  optional: boolean,
  typeAnnotation: ...
}
```

In all these types, the only difference is the typeAnnotation. This diff introduces a new utility type called `NamedShape`, that just creates this shape, given a type annotation. This should help reduce the amount of noise in the CodegenSchema, and make it a bit easier to read.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D24701331

fbshipit-source-id: a30d3e22933116e3dabf7929615905febacecba3
2020-11-05 18:30:08 -08:00
Ramanpreet Nara 0e46080847 Clean up EventObjectPropertyType
Summary:
All ObjectTypeAnnotation *properties* in the codegen have the following shape:
```
{
  name: string,
  optional: boolean,
  typeAnnotation: ...
}
```

EventObjectTypeProperty is a property of some ObjectTypeAnnotation, yet it doesn't follow this pattern. This diff cleans up EventObjectPropertyType. This is a part of a larger effort to clean up the Component Schema and unify the notion of a "type annotation" across the Component and Module schemas.

Reviewed By: yungsters

Differential Revision: D24701027

fbshipit-source-id: edc7dc632a217fb5a82ffd8a62aef990baf398c2
2020-11-05 18:30:07 -08:00
Christoph Nakazawa 3e77e15526 Continuous Integration cleanup
Reviewed By: yungsters

Differential Revision: D24700192

fbshipit-source-id: 239a8ad4848a41ad721a635d4ec37d990989f041
2020-11-05 06:09:36 -08:00
Pieter De Baets 729e535137 Fix TextLayoutManager cxx stubs
Summary: Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D24702815

fbshipit-source-id: 5928e66ed881a9a3e80d0a2c604d5ce578253fd6
2020-11-05 03:02:03 -08:00
Kevin Gozali 8663ec4f42 Unbreak iOS build due to header import failure
Summary: Changelog: [Internal]

Reviewed By: p-sun, yungsters

Differential Revision: D24749871

fbshipit-source-id: 70692b8a32f9b7a214d7192ba444c695568e2ccf
2020-11-04 21:39:18 -08:00
Lulu Wu 7324b92dc4 Change StatusBar default style handling strategy
Summary:
Changelog: [Android] - Change StatusBar style handling strategy

Previously Android status bar can set to `dark-content` or `default`, I made the following changes:

- Added `light-content` to get align with iOS
- Changed the behavior of `default` from setting status bar with 'SYSTEM_UI_FLAG_LIGHT_STATUS_BAR' to not doing anything, I did this because 1, `setStyle('default')` is found called even without explicitly declared <StatusBar> on that surface, which I think should fail silently 2, my idea is that user should set status bar style to `dark-content` or `light-content` explicitly instead of using `default`.
- Fixed the bug found in Dating Settings's Second Look.

Reviewed By: RSNara

Differential Revision: D24714152

fbshipit-source-id: 76e7d0d45fd3b8c3733efaee81426f5f449cc7d8
2020-11-04 12:48:50 -08:00
Ramanpreet Nara b141dd7008 Make getTurboModule required in RCTTurboModule protocol
Summary:
This change should make all type-safe NativeModules TurboModule-compatible.

Changelog: [Internal]

Differential Revision: D24729493

fbshipit-source-id: 7712708a24d675ca567225797016a7ff66a2920e
2020-11-04 11:22:25 -08:00
Moti Zilberman 2ea7ae4b7c Remove worker param from rn_bundle() macro
Summary: Changelog: [Internal]

Reviewed By: MichaReiser

Differential Revision: D24728338

fbshipit-source-id: a4ed2ac8fdd0115872333f46f48b488af98e681b
2020-11-04 10:10:10 -08:00
MD. Mizanur Rahman a26db2292f fix community link [404 not found] (#30313)
Summary:
The README file in this repo has a bad link - [404:NotFound]

Status code [404:NotFound] - Link: https://reactnative.dev/en/help

## Changelog

fixed link: https://reactnative.dev/help

[Link] [fixed] - fixed broken link.

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

Test Plan: ![image](https://user-images.githubusercontent.com/46071874/98048666-5fe91c00-1e58-11eb-804e-b90f6d77b15f.png)

Reviewed By: yungsters

Differential Revision: D24716546

Pulled By: cpojer

fbshipit-source-id: 684285e5cc0bb6fadc88c1f25d77b38d482084ce
2020-11-04 09:35:02 -08:00
Valentin Shergin 5c4979b2a5 Fabric: Using state auto-repeating in RCTSafeAreaViewComponentView
Summary:
This change introducing using `updateStateWithAutorepeat` for state updates in RCTSafeAreaViewComponentView. This way we can reduce the number of active commits and reduce jumps & relayout passes.
The approach with a callback is better than using `_lastPaddingStateWasUpdatedWith` because:
* When we compare the values, we can compare them with actual previous padding numbers stored in Shadow Tree.
* The value stored in a UIView instance can go away because of a view being remounted because of flattening.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: JoshuaGross

Differential Revision: D24719345

fbshipit-source-id: 9bf1ae284875b4c99cf23be2fcc9a829eb8a895e
2020-11-04 08:10:30 -08:00
Valentin Shergin bd7ab6c90b Fabric: Introducing `YogaLayoutableKindMutatesStylesAfterCloning` trait
Summary:
This implements a new ShadowNode trait that helps to propagate Yoga node `isDirty` flag down the root of the tree and clone siblings appropriately.

Several Fabric components mutate its Yoga styles after the node was cloned. In such cases, we need to mark the node as dirty after doing so. The problem with this is that the parent node and its siblings were already updated (cloned or not) based on the previous value of the `isDirty` flag. This happens because this logic is implemented in YogaLayoutableShadowNode which is a base constructor that must be called before any other logic from a subclass can run.

For now, this change enables that for SafeAreaView only (which seems to help with some junkiness issues), later we can extend the usage of this for other components if needed.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: JoshuaGross

Differential Revision: D24719347

fbshipit-source-id: b0d050afea5de9c470e05e1b4c9e7052e00ae949
2020-11-04 08:10:30 -08:00
Valentin Shergin 04de0e75a0 Back out "Use ConcreteStateTeller in RCTSafeAreaViewComponentView"
Summary:
We don't need StateTeller anymore because we already shipped state-autorepeat mechanism on Android.

Original commit changeset: 67596194b599

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: JoshuaGross

Differential Revision: D24719346

fbshipit-source-id: 798b6897c49c45ffbf481e6d1be17bc5e7810f27
2020-11-04 08:10:30 -08:00
Christoph Nakazawa bfb2c4be99 Rename `//xplat/js:experimental-packager` to `//xplat/js:metro-transform-worker`
Summary: Changelog: [Internal]

Reviewed By: MichaReiser

Differential Revision: D24678671

fbshipit-source-id: 7fc82f73b9f78411dd652f16260af61c18b539b2
2020-11-04 05:47:07 -08:00
Dulmandakh 9500eb8867 bump docker-android to 2.1 (#30296)
Summary:
docker-android released v2 which reduced image size.

## Changelog

[Internal] [Changed] - bump docker-android to 2.1

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

Test Plan: test_android, test_docker is green

Reviewed By: fkgozali

Differential Revision: D24686168

Pulled By: hramos

fbshipit-source-id: c240848f10f473b38a0967dd681254c21f877277
2020-11-03 16:57:39 -08:00
Joshua Gross 61c1d60356 LayoutAnimations: generate final mutation instruction for interrupted animations without a final Mutation already queued up
Summary:
For some interrupted animations we will execute a "final" mutation associated with the animation, if it exists. For example, "UPDATE" animations always have a final Update animation associated with them.
Some, however, do not. For example: INSERT animations do not have a final mutation associated by default. In these cases (before this diff) if the animation from opacity 0 to 1 was interrupted, the View will
appear "stuck" at some intermediate opacity. To mitigate that, we generate a synthetic "final" mutation at 100% progress through the animation if it is interrupted.

Changelog: [Internal]

Reviewed By: fred2028

Differential Revision: D24691151

fbshipit-source-id: d9730b8a3493a5eeac4de325e7e0a7a64f73c8a0
2020-11-03 09:08:19 -08:00
Helena Ford 21349d63f9 docs: fix broken links in README (#30286)
Summary:
Fix broken links in README by removing `.html` from any `reactnative.dev/docs`

## Changelog
General Fixed - Fixed broken links in README.md

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

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

Reviewed By: hramos

Differential Revision: D24673358

Pulled By: cpojer

fbshipit-source-id: 726a4742c3ae19dc51f2490619d04934f8aa861d
2020-11-03 01:34:33 -08:00
Mike Grabowski c95ee5ac18 feat: Enable Hermes to work on iOS (#29914)
Summary:
This PR makes it possible to build iOS applications with Hermes. Note that it doesn't work with `use_frameworks!` just yet.

Fixes https://github.com/facebook/react-native/issues/27845 (by downgrading iOS deployment target for RCT-Folly to 9.0)
Fixes https://github.com/facebook/react-native/issues/28810 (as above)

Checklist:
- [x] Adjust release scripts to create Hermes bytecode bundle
- [x] Release new Hermes npm package that includes iOS files (unreleased right now, if you want to try locally, you have to clone Hermes and `yarn link` its master to this project)
- [x] Test on a new React Native application in both Debug and Release (Device)
- [x] Test on an RNTester application in both Debug and Release (Device)
- [x] Add missing `i386` to Hermes framework and enable Bitcode
- [x] Inspect CI failures for possible regressions
- [x] Resolve Folly issue as reported https://github.com/facebook/react-native/issues/27845 and https://github.com/facebook/react-native/issues/28810
- [x] Release new Hermes and test against it that everything works

## Changelog

[IOS] [FEATURE] - Enable Hermes on iOS
[INTERNAL] - Upgrade to CocoaPods 1.10.0 to resolve Xcode 12.0 issues
[INTERNAL] - Upgrade to Xcode 12.0 on the CircleCI
[INTERNAL] - Fix building RNTester in Release mode
[INTERNAL] - Fix build-time errors of `libevent` with `use_frameworks!`
[INTERNAL] - Introduce `USE_HERMES` variable and test all RNTester configurations on the CI
[INTERNAL] - Do not fetch CocoaPods repository since we're using CDN anyway

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

Test Plan:
Turn on `hermes_enabled` to true in your `Podfile`, install pods, and run the iOS application. Your app should be running Hermes now.

Preview: (note "Engine: Hermes")

<img width="395" alt="Screenshot 2020-09-09 at 19 22 32" src="https://user-images.githubusercontent.com/2464966/92631584-d7c01d80-f2d1-11ea-9b40-33d73db96a53.png">

Reviewed By: hramos

Differential Revision: D24684845

Pulled By: cpojer

fbshipit-source-id: 900cbe3bf9398a6fd4a773d552899a001bf5146b
2020-11-03 01:14:38 -08:00
generatedunixname89002005325676 00456211e5 Daily `arc lint --take CLANGFORMAT`
Reviewed By: zertosh

Differential Revision: D24679750

fbshipit-source-id: 42d5a8aa40ec99be9a51a8e3eed54f2fc8e29e3a
2020-11-02 03:48:06 -08:00
Valentin Shergin 97d6f2e6a9 Fabric: `touchesShouldCancelInContentView` now always returns `YES`
Summary:
Historically, `UIScrollView`s in React Native do not cancel touches started on `UIControl`-based views (as normal iOS `UIScrollView`s do).
This diff implements this behavior.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: JoshuaGross

Differential Revision: D24661106

fbshipit-source-id: 1fb98d62f9e1528f11e7699d460aaefcec534e97
2020-10-31 16:23:29 -07:00
Kevin Gozali 7dcecb2907 Android Test: target SDK 21 instead of 16 (#30280)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/30280

Now that React Native targets minimum SDK of 21, use that SDK level to run test. For some reason the default was previously 16 (I couldn't figure out where this was configured). This fixes the following test failure:

https://app.circleci.com/pipelines/github/facebook/react-native/6937/workflows/d2d365f8-3f5d-453d-af28-68a040fb4188/jobs/174719/parallel-runs/0

To test, using local Docker image:

```
root@d5618d33a37b:/app# buck test ReactAndroid/src/test/...
Not using buckd because watchman isn't installed.
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
Parsing buck files: finished in 2.4 sec
Creating action graph: finished in 0.6 sec
Building: finished in 36.8 sec (100%) 577/577 jobs, 241 updated
  Total time: 39.9 sec
Testing: finished in 02:19.7 min (167 PASS/0 FAIL)
RESULTS FOR //ReactAndroid/src/test/java/com/facebook/react/animated:animated //ReactAndroid/src/test/java/com/facebook/react/bridge:bridge //ReactAndroid/src/test/java/com/facebook/react/devsupport:devsupport //ReactAndroid/src/test/java/com/facebook/react/modules:modules //ReactAndroid/src/test/java/com/facebook/react/packagerconnection:packagerconnection //ReactAndroid/src/test/java/com/facebook/react/uimanager/layoutanimation:layoutanimation //ReactAndroid/src/test/java/com/facebook/react/uimanager:uimanager //ReactAndroid/src/test/java/com/facebook/react/util:util //ReactAndroid/src/test/java/com/facebook/react/views:views //ReactAndroid/src/test/java/com/facebook/react:react
PASS     18.3s  7 Passed   0 Skipped   0 Failed   com.facebook.react.animated.NativeAnimatedInterpolationTest
PASS     32.4s 24 Passed   0 Skipped   0 Failed   com.facebook.react.animated.NativeAnimatedNodeTraversalTest
PASS     25.2s  4 Passed   0 Skipped   0 Failed   com.facebook.react.bridge.BaseJavaModuleTest
PASS      1.8s  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    <100ms  2 Passed   0 Skipped   0 Failed   com.facebook.react.bridge.JavaScriptModuleRegistryTest
PASS     24.7s 10 Passed   0 Skipped   0 Failed   com.facebook.react.devsupport.JSDebuggerWebSocketClientTest
PASS     16.6s  4 Passed   0 Skipped   0 Failed   com.facebook.react.devsupport.MultipartStreamReaderTest
PASS     15.4s  5 Passed   0 Skipped   0 Failed   com.facebook.react.devsupport.StackTraceHelperTest
PASS     26.0s  6 Passed   0 Skipped   0 Failed   com.facebook.react.modules.blob.BlobModuleTest
PASS     21.6s  5 Passed   0 Skipped   0 Failed   com.facebook.react.modules.camera.ImageStoreManagerTest
PASS     15.1s  1 Passed   0 Skipped   0 Failed   com.facebook.react.modules.clipboard.ClipboardModuleTest
PASS     14.4s  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      7.9s 14 Passed   0 Skipped   0 Failed   com.facebook.react.modules.network.NetworkingModuleTest
PASS      4.3s  9 Passed   0 Skipped   0 Failed   com.facebook.react.modules.network.ProgressiveStringDecoderTest
PASS      5.2s  4 Passed   0 Skipped   0 Failed   com.facebook.react.modules.network.ReactCookieJarContainerTest
PASS      9.0s  2 Passed   0 Skipped   0 Failed   com.facebook.react.modules.share.ShareModuleTest
PASS      9.3s  6 Passed   0 Skipped   0 Failed   com.facebook.react.modules.storage.AsyncStorageModuleTest
PASS      6.7s 10 Passed   0 Skipped   0 Failed   com.facebook.react.modules.timing.TimingModuleTest
PASS     22.2s  9 Passed   0 Skipped   0 Failed   com.facebook.react.packagerconnection.JSPackagerClientTest
PASS     18.3s  4 Passed   0 Skipped   0 Failed   com.facebook.react.uimanager.layoutanimation.InterpolatorTypeTest
PASS     16.9s  2 Passed   0 Skipped   0 Failed   com.facebook.react.uimanager.BaseViewManagerTest
PASS     15.9s  4 Passed   0 Skipped   0 Failed   com.facebook.react.uimanager.MatrixMathHelperTest
PASS     16.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     19.9s  1 Passed   0 Skipped   0 Failed   com.facebook.react.views.image.ImageResizeModeTest
PASS     21.5s  4 Passed   0 Skipped   0 Failed   com.facebook.react.views.image.ReactImagePropertyTest
PASS     22.9s  4 Passed   0 Skipped   0 Failed   com.facebook.react.CompositeReactPackageTest
PASS     15.9s  2 Passed   0 Skipped   0 Failed   com.facebook.react.RootViewTest
Updated test logs: buck-out/log/test.log
TESTS PASSED
```

Changelog: [Android][Deprecated] Deprecate support of Android API levels 19 and 20.

Reviewed By: JoshuaGross

Differential Revision: D24643610

fbshipit-source-id: 0b9536076d08019ef154b338acd136a82cc5a166
2020-10-31 12:48:54 -07:00