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

26130 Коммитов

Автор SHA1 Сообщение Дата
Gabriel Donadel Dall'Agnol f849f49525 chore: Add getKeyName function to codegen Parser class (#35202)
Summary:
This PR adds a  `getKeyName`  function to the codegen Parser class and implements it in the Flow and TypeScript parsers as requested on https://github.com/facebook/react-native/issues/34872.

## Changelog

[Internal] [Added] - Add `getKeyName` function to codegen Parser class

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

Test Plan:
Run `yarn jest react-native-codegen` and ensure CI is green

![image](https://user-images.githubusercontent.com/11707729/200028600-87e9c1d7-d56d-4cf7-bdbc-18bdf1b03fc5.png)

Reviewed By: cipolleschi

Differential Revision: D41081711

Pulled By: jacdebug

fbshipit-source-id: 7ad2953a0e2f90f04d03270bda40d669d4d0d50a
2022-11-10 09:04:48 -08:00
Nicola Corti 90b6735c3b Invoke closeAndReleaseSonatypeStagingRepository in the publish gradle invocation (#35272)
Summary:
This PR ports back into main the changes required to properly close the SonaType repository on Maven

## Changelog

[General] [Fixed] - Close the Maven repository properly

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

Test Plan: We tested these changed in 0.71-stable branch when releasing 0.71.0-RC.0

Reviewed By: christophpurrer

Differential Revision: D41154965

Pulled By: cipolleschi

fbshipit-source-id: 74dd46e8fabf3baef544342282829c70d92f671f
2022-11-10 08:57:07 -08:00
Lorenzo Sciandra 37fbc1606c chore(issue templates): small tweaks + clear mention of support window (#35304)
Summary:
During the outage it become clear that we are not doing enough to communicate what the release support policy/window is. This is one of the tweaks I'm doing to help with that

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[Internal] [Changed] - small tweaks to issue templates + clear mention of support window

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

Test Plan: N/A

Reviewed By: christophpurrer

Differential Revision: D41183435

Pulled By: cipolleschi

fbshipit-source-id: 32519c52616fb1903507fad291200eb959d451b4
2022-11-10 08:43:13 -08:00
Tarun Chauhan e97fb466a0 implement checkIfInvalidModule in parsers (#35261)
Summary:
Part of the Codegen umbrella Issue https://github.com/facebook/react-native/issues/34872

> Create a checkIfInvalidModule function in the [parser.js file](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/parser.js) and document it. Implement [this logic](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/error-utils.js#L127-L132) in the [FlowParser.js](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/flow/parser.js#L15) and [this logic](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/error-utils.js#L136-L141) in the [TypeScriptParser.js](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/typescript/parser.js#L15). Refactor the [throwIfIncorrectModuleRegistryCallTypeParameterParserError function](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/error-utils.js#L109) to accept a Parser instead of a ParserType and use the newly created function instead of the if (language) logic.

## Changelog

[Internal] [Added] - Add checkIfInvalidModule in the Parser interface and implement it in both parsers. Refactor [throwIfIncorrectModuleRegistryCallTypeParameterParserError](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/error-utils.js#L109) to use this new function.

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

Test Plan:
Run yarn jest react-native-codegen
<img width="788" alt="image" src="https://user-images.githubusercontent.com/34857453/200616752-155d638c-5ef4-4d8b-be79-07a128523910.png">

Reviewed By: christophpurrer

Differential Revision: D41125704

Pulled By: cipolleschi

fbshipit-source-id: 029d5511050dbe975a38a890d0238cb6f3b542ea
2022-11-10 07:56:07 -08:00
Simen Bekkhus 0376aa4856 fix(jest-env): pass `exportConditions` (#35203)
Summary:
Like discussed in https://github.com/react-native-community/discussions-and-proposals/issues/509, RN should override the default `node` and `node-addons` conditions.

You might consider supporting (or just setting) [`customExportConditions`](4670d3be0d/packages/jest-environment-node/src/index.ts (L187-L189)) instead, but the default of the node env should be overwritten 🙂

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[General] [Changed] - use `'react-native'` export conditions in Jest environment

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

Test Plan: Green CI?

Reviewed By: lunaleaps

Differential Revision: D41081783

Pulled By: jacdebug

fbshipit-source-id: 844c70d92a58c5432ba5b9e5e99c8f50045ef8ac
2022-11-10 06:21:53 -08:00
Marc Rousavy 3d9a3b7af6 fix: Add missing space in method documentation (#35303)
Summary:
probably the smallest PR I ever submitted, but it was bothering me lol

There was a missing space in the method doc.

## Changelog

Add space to the method doc
<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[iOS] [Fixed] - Add missing space in method documentation comment

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

Reviewed By: jacdebug

Differential Revision: D41182765

Pulled By: cipolleschi

fbshipit-source-id: ebe5d56072137547e543a312c66cc3234142db13
2022-11-10 04:55:37 -08:00
Pieter De Baets 8a59153bd7 Remove $TEMPORARY$object types
Summary:
This was left over from an old codemod.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D41154548

fbshipit-source-id: 0b5fb3e78491b66ebaf13555f80e0265a25dc7d8
2022-11-10 04:48:13 -08:00
Ruslan Lesiutin 1453ef1a88 refactor(react-native-github): move ProgressViewIOS to internal (#35277)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35277

# Changelog:
[JS][Removed] - removed ProgressViewIOS module
[iOS][Removed] - removed native iOS sources of ProgressViewIOS

Reviewed By: lunaleaps

Differential Revision: D40937475

fbshipit-source-id: 9060adf3c99727af4eeffc767ccfd0a70574859d
2022-11-09 16:09:31 -08:00
Gabriel Donadel Dall'Agnol ff4a3c2bc7 fix: RNTester TransformExample crash (#35292)
Summary:
As pointed out by kelset on https://github.com/facebook/react-native/pull/34660#issuecomment-1309081429 accessing the `TransformExample` is currently crashing the `RNTester` app due to missing units in one of the transformers. This PR fixes it by updating the transform value to a valid string.

## Changelog

[Internal] [Fixed] - Add missing translate units to  `RNTester` `TransformExample`

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

Test Plan:
1. Open the RNTester app and navigate to the Transforms page
2. Check the transform style through the `Transform using a string` section

https://user-images.githubusercontent.com/11707729/200916399-779b2eeb-2bd8-4642-97a3-f050d6dd4278.mov

Reviewed By: christophpurrer

Differential Revision: D41164541

Pulled By: necolas

fbshipit-source-id: 4aa62980001a6f8ccf0108cb3af1e573b67e02b1
2022-11-09 13:53:51 -08:00
Christoph Purrer c0a06d2e6f react-native code-gen > C++ TurboModules struct support (#35265)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35265

This adds a templating layer for C++ TurboModules to automatically generate struct templates from TurboModule specs.

You have to define concrete types for those templates to use them in your C++ TurboModule.

E.g. for the JS flow type:
```
export type ObjectStruct = {|
  a: number,
  b: string,
  c?: ?string,
|};
```
code-gen will now generate the following template code:
```
#pragma mark - NativeCxxModuleExampleCxxBaseObjectStruct

template <typename P0, typename P1, typename P2>
struct NativeCxxModuleExampleCxxBaseObjectStruct {
  P0 a;
  P1 b;
  P2 c;
  bool operator==(const NativeCxxModuleExampleCxxBaseObjectStruct &other) const {
    return a == other.a && b == other.b && c == other.c;
  }
};

template <typename P0, typename P1, typename P2>
struct NativeCxxModuleExampleCxxBaseObjectStructBridging {
  static NativeCxxModuleExampleCxxBaseObjectStruct<P0, P1, P2> fromJs(
      jsi::Runtime &rt,
      const jsi::Object &value,
      const std::shared_ptr<CallInvoker> &jsInvoker) {
    NativeCxxModuleExampleCxxBaseObjectStruct<P0, P1, P2> result{
      bridging::fromJs<P0>(rt, value.getProperty(rt, "a"), jsInvoker),
      bridging::fromJs<P1>(rt, value.getProperty(rt, "b"), jsInvoker),
      bridging::fromJs<P2>(rt, value.getProperty(rt, "c"), jsInvoker)};
    return result;
  }

  static jsi::Object toJs(
      jsi::Runtime &rt,
      const NativeCxxModuleExampleCxxBaseObjectStruct<P0, P1, P2> &value) {
    auto result = facebook::jsi::Object(rt);
    result.setProperty(rt, "a", bridging::toJs(rt, value.a));
    result.setProperty(rt, "b", bridging::toJs(rt, value.b));
    if (value.c) {
      result.setProperty(rt, "c", bridging::toJs(rt, value.c.value()));
    }
    return result;
  }
};
```
and you can use it in our C++ TurboModule for example as:
```
using ObjectStruct = NativeCxxModuleExampleCxxBaseObjectStruct<
    int32_t,
    std::string,
    std::optional<std::string>>;

template <>
struct Bridging<ObjectStruct>
    : NativeCxxModuleExampleCxxBaseObjectStructBridging<
          int32_t,
          std::string,
          std::optional<std::string>> {};
```
or as
```
using ObjectStruct = NativeCxxModuleExampleCxxBaseObjectStruct<
    float,
    folly::StringPiece,
    std::optional<std::string>>;

template <>
struct Bridging<ObjectStruct>
    : NativeCxxModuleExampleCxxBaseObjectStructBridging<
          float,
          folly::StringPiece,
          std::optional<std::string>> {};
```
Or as
...

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D41133761

fbshipit-source-id: fdf36e51073cb46c5234f6121842c79a884899c7
2022-11-09 13:23:05 -08:00
Marco Fiorito 64ea7ce6c5 Chore: move translateFunctionTypeAnnotation into emitFunction (#35287)
Summary:
Part of https://github.com/facebook/react-native/issues/34872

In this PR was moved the translateFunctionTypeAnnotation invocation ([Flow](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/flow/modules/index.js#L362), [TypeScript](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/typescript/modules/index.js#L376)) into the emitFunction call so that the case FuntionTypeAnnotation results in a one-liner

## Changelog

[Internal] [Changed] - Move the translateFunctionTypeAnnotation invocation into the emitFunction

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

Test Plan: <img width="266" alt="image" src="https://user-images.githubusercontent.com/18408823/200852605-96c233d9-b524-4b7c-bc41-5543534c296b.png">

Reviewed By: christophpurrer

Differential Revision: D41157574

Pulled By: rshest

fbshipit-source-id: 21f6fe7dcffd30f4009ca91a6dec81bbd4b0902a
2022-11-09 12:18:31 -08:00
Sam Chan 1f0c2c2895 VirtualizedList onViewableItemsChanged won't trigger if first item in data evaluate to false #35280 (#35282)
Summary:
VirtualizedList onViewableItemsChanged won't trigger if first item in data evaluate to false https://github.com/facebook/react-native/issues/35280

Described in https://github.com/facebook/react-native/issues/35280

## Changelog

- [General] [Fixed] Fix VirtualizedList onViewableItemsChanged won't trigger if first item in data evaluate to false

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

Test Plan:
this snack will be able to log `onViewableItemsChanged triggered` after the fix:
https://snack.expo.dev/tmQo_R_3Y

Reviewed By: jacdebug

Differential Revision: D41158485

Pulled By: NickGerleman

fbshipit-source-id: 47434890155abe009c2560b658adc4e067c31027
2022-11-09 11:35:45 -08:00
Samuel Susla 1ad083a138 Postpone call to recordAndRetrieve to fix console.error
Summary: changelog: [internal]

Reviewed By: lunaleaps

Differential Revision: D41120272

fbshipit-source-id: 458a1b8915849ca7548026d9dbbd34e4b85ecfe5
2022-11-09 11:06:32 -08:00
Christoph Purrer d07575b1c6 react-native code-gen > Add a C++ only TurboModule example (for Android/iOS/macOS/Windows) (#35138)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35138

Changelog:

[General][Added] - Add a C++ only TurboModule example (for Android/iOS/macOS/Windows)

react-native@0.69 introduced a new bridging layer to ease integration for pure C++ TurboModules using C++ std:: types directly instead of the lower level jsi:: types:
https://github.com/facebook/react-native/tree/v0.69.0/ReactCommon/react/bridging

This bridging layer can be used in JSI functions or more conveniently in C++ TurboModules.

Here is a example of an C++ only TurboModule which will work on Android and iOS and macOS/Windows (using microsoft/react-native-macos|windows) only using flow/TypeScript and standard C++ types.

C++ only TurboModules are very handy as they do not require to work with JSI APIs - instead std:: or custom C++ can by used.

Reviewed By: javache

Differential Revision: D39011736

fbshipit-source-id: 84c833d8540671fde8505f1aeb0265074b248730
2022-11-09 10:48:49 -08:00
Tianyu Yao bbb3a6146c Fix inspecting on non-fabric
Summary:
Changelog:
[Category][Internal] - Fix inspecting on non-fabric

the pointer events don't work on non-fabric components. In addition to check the pointer events feature flag, we need to check if fabric is on as well.

Reviewed By: rbalicki2

Differential Revision: D41053393

fbshipit-source-id: ab47bd845b578a0859f282ea8ff04ddbff17da02
2022-11-09 10:14:11 -08:00
Pranav Yadav 5744b219c7 Extract `tryParse` (Flow, TypeScript) lambda into `parseObjectProperty` fn (#35076)
Summary:
This PR is a task of https://github.com/facebook/react-native/issues/34872

> Extract the content of the tryParse (Flow, TypeScript)lambda into a proper `parseObjectProperty` function into the parsers-commons.js file.
also,
- added new helper fn `isObjectProperty` in `parsers-commons.js` file.
- added tests for `isObjectProperty` and `parseObjectProperty` fn 's

## Changelog

[Internal] [Changed] - Extracted the content of the `tryParse` ([Flow](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/flow/modules/index.js#L292-L337), [TypeScript](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/typescript/modules/index.js#L306-L351)) lambda into a proper `parseObjectProperty` fn into the `parsers-commons.js` file.

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

Test Plan:
- run
```bash
yarn lint && yarn flow && yarn test-ci
```
- and ensure everything is �

<img width="720" alt="image" src="https://user-images.githubusercontent.com/55224033/200105151-360b9b5e-52c7-4586-89b0-6860e9725f6e.png">

Reviewed By: cortinico

Differential Revision: D40797241

Pulled By: cipolleschi

fbshipit-source-id: 48b8900ead70d5eda2496f9ce044c11a9599a177
2022-11-09 02:11:17 -08:00
Luna Wei 114098d419 Back out "feat: mapped layout props for view component"
Summary:
Changelog: [Internal]

Original commit changeset: 870b9b58a740

Original Phabricator Diff: D41108750 (cf3747957a)

Reviewed By: necolas, makovkastar

Differential Revision: D41145105

fbshipit-source-id: 8e525284d4d6d152fbcf053ec353d40dda3ee8d2
2022-11-08 20:37:27 -08:00
Oleksandr Melnykov 394486eec5 Bump OSS Android build to SDK 33 (#35196)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35196

Changelog:
[Android][Changed] - Bump Android compile and target SDK to 33

Reviewed By: cortinico

Differential Revision: D41007003

fbshipit-source-id: e7866107fdcfafa778faa6c7f31835b8dd15647a
2022-11-08 19:12:02 -08:00
Rujin Cao 669318d06f @emails -> @oncall (miscs)
Differential Revision: D41142965

fbshipit-source-id: d65b60d34edc8e8a884d448311e62ba68afb655f
2022-11-08 17:58:53 -08:00
Mayank Sunil Pagar cf3747957a feat: mapped layout props for view component (#34590)
Summary:
This PR adds mapping for layout props, it maps

    marginInlineStart: 'marginStart',
    marginInlineEnd: 'marginEnd',
    marginBlockStart: 'marginTop',
    marginBlockEnd: 'marginBottom',
    marginBlock: 'marginVertical',
    marginInline: 'marginHorizontal',
    paddingInlineStart: 'paddingStart',
    paddingInlineEnd: 'paddingEnd',
    paddingBlockStart: 'paddingTop',
    paddingBlockEnd: 'paddingBottom',
    paddingBlock: 'paddingVertical',
    paddingInline: 'paddingHorizontal',

 as requested on https://github.com/facebook/react-native/issues/34425

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[General][Added] - Added CSS logical properties by mapping layout props.

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

Test Plan:
```js
<View
  style={[
    {
      marginBlockStart: 5,        // maps to "marginTop"
      borderWidth: 1,
      borderRadius: 5,
      padding: 5,
    }
  ]}>
  <Text style={{fontSize: 11}}>Hello World!</Text>
</View>
```

Reviewed By: cipolleschi

Differential Revision: D41108750

Pulled By: necolas

fbshipit-source-id: 870b9b58a740aba12290a0604a9f6b52aa52de4c
2022-11-08 12:53:41 -08:00
fabriziobertoglio1987 082a033fbb Android: using AccessibilityNodeInfo#addAction to announce Expandable/Collapsible State (#34353)
Summary:
>Expandable and Collapsible are unique in the Android Accessibility API, in that they are not represented as properties on the View or AccessibilityNodeInfo, but are only represented as AccessibilityActions on the AccessibilityNodeInfo. This means that Talkback determines whether or not a node is "expandable" or "collapsible", or potentially even both, by looking at the list of AccessibilityActions attached to the AccessibilityNodeInfo.

>When setting the accessibilityState's expandable property, it should correlate to adding an action of either AccessibilityNodeInfoCompat.ACTION_EXPAND or AccessibilityNodeInfoCompat.ACTION_COLLAPSE on the AccessibilityNodeInfo. This work should be done in the ReactAccessibilityDelegate class's

>Currently, this feature is being "faked" by appending to the contentDescription in the BaseViewManager class. This should be removed when this feature is implemented properly.

fixes https://github.com/facebook/react-native/issues/30841

## Changelog

[Android] [Fixed] - using AccessibilityNodeInfo#addAction to announce Expandable/Collapsible State

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

Test Plan:
- On some components, the state expanded/collapsed is properly announced on focus, on some it is not.
- On some components only the expanded/collapsed state is announced, and not other component text.
- Upon change, state change is not always announced.
- The accessibilityState's "expanded" field does not seem to work on all element types (for example, it has no effect on 's).
- using accessibilityActions it is possible to add an action for expand/collapse, but these are treated as custom actions and must have their own label defined, rather than using Androids built in expand/collapse actions, which Talkback has predefined labels for.

https://snack.expo.io/0YOQfXFBi

Tests  15th August 2022:
- Paper [Tests](https://github.com/facebook/react-native/pull/34353#issuecomment-1217425302)
- Fabric [Tests](https://github.com/facebook/react-native/pull/34353#issuecomment-1217781734)

Tests 6th September 2022:
- [Button which keeps control of extended/collapsed state in JavaScript with onAccessibilityAction, accessibilityActions and accessibiltyState (Paper)](https://github.com/facebook/react-native/pull/34353#issuecomment-1237601847)
- [TouchableWithoutFeedback keeps control of extended/collapsed state in Android Widget (Paper)](https://github.com/facebook/react-native/pull/34353#issuecomment-1237616304)
- [TouchableWithoutFeedback keeps control of extended/collapsed state in Android Widget (Fabric)](https://github.com/facebook/react-native/pull/34353#issuecomment-1237624755)
- [TouchableOpacity announces visible text and triggers expanded/collapsed with onPress and accessiblity menu (Fabric)](https://github.com/facebook/react-native/pull/34353#issuecomment-1237627857)

Announcing state with custom actions on Fabric (FAIL).
The issue is not a regression from this PR, as documented in https://github.com/facebook/react-native/pull/34353#issuecomment-1207744977. It will be fixed in a separate PR.

Reviewed By: NickGerleman

Differential Revision: D39893863

Pulled By: blavalla

fbshipit-source-id: f6af78b1839ba7d97eca052bd258faae00cbd27b
2022-11-08 12:26:59 -08:00
Antoine Doubovetzky 8a847a30e1 Replace ternary in assertGenericTypeAnnotationHasExactlyOneTypeParameter with typeParameterInstantiation attribute in parser (#35157)
Summary:
Part of https://github.com/facebook/react-native/issues/34872:
> Create a new function typeParameterInstantiation in the [parsers.js file](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/parser.js) and add documentation to it. Implement it properly in the [FlowParser.js](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/flow/parser.js#L15) and in the [TypeScriptParser.js](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/typescript/parser.js#L15). Update the signature of [assertGenericTypeAnnotationHasExactlyOneTypeParameter](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/parsers-commons.js#L67) function to take the Parser instead of the language and use the new function in place of the [ternary operator ?:](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/parsers-commons.js#L83).

There are 3 things I'm not sure about:
1. The issue suggests to create a new function. For this case I believe an attribute is simpler. Is there a reason to prefer a function ?
2. To update the tests I had to create a mocked parser. I created a new file `parserMock` (I took example on [AnimatedMock](https://github.com/facebook/react-native/blob/main/Libraries/Animated/AnimatedMock.js)). Does it seem ok ?
3. I'm not sure what to add in the documentation of `typeParameterInstantiation`

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[Internal] [Changed] - Replace ternary in assertGenericTypeAnnotationHasExactlyOneTypeParameter with typeParameterInstantiation attribute in parser

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

Test Plan: I tested using Jest and Flow commands.

Reviewed By: rshest

Differential Revision: D40889856

Pulled By: cipolleschi

fbshipit-source-id: 8d9a8e087852f98dcc3fc0ecf1d4a7153f482ce7
2022-11-08 11:55:23 -08:00
generatedunixname89002005287564 22456038df supermodule:xplat/default/public.react_native.infra
Reviewed By: jkeljo

Differential Revision: D41113685

fbshipit-source-id: e8f21fcca95da58290f18a053563d648ad8e1893
2022-11-08 11:38:42 -08:00
Mike Vitousek 1bf610d06c Manual fixes to cycles for xplat
Summary:
Add annotations to xplat to break cycles

Changelog:
[internal]

Reviewed By: SamChou19815

Differential Revision: D41111962

fbshipit-source-id: f268871cbaae5bc51d6f576d9c0697e637dea5d1
2022-11-08 10:54:05 -08:00
Robert Balicki f4098a5acc Fix broken bishop build
Summary:
* When I build the latest bishop (using buck), I get a failure and a suggestion:

```
Rule //fbobjc/Apps/Bishop:BishopPackage (//fbobjc/Apps/Bishop:BishopPlatform) FAILED because Command failed with exit code 1.

command: [/bin/bash, -e, /data/sandcastle/boxes/fbsource/buck-out/tmp/genrule-15268472800256890202.sh]

stderr: The target:  fbsource//fbobjc/Apps/Bishop:BishopShareExtension is an App Extension, and must only use APIs available in App Extensions. However, it contains dependencies that do not set 'extension_api_only = True' in their BUCK files:
 - //xplat/js/react-native-github:RCTSettingsApple

This command may be able automatically to fix this issue:
  arc buildozer 'set extension_api_only True' //xplat/js/react-native-github:RCTSettingsApple

```
* This diff is the result of running that command

Reviewed By: christophpurrer

Differential Revision: D41121880

fbshipit-source-id: b1ecd077270d7f3909739364237af32dbc617f52
2022-11-08 10:45:00 -08:00
Lorenzo Sciandra cfa25e0a4a fix(release scripts): backport fixes from 0.71 into main (#35258)
Summary:
This PR backport two fixes we did in 0.71 to unblock the release process:
* the change in `publish-npm` is needed because of the introduction of .strict() from 4f3ca8facf
* the removal of the other script (added originally here e4b5d3eec9) is because:
  1) that step is not needed anymore (we don't publish/upload hermes artifacts to the GH release)
  2) by the time this job gets run the release crew has already setup the GH release
  3) the logic for the versioning was broken and even on the 0.71-rc pipeline it was tagging stuff as 1000.0.0

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[Internal] [Fixed] - Fix release scripts for "release" pipeline scenario

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

Test Plan: The fact that 0.71-rc0 was released is the  for this.

Reviewed By: jacdebug

Differential Revision: D41120888

Pulled By: cipolleschi

fbshipit-source-id: 06d108f0659ad1db53c6324fe1d735f52c34a3c5
2022-11-08 10:03:29 -08:00
Ruslan Shestopalyuk ea73a66936 Scaffolding for the PerformanceObserver TurboModule (C++ side) (#35226)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35226

Changelog: [Internal]

This adds scaffolding for the C++ side of NativePerformanceObserver module.

Thanks to christophpurrer for helping set this up, as this is the first one of this kind inside core/OSS.

Reviewed By: rubennorte

Differential Revision: D41028555

fbshipit-source-id: 4acf0e71a254a42044cbbe5f94f40938342c6aa2
2022-11-08 10:01:21 -08:00
Riccardo Cipolleschi ea1d72921d Back out "Oncall for BUCK project xplat/js/react-native-github/BUCK"
Summary:
Original commit changeset: 8f3e37917646

Original Phabricator Diff: D40460041 (dac6806559)

Reviewed By: GijsWeterings, arushikesarwani94

Differential Revision: D41119700

fbshipit-source-id: 5de6808a721efd0b9b765e52586155dd375c0fee
2022-11-08 08:02:09 -08:00
Riccardo Cipolleschi 25a00520d8 Refactor subclassing of RCTEventEmitter (#35106)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35106

This Diff remove the assert on the initializer in the EventEmitter in place of a more idiomatic check when the method is invoked.

It aims to solve an internal error and promotes best practices for the iOS platform.

## Changelog:
[iOS][Changed] Refactor RCTEventEmitter initialization

Reviewed By: sammy-SC

Differential Revision: D40762253

fbshipit-source-id: 83d26616ce147914948e536e9e4b1010758fb690
2022-11-08 07:06:07 -08:00
Riccardo Cipolleschi ddba780c0c fix: Change checkout cache strategy (#35259)
Summary:
This PR updates he cache strategy for the `checkout_with_cache command`.

The previous strategy was using three keys in descending priority order to restore from the cache:
* `<< parameters.checkout_base_cache_key >>-{{ arch }}-{{ .Branch }}-{{ .Revision }}`
* `<< parameters.checkout_base_cache_key >>-{{ arch }}-{{ .Branch }}`
*`<< parameters.checkout_base_cache_key >>-{{ arch }}`

When it saves, it always saves using the first key.

The restore works as it follows:
1. It tries to restore the cache using the first key
2. If it fails, it checks whether there is a cache hit for a key that matches the second key as a pattern
3. If it fails, it checks whether there is a cache hit for a key that matches the third pattern
4. Otherwise, it is a cache miss.

This does not work well. Imagine that you submit some code in commit `xxxx` for branch `abc`.
The CI run the first time, it misses all the three keys and checks out the code normally.
Then, it stores the checked out code in the `checkout_key-abc-xxxx` key.

Then, you submit a commit `yyyy` in the same branch.
The CI starts, it tries with the key `checkout_key-abc-yyyy` but it misses
It tries with the key `checkout_key-abc` and it finds the cache for `checkout_key-abc-xxxx` and it restores it, forgetting about your changes.

While doing the release, we created a tag in a commit X. Then we manually had to remove it, but the CI had a cached version of .git with the tag for
the `0.71-stable` branch. And the release failed because the tag was already existing.

### Why this should work

With this solution, we are going to cache using the commit. If there is no cache for a specific commit, it will be a miss. It won't try to be smart and
retrieve the code from previous caches.

This should prevent stale caches and if we manually remove a tag, and then we do a new commit, it should work.

This is a good trade-off that allows to pay the checkout cost only for the first batch of jobs of the pipeline.

**NOTE:** This still won't work if we don't do a new commit.

## Changelog

[General] [Fixed] - Change Cache strategy to avoid cache bumps in Release

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

Test Plan: 1. CircleCI must be green

Reviewed By: jacdebug

Differential Revision: D41120895

Pulled By: cipolleschi

fbshipit-source-id: 2b45da01803197dbe4a25a313a9dfc53a976d096
2022-11-08 06:50:25 -08:00
Christoph Purrer 9cb02613e6 Provide easy registration of C++ TurboModules in rn-tester Android (#35225)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35225

Changelog:
[Android] [Changed] - Provide easy registration of C++ TurboModules in rn-tester Android

Reviewed By: javache

Differential Revision: D41069277

fbshipit-source-id: 450de9302df2916acf324d4c316996b185b2833f
2022-11-08 05:12:19 -08:00
Stanley Shi dac6806559 Oncall for BUCK project xplat/js/react-native-github/BUCK (#35255)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/35255

Reviewed By: huntie, cipolleschi

Differential Revision: D40460041

fbshipit-source-id: 8f3e37917646e3571398faf04be317c149b7a0ec
2022-11-08 01:53:13 -08:00
fabriziobertoglio1987 55c0df43b9 Adding pager, scrollview, viewgroup, webview, drawer roles (#34477)
Summary:
- adds missing roles
- adds custom roles that don't exist in TalkBack (see the [compositor.json][10] and [string.xml][11] files).
- fixes [issues with Drawer][12]
- fixes issues with ScrollView missing roles
- seek control already exist as adjustable d460d097ac

Relevant https://github.com/facebook/react-native/issues/30839#issuecomment-1222293556
fixes https://github.com/facebook/react-native/issues/30839

## Changelog

[Android] [Fixed]  - Adding pager, scrollview, viewgroup, webview, drawer roles

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

Test Plan:
Android
- Drawer Layout and ScrollView (02/09/22) https://github.com/facebook/react-native/pull/34477#issuecomment-1235293165
- sliding drawer, drawer layout, icon menu https://github.com/facebook/react-native/pull/34477#issuecomment-1224112650
- Horizontal and Vertical ScrollView https://github.com/facebook/react-native/pull/34477#issuecomment-1225478289
- Toast https://github.com/facebook/react-native/pull/34477#issuecomment-1225369629
- CheckedTextView https://github.com/facebook/react-native/pull/34477#discussion_r959329833
- Spinner (dropdownlist) https://github.com/facebook/react-native/pull/34477#discussion_r959374894
- EditText https://github.com/facebook/react-native/pull/34477#discussion_r959412185
- WebView https://github.com/facebook/react-native/pull/34477#discussion_r959417518
- Testing chime_up and chime_down sound feedback in Scrollable https://github.com/facebook/react-native/pull/34477#issuecomment-1238882030

iOS https://github.com/facebook/react-native/pull/34477#issuecomment-1232418595

[10]: 771de7cdbf/compositor/src/main/res/raw/compositor.json (L1082-L1108)
[11]: 771de7cdbf/compositor/src/main/res/values/strings.xml (L223)
[12]: https://github.com/facebook/react-native/pull/34477#issuecomment-1224112650

Reviewed By: NickGerleman

Differential Revision: D39894307

Pulled By: blavalla

fbshipit-source-id: 4a8da78bae485ead0523689631d88d1031a07b74
2022-11-07 23:25:33 -08:00
Ramanpreet Nara 78aabd29ca Align Bridgeless mode's create/reload/destroy with bridge's
Summary: Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D40778326

fbshipit-source-id: b5dadfdc06f08ef0db0f97af2ec75e079bb77be6
2022-11-07 17:57:44 -08:00
Gabriel Donadel Dall'Agnol b6869be1ac feat: Update TextInput inputMode to map "none" to showSoftInputOnFocus (#35228)
Summary:
This PR updates `inputMode` prop from the `TextInput` component to map the `none` option to `showSoftInputOnFocus={false}`  as suggested by necolas here -> https://github.com/facebook/react-native/pull/34460#issuecomment-1304837271. This change makes the inputMode API behaves a bit more similarly across platforms.

Related to https://github.com/necolas/react-native-web/issues/2421

## Changelog

[General] [Changed] -  Update TextInput inputMode to map "none" to showSoftInputOnFocus

## Test Plan

1. Open the RNTester app and navigate to the TextInput page
2. Test the `TextInput` component through the `Input modes` section

https://user-images.githubusercontent.com/11707729/200218435-6a33b319-e989-4086-aac3-506546982b38.mov

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

Reviewed By: lunaleaps, necolas

Differential Revision: D41081876

Pulled By: jacdebug

fbshipit-source-id: cc634c3723647d8950bf2cfe67be70d0fbd488a6
2022-11-07 17:43:10 -08:00
Arushi Kesarwani 7a327d9673 Refactor accessory show methods for DevLoading
Summary:
Changelog:
    [Internal][Changed] - In order to make Dev Loading View cross platform, refactoring the accessary show methods.

Reviewed By: cortinico

Differential Revision: D41029102

fbshipit-source-id: 475949548fe98217e61d6cf64accbbdc0fb0f1c5
2022-11-07 11:31:55 -08:00
Christoph Purrer 3d9a15da87 Update ReactCommon.podspec | Debug section (#35236)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35236

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D41078409

fbshipit-source-id: fbd3daf61da29d0b595902e2541563343ba50de1
2022-11-07 10:30:10 -08:00
Christoph Purrer 19d65a2baf Update .podspec license information (#35245)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35245

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D41084913

fbshipit-source-id: a4ba31a19ffe515aa4e7c5a6e273a8cc4b6bc42d
2022-11-07 09:52:52 -08:00
Robert Balicki 6152763398 Buck, etc. changes that enable persisted, sync settings for DevTools (#35163)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35163

# What

This diff contains all the changes from D40333083 (0fac9817df) (aka https://github.com/facebook/react-native/pull/34964), **except** the change to `setUpReactDevTools.js`, which actually uses the new files.

# Why

* We want to ship the Buck, C++, etc. changes before the JavaScript changes that depend on those files.
* Otherwise, apps can fail at startup with the message:
```
`TurboModuleRegistry.getEnforcing(...): '${name}' could not be found. ` +
      'Verify that a module by this name is registered in the native binary.',
```
* Note that this only occurs if you are using a previously-built version of the C++, Obj C, etc. files in RN, but a more recent version of the JavaScript files. If you are building from matching sources, this does not occur.
* After a few days, we can land the JS files.

## Changelog

Changelog
[General][Added] Add, but don't use, DevTools Settings Manager.

Reviewed By: NickGerleman

Differential Revision: D40873390

fbshipit-source-id: c7bac6ae65f85666b8616443db278ebb175b691b
2022-11-07 07:40:21 -08:00
Christoph Purrer 7203187c80 TurboModules: Simplify React-bridging usage (#35212)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35212

A previous change - https://github.com/facebook/react-native/pull/34011 - already fixed basic usage of <react/bridging/.../ imports.
However that change was only tailored towards the usage of: <react/bridging/CallbackWrapper.h>
Any other header besides <react/bridging/CallbackWrapper.h> from <react/bridging/... can't be imported at this time in Xcode ... ... which is bad.

For C++ TurboModules we need to be able to access *any* <react/bridging/...> header via the React-Codegen CocoaPod.
Hence adding bridging now as a sub-spec to the ReactCommon CocoaPod

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D41057878

fbshipit-source-id: 83c117bc5252d84dd419cdb72f145f65547d23b2
2022-11-07 07:24:11 -08:00
Dmitry Rykun d62b0b463b Bump dependency versions to 0.72.0 after the branch cut
Summary:
Changelog
[General][Changed] - Bump dependency versions to 0.72.0 after the branch cut.

Reviewed By: cipolleschi

Differential Revision: D41079762

fbshipit-source-id: 83e912c4eaf969c1673ccc5fa854646efa99fa4a
2022-11-07 06:57:35 -08:00
Samuel Susla 78844458dc React Native sync for revisions ab075a2...4bd245e
Summary:
This sync includes the following changes:
- **[4bd245e9e](https://github.com/facebook/react/commit/4bd245e9e )**: Do not unmount layout effects if ancestor Offscreen is hidden ([#25628](https://github.com/facebook/react/pull/25628)) //<Samuel Susla>//
- **[df61e708c](https://github.com/facebook/react/commit/df61e708c )**: Remove check in renderDidSuspendDelayIfPossible ([#25630](https://github.com/facebook/react/pull/25630)) //<Andrew Clark>//
- **[1a08f1478](https://github.com/facebook/react/commit/1a08f1478 )**: [ServerRenderer] Move fizz external runtime implementation to react-dom-bindings ([#25617](https://github.com/facebook/react/pull/25617)) //<mofeiZ>//
- **[1a902623a](https://github.com/facebook/react/commit/1a902623a )**: Unwrap sync resolved thenables without suspending  ([#25615](https://github.com/facebook/react/pull/25615)) //<Andrew Clark>//
- **[4ea063b56](https://github.com/facebook/react/commit/4ea063b56 )**: refactor isHostResourceType to not receive the context from reconciler and not leak types ([#25610](https://github.com/facebook/react/pull/25610)) //<Josh Story>//
- **[8e69bc45a](https://github.com/facebook/react/commit/8e69bc45a )**: Make host context use null as empty and only error in dev ([#25609](https://github.com/facebook/react/pull/25609)) //<Sebastian Markbåge>//
- **[5f7ef8c4c](https://github.com/facebook/react/commit/5f7ef8c4c )**: [Float] handle resource Resource creation inside svg context ([#25599](https://github.com/facebook/react/pull/25599)) //<Josh Story>//
- **[36426e6cb](https://github.com/facebook/react/commit/36426e6cb )**: Allow uncached IO to stablize ([#25561](https://github.com/facebook/react/pull/25561)) //<Andrew Clark>//
- **[6883d7944](https://github.com/facebook/react/commit/6883d7944 )**: [ServerRenderer] Setup for adding data attributes streaming format ([#25567](https://github.com/facebook/react/pull/25567)) //<mofeiZ>//

Changelog:
[General][Changed] - React Native sync for revisions ab075a2...4bd245e

jest_e2e[run_all_tests]

Reviewed By: GijsWeterings

Differential Revision: D41028209

fbshipit-source-id: a67fdcd441ddd50784f7c1ce402eaecdb5e3126d
2022-11-07 06:52:28 -08:00
Thibault Malbranche 38e35df47c chore: fix typo in build.gradle (#35209)
Summary:
## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[Android] [Fixed] - fixed typo in template build.gradle

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

Reviewed By: cipolleschi

Differential Revision: D41080347

Pulled By: cortinico

fbshipit-source-id: d2e36f232f798a636f98843edbc5651730125fc4
2022-11-07 06:30:33 -08:00
Gabriel Donadel Dall'Agnol 62244d4a1e chore: Extract codegen translateFunctionTypeAnnotation into a common function (#35182)
Summary:
This PR extracts the codegen `translateFunctionTypeAnnotation` Flow and TypeScript functions into a single common function in the `parsers-primitives.js` file that can be used by both parsers as requested on https://github.com/facebook/react-native/issues/34872.

## Changelog

[Internal] [Changed] -  Extract codegen `translateFunctionTypeAnnotation` into a common function in the` parsers-primitives.js` file

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

Test Plan:
Run `yarn jest react-native-codegen` and ensure CI is green

![image](https://user-images.githubusercontent.com/11707729/199625849-e89b647f-63fb-40f8-b643-a59dedb4c59a.png)

Reviewed By: cortinico

Differential Revision: D41030544

Pulled By: rshest

fbshipit-source-id: bc93c21e31ed4e8c3293cafe3d808d9f36cf8ecc
2022-11-07 06:14:38 -08:00
Pieter De Baets 6db3995175 Improve @Nullable annotions in Java TurboModule codegen
Summary:
Noticed these types could be improved based on the tests added in D40979066 (e81c98c842).

Changelog: [Android][Fixed] Corrected Nullable annotations for parameters and return values in TurboModules codegen

Reviewed By: mdvacca, cipolleschi

Differential Revision: D40979940

fbshipit-source-id: cfc352a9e7eb9f59e2cce3d7da110a9a8d32db4b
2022-11-07 05:13:30 -08:00
Pieter De Baets 3e44d207a5 Shared Fabric color implementation across platforms
Summary: Changelog: [Internal] Align C++ implementations of SharedColor

Reviewed By: mdvacca

Differential Revision: D40632527

fbshipit-source-id: 8ebca5157e5898de4311015c92b5a72dca7197d3
2022-11-07 05:04:04 -08:00
Riccardo Cipolleschi 3823703a41 chore: update changelog with exceptional releases (#35238)
Summary:
This PR updates the Changelog with the recent patch releases.

## Changelog

[Internal] - Update the changelog

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

Test Plan: Not needed

Reviewed By: dmytrorykun

Differential Revision: D41079159

Pulled By: cipolleschi

fbshipit-source-id: 3be8f1dafb5d46a67b65ff8ec58dae98ebee9ad0
2022-11-07 04:42:36 -08:00
Christoph Purrer 35b2150adb react-native-codegen: Enable C++ TurboModule generation in OpenSource builds (#35211)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35211

This enables the generation of C++ TurboModule specs in addition to existing Java/ObjC ones.

An example is shown in https://github.com/facebook/react-native/pull/35138

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D41057630

fbshipit-source-id: 303881a63eb82f0fe8dfe10e533043a6eedb3d11
2022-11-07 04:22:35 -08:00
Christoph Purrer abe76fbb56 Remove tvOS support rememants (#35214)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35214

Changelog: [Internal]

Reviewed By: philIip

Differential Revision: D41058649

fbshipit-source-id: 16b1ec537d09e9ee50fe609417f62a146bc0f075
2022-11-07 03:07:05 -08:00
Dmitry Rykun c05e6c47df Remove hermesc build dir for non-Hermes build
Summary: Changelog: [iOS][Fixed] - Remove hermesc build dir for non-Hermes build.

Reviewed By: christophpurrer

Differential Revision: D41052884

fbshipit-source-id: c9e85ca06cef79fa35e81972181558d44ca93d90
2022-11-07 01:06:38 -08:00