Commit Graph

25807 Commits

Author SHA1 Message Date
Nicola Corti f5bbca50c5 RNGP - Setup tasks to cleanup the Apk/Aab from unused .so
Summary:
This is part of a series of tasks to make the React Native Gradle Plugin (RNGP) variant-aware.

Here I'm creating some tasks that will take care of doing the .so cleanup of the Apk/AppBundle.

Historically we used to use a error prone mechanism which was relying on assumptions on file paths and was breaking the variant-aware assumptions.

I'm going to use those tasks in a subsequent diff.

Changelog:
[Internal] [Changed] - RNGP - RNGP - Setup tasks to cleanup the Apk/Aab from unused .so

Reviewed By: cipolleschi

Differential Revision: D40512100

fbshipit-source-id: 649999dc8d126e7c939b61a5cec608d39cd7f688
2022-10-19 10:59:56 -07:00
Nicola Corti 31df147d64 RNGP - Make sure GenerateCodegenSchemaTask is not considering generated assets/res for execution avoidance
Summary:
This is part of a series of tasks to make the React Native Gradle Plugin (RNGP) variant-aware.

Here I'm extending the GenerateCodegenSchemaTask to make sure we exclude the generated build/ASSETS and build/RES folders from execution avoidance.

Changelog:
[Internal] [Changed] - RNGP - Make sure GenerateCodegenSchemaTask is not considering generated assets/res for execution avoidance

Reviewed By: cipolleschi

Differential Revision: D40512103

fbshipit-source-id: 193f4fd241a0fd973863beb6ff0dd1128dcee1d7
2022-10-19 10:59:56 -07:00
Jordan Brown 7884f6cfec Implicit instantiation codemod
Summary:
This diff adds explicit type arguments to polymorphic function calls that do not constrain their types. This codemod will reduce the error burden that will come in a future version of flow.

This specific diff was generated by running:
```
flow codemod annotate-implicit-instantiations --write .
flow --json --pretty | jq '.errors | .[] | .message | .[] | .loc |.source' | sort | uniq | sed -e 's/"//g' | xargs hg revert
hg st -n | xargs grep "generated" | sed -e 's/:.*//g' | xargs hg revert
arc f
```

So these are the codemod results that introduced no new errors and no generated files.

Changelog: [Internal]

drop-conflicts

Reviewed By: SamChou19815

Differential Revision: D40413074

fbshipit-source-id: 42b52719978f1098169662b503dbcfd8cefdad53
2022-10-19 10:25:09 -07:00
Nicola Corti b0f7b0c66b Publish both Hermes Debug and Release inside react-native-artifacts
Summary:
I'm extending `react-native-artifacts` to expose both
Hermes Debug and Release for iOS.

Changelog:
[Internal] [Changed] - Publish both Hermes Debug and Release inside `react-native-artifacts`

Reviewed By: mdvacca

Differential Revision: D40512210

fbshipit-source-id: 9676c95eaab45365c9c264585c491cd1bde04db5
2022-10-19 09:53:49 -07:00
Marco Fiorito f628edc502 Chore/extract codegen parser more than one module exception (#34920)
Summary:
This PR is part of https://github.com/facebook/react-native/issues/34872
This PR extracts MoreThanOneModuleInterfaceParserError exception to a separate function inside an error-utils.js file

## Changelog

[Internal] [Changed] - Extract MoreThanOneModuleInterfaceParserError to a seperate function inside error-utils.js

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

Test Plan: <img width="297" alt="image" src="https://user-images.githubusercontent.com/18408823/194859284-7d3ff330-c644-472e-9ae0-3b9444bc12e8.png">

Reviewed By: cortinico

Differential Revision: D40226575

Pulled By: cipolleschi

fbshipit-source-id: 01e581abfae1ffe40e92bed8c9bedd6fe09e1aab
2022-10-19 08:54:48 -07:00
Nicola Corti 27cb501481 Cleanup BUCK files from template - Part 2 (#35020)
Summary:
The `template/android/app/build_defs.bzl` file can be removed as it's unused in the Template.

## Changelog

[Internal] - Remove build_defs.bzl from Android Template

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

Test Plan: n/a

Reviewed By: cipolleschi

Differential Revision: D40506250

Pulled By: cortinico

fbshipit-source-id: 14d8522a995a4b19b5b6610fcb2c5b1dda3374c8
2022-10-19 06:41:59 -07:00
Nicola Corti a197a3face Fix typo in OsRule (#35024)
Summary:
I've just realized we have a typo in the `OsRule`. This is actually causing those tests to fail if run locally on M1 (but not on CI as it runs on a `amd64` architecture).

## Changelog

[Internal] - Fix typo in OsRule

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

Test Plan: Not much to test other than it's green locally, previously it was red. CI should be green regardless

Reviewed By: cipolleschi

Differential Revision: D40507320

Pulled By: cortinico

fbshipit-source-id: 75600014a515b2cb76debbd6e1d79ecd78ea5092
2022-10-19 06:25:33 -07:00
Nicola Corti 6c875ada06 Remove useJavaGenerator key from ReactAndroid/build.gradle file (#35021)
Summary:
This configuration was stale and has no effect on the Gradle Plugin, I'm removing it then 👍

## Changelog

[Internal] - Remove useJavaGenerator key from ReactAndroid/build.gradle file

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

Test Plan: n/a

Reviewed By: cipolleschi

Differential Revision: D40506375

Pulled By: cortinico

fbshipit-source-id: 2bcdc67686b1ac9fc77091d9324f5ad585df8818
2022-10-19 06:21:48 -07:00
Lorenzo Sciandra a24c8946e0 chore: bump CLI to 9.2.1 (#35022)
Summary:
A super small PR to bump CLI to latest available of the 9.x stream, to make available in main the asset image fix (https://github.com/react-native-community/cli/pull/1290) and to be able to cherry pick it back in 0.70 branch.

## 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] - bump CLI to 9.2.1

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

Test Plan: CI is green

Reviewed By: dmytrorykun

Differential Revision: D40507344

Pulled By: huntie

fbshipit-source-id: 7c3753e9df154eb5835f021cdfe1b476499afb9a
2022-10-19 05:17:31 -07:00
Gabriel Donadel Dall'Agnol 376ffac759 chore: Export codegen parseFile function (#35000)
Summary:
This PR export the content of the `parseFile` into a parseFile function accepting a callback to buildSchema properly in `parsers/utils.js` as requested on https://github.com/facebook/react-native/issues/34872.

## Changelog

[Internal] [Changed] - Export ` parseFile` in to a `parseFile` function in `parsers/utils.js`

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

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

![image](https://user-images.githubusercontent.com/11707729/196051689-1b61838c-477c-4be5-8df0-9f5969fcf90d.png)

Reviewed By: cortinico

Differential Revision: D40424857

Pulled By: cipolleschi

fbshipit-source-id: a700033d674b8be8e1af942dedf73155ea3ca025
2022-10-19 01:38:28 -07:00
MaeIg 8f484c3a62 Extract the switch(configType) block from the buildSchema function into a new function in the parsers/utils.js file (#34992)
Summary:
This PR aims to extract  the switch(configType) block from the buildSchema function into a separate function in a shared file between typescript and flow. It is a task of https://github.com/facebook/react-native/issues/34872:
> This task is more advanced than the others. Extract the switch(configType) block ([Flow](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/flow/index.js#L82-L119), [TypeScript](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/typescript/index.js#L92-L129)) from the buildSchema function into a new function in the parsers/utils.js file and use it in the two functions. Note that the new function must accept some callbacks to wrapModule/ComponentSchema and to buildModule/ComponentSchema.

## 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] - Extract the switch(configType) block from the buildSchema function into a new function in the parsers/utils.js file

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

Test Plan:
yarn flow:
<img width="548" alt="image" src="https://user-images.githubusercontent.com/40902940/195980663-a2d0e4bd-d2b8-464e-bbf5-3bcde553f7e8.png">

yarn lint:
<img width="521" alt="image" src="https://user-images.githubusercontent.com/40902940/195980675-a5c67d00-a822-46a8-8bd4-e1fe4f7fb698.png">

yarn jest react-native-codegen:
<img width="415" alt="image" src="https://user-images.githubusercontent.com/40902940/195980681-672e4447-4b33-43e8-a866-9e619ad332b1.png">

I added new tests:
<img width="621" alt="image" src="https://user-images.githubusercontent.com/40902940/195980703-8a68756a-45ad-4931-971f-f1e83ce16a96.png">

Reviewed By: cortinico

Differential Revision: D40429659

Pulled By: cipolleschi

fbshipit-source-id: 7e9875c129fee17c3cc5ef9c6f7990f39bfe2bf0
2022-10-19 01:38:28 -07:00
harshsiriah 32474367c2 Extracted UnsupportedFunctionReturnTypeAnnotationParserError to throwIfUnsupportedFunctionReturnTypeAnnotationParserError (#34965)
Summary:
This PR is part of https://github.com/facebook/react-native/issues/34872
This PR extracts `UnsupportedFunctionReturnTypeAnnotationParserError` exception to a separate function inside an `error-utils.js` file

## Changelog

[Internal] [Changed] - Extract `UnsupportedFunctionReturnTypeAnnotationParserError` to a seperate function inside `error-utils.js`

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

Test Plan:
```sh
yarn jest react-native-codegen
```
Added unit case in `error-utils-test.js` file

<img width="939" alt="Screenshot 2022-10-13 at 11 46 54 AM" src="https://user-images.githubusercontent.com/86605635/195517350-dcb7a26d-434c-4e45-a174-ce82931073e5.png">

Reviewed By: dmytrorykun

Differential Revision: D40338048

Pulled By: cipolleschi

fbshipit-source-id: baa41e0e96c9e17a35f316433c8d80c9bf88d334
2022-10-19 01:38:28 -07:00
Ken Tominaga eda90e5181 Extract the content of the case 'StringTypeAnnotation' into a single … (#34981)
Summary:
This PR extracts the content of the codegen case 'String' into a single `emitString` function inside the parsers-primitives.js file and uses it in both Flow and TypeScript parsers as requested on https://github.com/facebook/react-native/issues/34872. This also adds unit tests to the new `emitString` function.

ref: https://github.com/facebook/react-native/pull/34936

## 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] - Extract the content of the case 'StringTypeAnnotation' into a single emitString function

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

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

Reviewed By: cortinico

Differential Revision: D40376836

Pulled By: cipolleschi

fbshipit-source-id: feb1b07ec7fc2c333f5054f8cd8d18457d985257
2022-10-19 01:38:28 -07:00
Antoine Doubovetzky 790f40cfeb Improve assertGenericTypeAnnotationHasExactlyOneTypeParameter tests (#34942)
Summary:
https://github.com/facebook/react-native/pull/34933 has been merged just after I pushed a new commit to the branch to improve tests of `assertGenericTypeAnnotationHasExactlyOneTypeParameter` function, but the last commit was not imported to the internal repository.

The `assertGenericTypeAnnotationHasExactlyOneTypeParameter` can throw different types of Error, and I believe that `.toThrow(Error)` is not specific enough. So I replaced it with `toThrowErrorMatchingInlineSnapshot()`.

## 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] - Improve assertGenericTypeAnnotationHasExactlyOneTypeParameter tests in parsers-commons

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

Test Plan: Some test cases were ok because the assertGenericTypeAnnotationHasExactlyOneTypeParameter function threw an Error, but for the wrong reason. I've made sure that the error displayed in the inline snapshot is the one we expect.

Reviewed By: cortinico

Differential Revision: D40384993

Pulled By: cipolleschi

fbshipit-source-id: aaa943be1e808af2c5131f7d06baf24bc3bffa31
2022-10-19 01:38:28 -07:00
dhruvtailor7 aba6be694e Extract UnsupportedObjectPropertyValueTypeAnnotationParserError to a throwing function (#34917)
Summary:
This PR is a part of https://github.com/facebook/react-native/issues/34872.
Extracted the UnsupportedObjectPropertyValueTypeAnnotationParserError in its own throwing function and reuse that function passing a proper type.

## Changelog

[Internal] [Changed] - Extract the UnsupportedObjectPropertyValueTypeAnnotationParserError in its own throwing function and reuse that function passing a proper type.

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

Test Plan:
Output of yarn jest react-native-codegen.
<img width="451" alt="Screenshot 2022-10-10 at 12 55 39 PM" src="https://user-images.githubusercontent.com/32268377/194816863-5220dbaa-3b63-42bf-8e62-9d7b915f7cbd.png">

Reviewed By: cortinico

Differential Revision: D40424885

Pulled By: cipolleschi

fbshipit-source-id: 08d4d13ee3959391261fe13c190a4bb893970757
2022-10-19 01:38:28 -07:00
McCoy Zhu aeab38357f feat(ios): Share with anchor (#35008)
Summary:
[`Share`](https://reactnative.dev/docs/share) currently does not support the `anchor` option in iOS, so share sheets will always be displayed in the middle of the screen on iPads and on the top left corner of the window on Mac Catalyst.

This PR utilizes the `anchor` functionality already implemented in [`ActionSheetIOS`](https://reactnative.dev/docs/actionsheetios) to bring this support to `Share` on iOS.

## Changelog

[iOS] [Changed] - type definition for the `options` parameter of `Share.share` (added optional `anchor` property)

[iOS] [Added] - `anchor` option support for `Share`

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

Test Plan:
Tested with modified `rn-tester` that utilizes the `anchor` option on iPad simulator. Marked all 3 changes in code.

![Simulator Screen Shot - iPad Pro (11-inch) (3rd generation) - 2022-10-17 at 15 44 23](https://user-images.githubusercontent.com/31050761/196271991-469cac23-ef2b-4be5-aee2-b4197936007e.png)

```js
const SharedAction = () => {
  const [shared, setShared] = React.useState();
  const ref = React.useRef(); /* create ref (1/3) */

  const sharedAction = async () => {
    try {
      const result = await Share.share(
        {
          title: 'Create native apps',
          message:
            ('React Native combines the best parts of native development with React, a best-in-class JavaScript library for building user interfaces.': string),
          url: 'https://reactnative.dev/',
        },
        {
          subject: 'MUST READ: Create native apps with React Native',
          dialogTitle: 'Share React Native Home Page',
          tintColor: 'blue',
          anchor: ref.current?._nativeTag, /* add anchor in options (2/3) */
        },
      );
      if (result.action === Share.sharedAction) {
        setShared(result.action);
      } else if (result.action === Share.dismissedAction) {
        //iOS only, if dialog was dismissed
        setShared(null);
      }
    } catch (e) {
      console.error(e);
    }
  };
  return (
    <View style={styles.container}>
      <Text>action: {shared ? shared : 'null'}</Text>
      <Text style={styles.title}>Create native apps</Text>
      <Text>
        React Native combines the best parts of native development with React, a
        best-in-class JavaScript library for building user interfaces.
      </Text>
      {/* supply ref to Node (3/3) */}
      <Text ref={ref} style={styles.button} onPress={sharedAction}>
        SHARE
      </Text>
    </View>
  );
};
```

Reviewed By: cipolleschi

Differential Revision: D40459336

Pulled By: skinsshark

fbshipit-source-id: 72fbb3905ea0b982bb7f4b99967d121cd482181a
2022-10-18 18:56:19 -07:00
Sharon Zheng 42b3ab350f fix circleci:analyze_code errors
Summary:
circleci analyze_code errors: https://app.circleci.com/pipelines/github/facebook/react-native/16638/workflows/76804803-ceb5-4fb3-bd24-26bbb9826827/jobs/321696

- __Image.flow and Image.ios:__ requires needed to be sorted alphabetically
- __error-utils-test.js:__ duplicate describe block title is used, i believe this was a typo

Changelog:
[Internal][Fixed] - fix circleci:analyze_code errors

Reviewed By: lunaleaps

Differential Revision: D40491001

fbshipit-source-id: a1df6ded77374f92e297d0a8866a2c4096e1196a
2022-10-18 18:56:19 -07:00
Michael Anthony Leon 7208d15dce Support Symbols & BigInts in the debugger
Summary:
Add full functionality for `Symbol`s and `BigInt`s in the debugger. Note- using the [protocol monitor](https://umaar.com/dev-tips/166-protocol-monitor/) was the most reliable way of figuring out which fields exactly need to be set for these types to play nicely in DevTools. I brought up the monitor and then used the regular, standard chrome console with the functionality I wanted:

- Evaluating `Symbol` and `BigInt` literals, like `Symbol.for("a")` and `1n`
- Right-click save the resulting expressions

From there, I inspected the CDP messages being sent. Then I was able to fill in the correct fields from there, and be confident that those were correct, given that I was copying the exact behavior of Chrome itself.

Changelog:
[General][Fixed] Support properly sending BigInts and Symbols over the Chrome DevTools Protocol.

Reviewed By: neildhar, jpporto

Differential Revision: D40442228

fbshipit-source-id: 98a514edbeb35fcbd427a25475f435e22956f2db
2022-10-18 17:18:16 -07:00
Paige Sun afb124dcf0 3/n Easy: Add MC to gate parsing unhandled JS errors in C++
Summary:
Changelog:
[Internal][ErrorHandling] 3/n Add a gate for parsing unhandled JS errors in C++

Gate this just in case it causes issues. Enabling this is definitely a better behavior than before, because we want the JS stack when there is a JS error, not the native stack.

Reviewed By: sammy-SC

Differential Revision: D40397393

fbshipit-source-id: 586b4d7bcf710edb048b5c643646ba2f3c4c302a
2022-10-18 15:09:23 -07:00
Sharon Zheng b51a350c1e check for null background in TextInput setUnderlineColor
Summary:
checking for background == null to fix this error:

```java.lang.NullPointerException: Attempt to invoke virtual method 'android.graphics.drawable.Drawable$ConstantState android.graphics.drawable.Drawable.getConstantState()' on a null object reference
	at com.facebook.react.views.textinput.ReactTextInputManager.setUnderlineColor(:4)
```

Changelog:
[Internal][Fixed] - check for null background in Android TextInput setUnderlineColor

Reviewed By: beatthat

Differential Revision: D40451369

fbshipit-source-id: 8618d5ff73f517f714c26a0b17af078493822244
2022-10-18 14:38:11 -07:00
Héctor Ramos d2fde62f8f Circle CI: Build Release and Debug tarballs for every commit (#35013)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35013

Previously, release builds were only built for stable RN releases. This creates a discrepancy between CI jobs that run on commits versus CI jobs that run on releases. We are working on reducing these differences in order to limit the number of issues we may face when cutting a React Native release.

Now, build_hermes_macos will be run as a matrix of Debug/Release builds in every workflow.

Updated build_hermes_macos to take 'flavor' as a Enum, not a string.

Store hermesc in separate directories as Circle CI does not allow two different jobs (e.g. build_hermes_macosDebug and build_hermes_macosRelease) to write to the same path when storing artifacts.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D40308952

fbshipit-source-id: b96b9a6c7cf8d0becafcf2fdcb761540816ae336
2022-10-18 14:25:38 -07:00
David Vacca fd4e26938b Delete dispatchPreallocationInBackground flag
Summary:
Delete dispatchPreallocationInBackground flag
changelog: [internal] internal

Reviewed By: makovkastar

Differential Revision: D40403682

fbshipit-source-id: 73904ab7c8a570b0aba51f1bccd15cf07609f2d6
2022-10-18 13:32:03 -07:00
David Vacca 8eebc931bc Ship insertZReorderBarriersOnViewGroupChildren
Summary:
Ship insertZReorderBarriersOnViewGroupChildren

changelog: [internal] internal

Reviewed By: makovkastar

Differential Revision: D40403388

fbshipit-source-id: bf13f6a7af92c0c4fd3377a547a56b163dfe29ed
2022-10-18 13:32:03 -07:00
David Vacca 9578c2cadf Ship large meassure cache in all platforms
Summary:
Ship large meassure cache in all platforms

changelog: [internal] internal

Reviewed By: sammy-SC

Differential Revision: D40356835

fbshipit-source-id: 315862d7aa705e83086e102e20fe2c20fb3210b2
2022-10-18 13:32:03 -07:00
David Vacca 4f7b4d8cbb Ship enableAggressiveEventEmitterCleanup
Summary:
This diff ships the experiment enableAggressiveEventEmitterCleanup

changelog: [internal] internal

Reviewed By: sammy-SC

Differential Revision: D40356592

fbshipit-source-id: 27da82a0b958cedc1283a54de175a6eb6b14004b
2022-10-18 13:32:03 -07:00
David Vacca fceb1425dd Remove enableEarlyEventEmitterUpdate experiment
Summary:
Remove enableEarlyEventEmitterUpdate experiment

changelog: [inernal] internal

Reviewed By: sammy-SC

Differential Revision: D40356386

fbshipit-source-id: a5135f97f65c93e7de967a91e34d8b0baa411b84
2022-10-18 13:32:03 -07:00
David Vacca ea6c7f504b Delete LockFreeEventDispatcher
Summary:
This diff removes LockFreeEventDispatcher, its dependencies and feature flags

changelog: [internal] internal

Reviewed By: javache, sammy-SC

Differential Revision: D40356071

fbshipit-source-id: 42212e86fe4ace0da87fd8e7ab8ee50100175432
2022-10-18 13:32:03 -07:00
David Vacca a766927ad6 Delete MC and FeatureFlags for mapBufferSerialization
Summary:
Delete MC and FeatureFlags for mapBufferSerialization

changelog: [internal] internal

Reviewed By: sammy-SC

Differential Revision: D40348980

fbshipit-source-id: 5de8beafb4ec4a3490a22f4db317a35c8ce7b4ab
2022-10-18 13:32:03 -07:00
David Vacca 22b6e1c8ec Ship and delete mapBufferSerialization for Text measurement
Summary:
In this diff I'm shipping and deleting mapBufferSerialization for Text measurement

changelog: [internal] internal

Reviewed By: NickGerleman

Differential Revision: D40348982

fbshipit-source-id: 7336cbe055a55d7d8d4f0a723049842bae1defb5
2022-10-18 13:32:03 -07:00
David Vacca e87cdc7fd4 Move initialization of MapBuffer so
Summary:
This diff refactors the initialization of MapBuffer so

changelog: [internal] internal

Reviewed By: NickGerleman

Differential Revision: D40348981

fbshipit-source-id: 88bbf4f2370373c20f805c3b23d0ecbe8a26bb86
2022-10-18 13:32:03 -07:00
Sam Zhou 82e86c459d Annotate empty arrays in xplat (2/n)
Summary: Changelog: [Internal]

Reviewed By: pieterv

Differential Revision: D40460690

fbshipit-source-id: 1e10b0bcf874dc9a3702b4d17d30d448653602ca
2022-10-18 12:49:22 -07:00
Jan Kassens 5e6a4c5b4c React Native sync for revisions 9fb581c...54f297a
Summary:
This sync includes the following changes:
- **[54f297a60](https://github.com/facebook/react/commit/54f297a60 )**: Enable useMemoCacheHook for ReactNative-fb build ([#25498](https://github.com/facebook/react/pull/25498)) //<Jan Kassens>//

Changelog:
[General][Changed] - React Native sync for revisions 9fb581c...54f297a

jest_e2e[run_all_tests]

Reviewed By: poteto

Differential Revision: D40435957

fbshipit-source-id: f447f50d80298e2c3e8be09ff52b1bedcfe6d402
2022-10-18 11:30:31 -07:00
Tianyu Yao 48263b8daf Upgrade React DevTools deps to 4.26.1
Summary:
Changelog:
[General][Changed] - Upgraded react-devtools-core dependency to 4.26.1

Reviewed By: lunaruan

Differential Revision: D40394563

fbshipit-source-id: 70a841c7478d8944dc8a57dd7711953d6bd7958a
2022-10-18 10:43:18 -07:00
Tianyu Yao c64f25ac85 Avoid redboxes when highlighting
Summary:
Changelog:
[General][Fixed] - Fixed React DevTools element highlighting throwing redbox errors

Reviewed By: lunaruan

Differential Revision: D40367546

fbshipit-source-id: 094c4a512700f717efe06b7bfa304d94b6eed652
2022-10-18 10:35:11 -07:00
Lorenzo Sciandra 33e140fd05 fix(template, ios): add marketing version to template project (#35012)
Summary:
Recently this PR got merged https://github.com/facebook/react-native/pull/34919 that aligned the info.plist to the current default. Problem: the variable `MARKETING_VERSION` was not set in the template, so generating a new project and testing on iOS would fail accordingly:

<img width="1400" alt="Screenshot 2022-10-18 at 15 27 27" src="https://user-images.githubusercontent.com/16104054/196461640-470079f5-0f64-471f-8221-0d17f2b0114f.png">

This PR takes care of setting the variable so that the app can build successfully.

## 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
-->

[iOS] [Fixed] - add MARKETING_VERSION to template project

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

Test Plan: Run `yarn test-e2e-local -t RNTestProject`, apps builds correctly and runs on simulator.

Reviewed By: cipolleschi

Differential Revision: D40472420

Pulled By: cortinico

fbshipit-source-id: 18ddd57ce54186a101321583a7a8391e97ca9511
2022-10-18 10:32:59 -07:00
Riccardo Cipolleschi 62da9b8ce2 Backout Generate Custom Native State from Codegen
Summary:
This is the second diffs that backs out the Custom Native State from the Codegen. The reason why we are backing it out are:

1. It forces users to create new types in JS that are not ctually used there. For example, the NativeState you define, and eventually exports, in JS is not used anywhere in your JS code.
2. You need to put in the JS native state some types that does not exists in JS, only to have them generated by the Codegen. ImageRequest, for example, does not exists in JS, but you need it in your (iOS) state to load images
3. There are a lot of edge cases due to how C++ handles variables. Some variables needs to be created as pointers. Some others as `const &`. It does not scale to hard code all of them and there is the risk to have the same type that needs to be a pointer in some case and something else in others.
4. It is better to instruct the users on how to properly create a component with Custom State, Shadow Node and Descriptor.

## Changelog:
[General][Removed] - Back out parsing and generation of Custom Native State from Codegen

Reviewed By: cortinico

Differential Revision: D40426134

fbshipit-source-id: c368e122cc31ee8df056fe1bf6cecaab482140a4
2022-10-18 10:30:06 -07:00
Riccardo Cipolleschi aace6626c1 Backout: Components with custom state
Summary:
This is the first diffs that backs out the Custom Native State from the Codegen. The reason why we are backing it out are:

1. It forces users to create new types in JS that are not ctually used there. For example, the NativeState you define, and eventually exports, in JS is not used anywhere in your JS code.
2. You need to put in the JS native state some types that does not exists in JS, only to have them generated by the Codegen. ImageRequest, for example, does not exists in JS, but you need it in your (iOS) state to load images
3. There are a lot of edge cases due to how C++ handles variables. Some variables needs to be created as pointers. Some others as `const &`. It does not scale to hard code all of them and there is the risk to have the same type that needs to be a pointer in some case and something else in others.
4. It is better to instruct the users on how to properly create a component with Custom State, Shadow Node and Descriptor.

## Changelog
[General][Removed] - Back out components with native state in RNTester

Reviewed By: cortinico

Differential Revision: D40419254

fbshipit-source-id: 1895c7050f01f76a8901a97e9700f74cae707b79
2022-10-18 10:30:06 -07:00
Samuel Susla f6cfcc3fc9 Re-add TypeScript definitions for React Native renderer
Summary:
changelog: [internal]

Fix CircleCI

Reviewed By: jacdebug

Differential Revision: D40466738

fbshipit-source-id: 0057a98f07cdd07227c3ac8e09eb8b0d51974685
2022-10-18 05:21:09 -07:00
Lorenzo Sciandra 8f337538ae feat(jest): bump jest to 29 in the template (#34972)
Summary:
This PR is the follow up of https://github.com/facebook/react-native/pull/34724 for the template; this way, we'll have version alignment and RN71 will use this.

This wants to be merged along https://github.com/facebook/react-native/pull/34971

## 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] - upgrade Jest in template to 29

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

Test Plan: Generated a test project via `yarn test-e2e-local -t RNTestProject` and then run `yarn test` in that project to verify that there's no regression. 

Reviewed By: huntie

Differential Revision: D40379963

Pulled By: robhogan

fbshipit-source-id: 618207ed6bf7921d13f0b6a9220dc52c9cf78b14
2022-10-18 04:43:38 -07:00
Fabrizio Cucci e22217fe8b Add useAnimatedValue to public API
Summary:
Changelog:
[General][Added] - Introduce `useAnimatedValue` hook to make it easier working with `Animated.Value`s in function components.

Reviewed By: javache

Differential Revision: D40434219

fbshipit-source-id: 3caf6ad98d11a534b8cc6816820bc1d125150380
2022-10-18 04:22:58 -07:00
Nick Gerleman b5aec96340 Start Adding GitHub Actions (#1165)
Summary:
This change starts adding more coverage to GitHub Actions. Existing workflows are split up to be per-platform, and stale scripts, etc are removed.

We are currently limited a bit by issues with the build itself, but this still adds a good bit of coverage that readily works, and adds places to inject more.

Another option would have been to move these to CircleCI where we have more credits, or used docker images instead of manual setup steps. etc, The Yoga build and number of changes is very light though, so we don't really need the complexity yet.

Some TODOs:
1. Fix the Apple Builds (pod lint and pod install return errors seen by the community)
2. Add working Android UTs
3. Add C++ UTs
4. Add Apple Publish
5. Add version stamping

Changelog:
[Internal][Added] - Start Adding Yoga GitHub Actions

X-link: https://github.com/facebook/yoga/pull/1165

Reviewed By: cortinico

Differential Revision: D40386426

Pulled By: NickGerleman

fbshipit-source-id: c540dd25bfec6ac8c05e461c1236ef7fe6cb8598
2022-10-17 23:35:01 -07:00
Arthur Kushka 31f219977d Disabled cpp view managers in runtime
Summary:
We found this feature crashing the app during hot reload, and as there is no user code dependent on it so far, we decided to disable it until we find the root cause.

changelog: [internal] internal

Reviewed By: mdvacca

Differential Revision: D40445312

fbshipit-source-id: fe28b58c5dca6c91389ad38675ca37669a4965a0
2022-10-17 16:17:17 -07:00
Vincent Riemer 55fca7fd38 Add PointerOver/PointerOut handling test
Summary:
Changelog: [RNTester][Internal] - Add PointerOver/PointerOut handling test

This diff adds another platform test based on WPT testcase for mouseover/mouseout events but instead applied to pointerover/pointerout events recently implemented for RN.

Reviewed By: lunaleaps

Differential Revision: D40359286

fbshipit-source-id: 672f413f56faca55b9d838150fb66de66d78d6f2
2022-10-17 15:34:16 -07:00
bang9 048194849b feat(iOS): added lineBreakStrategy attribute to Text/TextInput (#31272)
Summary:
iOS did not support the implementation of Korean word-wrap(line-break) before iOS14.
If the attribute applied, the word-wrap of Korean will works.

## Changelog

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

[iOS] [Added] -  Line break strategy for Text and TextInput components

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

Test Plan:
1. Test build and run on above iOS 14.
2. Test it does not affect existing text components when set default(none) strategy.
3. Test whether word-wrap works with Korean when set hangul-word strategy.

<img src="https://user-images.githubusercontent.com/26326015/112963967-d7f70c00-9182-11eb-9a34-8c758b80c219.png" width="300" height="" style="max-width:100%;">

Reviewed By: javache

Differential Revision: D39824809

Pulled By: lunaleaps

fbshipit-source-id: 42cb0385221a38c84e80d3494d1bfc1934ecf32b
2022-10-17 13:14:17 -07:00
Sam Zhou a0ee6fae5e Annotate empty arrays in xplat
Summary: Changelog: [Internal]

Differential Revision: D40410427

fbshipit-source-id: f819fcb00673e19b21aecb383541850436805a0e
2022-10-17 12:40:57 -07:00
Lorenzo Sciandra cb2dcd327c feat(jest): move Jest config to use a custom react-native Jest env (#34971)
Summary:
This PR is the follow up to the conversation started here by SimenB: https://github.com/react-native-community/discussions-and-proposals/issues/509

Basically, we want to move RN to use its own custom environment so that we can tweak it going forward - this PR in fact only sets up the groundwork for that; robhogan mentioned that with this in place, Meta engineers can
> iterate on it (with jest-environment-node as a starting point) against our internal product tests

This is also connected to Rob's work to bring Jest 29 into the codebase https://github.com/facebook/react-native/pull/34724 and my "mirror" PR to bring template in main up to the same version (https://github.com/facebook/react-native/pull/34972)

## 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] - move Jest config to use a custom react-native Jest env

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

Test Plan: Tested that `yarn test` in main works fine after the changes; CI and Meta's internal CI will also serve the purpose of verifying that it works (but there's no reason not to since it's still pretty much just relying on `node`).

Reviewed By: huntie

Differential Revision: D40379760

Pulled By: robhogan

fbshipit-source-id: 2c6d0bc86d337fda9befce0799bda2f56cc4466c
2022-10-17 12:40:25 -07:00
youedd 633498fe9a refactor module's platform verification (#34961)
Summary:
Part of https://github.com/facebook/react-native/issues/34872

> [Assigned to youedd] Extract the nameToValidate logic ([Flow](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/flow/modules/index.js#L704-L713), [TypeScript](https://github.com/facebook/react-native/blob/f353119113d6fc85491765ba1e90ac83cb00fd61/packages/react-native-codegen/src/parsers/typescript/modules/index.js#L738-L747)) into a shared function into the parser/utils.js file. Notice that you may need a callback to update the cxx boolean.

## 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
-->

[Changed] [Internal] - refactor parser module platform verification

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

Test Plan:
`yarn jest react-native-codegen`

![image](https://user-images.githubusercontent.com/19575877/195425654-46f9e560-efd3-4945-b913-c6d9f6bb7ec2.png)

Reviewed By: cipolleschi

Differential Revision: D40319245

Pulled By: skinsshark

fbshipit-source-id: bc36cdcfa06047e1acee0d638f5756b6462d76d1
2022-10-17 11:08:06 -07:00
Samuel Susla a63a4fa7d2 React Native sync for revisions 0cac4d5...fd31724
Summary:
- **[9fb581c7c](https://github.com/facebook/react/commit/9fb581c7c )**: Refactor: merge duplicate imports ([#25489](https://github.com/facebook/react/pull/25489)) //<c0dedance>//
- **[bc358362a](https://github.com/facebook/react/commit/bc358362a )**: [Flight] Improve Error Messages when Invalid Object is Passed to Client/Host Components ([#25492](https://github.com/facebook/react/pull/25492)) //<Sebastian Markbåge>//
- **[780eacd40](https://github.com/facebook/react/commit/780eacd40 )**: Flow upgrade to 0.190 ([#25483](https://github.com/facebook/react/pull/25483)) //<Jan Kassens>//
- **[54f0e0f73](https://github.com/facebook/react/commit/54f0e0f73 )**: Scaffolding for react-dom/unstable_external-server-runtime ([#25482](https://github.com/facebook/react/pull/25482)) //<Andrew Clark>//
- **[0eaca3756](https://github.com/facebook/react/commit/0eaca3756 )**: Add script to generate inline Fizz runtime ([#25481](https://github.com/facebook/react/pull/25481)) //<Andrew Clark>//
- **[69c7246d9](https://github.com/facebook/react/commit/69c7246d9 )**: Initialize useMemoCache with sentinel values ([#25465](https://github.com/facebook/react/pull/25465)) //<Joseph Savona>//
- **[3b814327e](https://github.com/facebook/react/commit/3b814327e )**: Allow Async Functions to be used in Server Components ([#25479](https://github.com/facebook/react/pull/25479)) //<Sebastian Markbåge>//
- **[a6bf46689](https://github.com/facebook/react/commit/a6bf46689 )**: Extract Fizz instruction set to build macro ([#25457](https://github.com/facebook/react/pull/25457)) //<Andrew Clark>//
- **[ea5bc6bac](https://github.com/facebook/react/commit/ea5bc6bac )**: [React Native FB] dynamic feature flag for ref access warning ([#25471](https://github.com/facebook/react/pull/25471)) //<Jan Kassens>//
- **[08d035bc8](https://github.com/facebook/react/commit/08d035bc8 )**: Remove Shallow Renderer Tests ([#25475](https://github.com/facebook/react/pull/25475)) //<Sebastian Markbåge>//
- **[a8c16a004](https://github.com/facebook/react/commit/a8c16a004 )**: Split Cache into its own Dispatcher ([#25474](https://github.com/facebook/react/pull/25474)) //<Sebastian Markbåge>//
- **[2cf4352e1](https://github.com/facebook/react/commit/2cf4352e1 )**: Implement HostSingleton Fiber type ([#25426](https://github.com/facebook/react/pull/25426)) //<Josh Story>//
- **[aa9988e5e](https://github.com/facebook/react/commit/aa9988e5e )**: Server render fork for react-dom ([#25436](https://github.com/facebook/react/pull/25436)) //<Josh Story>//
- **[513417d69](https://github.com/facebook/react/commit/513417d69 )**: Return lastNonHostInstance in getInspectorDataForInstance for devtools ([#25441](https://github.com/facebook/react/pull/25441)) //<Tianyu Yao>//
- **[5d60a0b84](https://github.com/facebook/react/commit/5d60a0b84 )**: Bugfix: LegacyHidden shouldn't defer effects ([#25442](https://github.com/facebook/react/pull/25442)) //<Andrew Clark>//
- **[618388bc3](https://github.com/facebook/react/commit/618388bc3 )**: [Float] Support script preloads ([#25432](https://github.com/facebook/react/pull/25432)) //<Josh Story>//
- **[2872a26e1](https://github.com/facebook/react/commit/2872a26e1 )**: track resources in different roots separately ([#25388](https://github.com/facebook/react/pull/25388)) //<Josh Story>//
- **[ea04a486a](https://github.com/facebook/react/commit/ea04a486a )**: Flow: remove unused suppressions ([#25424](https://github.com/facebook/react/pull/25424)) //<Jan Kassens>//
- **[9813edef2](https://github.com/facebook/react/commit/9813edef2 )**: Flow upgrade to 0.188 //<Jan Kassens>//
- **[3b6826ed9](https://github.com/facebook/react/commit/3b6826ed9 )**: Flow: inference_mode=constrain_writes //<Jan Kassens>//
- **[aed33a49c](https://github.com/facebook/react/commit/aed33a49c )**: Flow upgrade to 0.185 //<Jan Kassens>//
- **[f02a5f5c7](https://github.com/facebook/react/commit/f02a5f5c7 )**: Flow upgrade to 0.182 //<Jan Kassens>//
- **[72593f008](https://github.com/facebook/react/commit/72593f008 )**: Flow upgrade to 0.176 //<Jan Kassens>//
- **[46d40f306](https://github.com/facebook/react/commit/46d40f306 )**: Flow upgrade to 0.175 //<Jan Kassens>//
- **[1089faf0d](https://github.com/facebook/react/commit/1089faf0d )**: Flow: run codemod to remove existential type //<Jan Kassens>//
- **[3fd9bd8e7](https://github.com/facebook/react/commit/3fd9bd8e7 )**: Add RulesOfHooks support for `use` //<Lauren Tan>//
- **[338e6a967](https://github.com/facebook/react/commit/338e6a967 )**: Flow upgrade to 0.155 //<Jan Kassens>//
- **[8bc95bb3c](https://github.com/facebook/react/commit/8bc95bb3c )**: Flow upgrade to 0.154 //<Jan Kassens>//
- **[9f8a98a39](https://github.com/facebook/react/commit/9f8a98a39 )**: Flow upgrade to 0.153 //<Jan Kassens>//
- **[64fe791be](https://github.com/facebook/react/commit/64fe791be )**: Flow upgrade to 0.146 //<Jan Kassens>//
- **[d3c6c16a0](https://github.com/facebook/react/commit/d3c6c16a0 )**: Flow upgrade to 0.145 //<Jan Kassens>//
- **[00a2f8150](https://github.com/facebook/react/commit/00a2f8150 )**: Flow upgrade to 0.143 //<Jan Kassens>//
- **[0a3072278](https://github.com/facebook/react/commit/0a3072278 )**: Flow: complete types first migration ([#25389](https://github.com/facebook/react/pull/25389)) //<Jan Kassens>//
- **[bcc05671f](https://github.com/facebook/react/commit/bcc05671f )**: Flow: types first in shared ([#25343](https://github.com/facebook/react/pull/25343)) //<Jan Kassens>//
- **[b1f34aa30](https://github.com/facebook/react/commit/b1f34aa30 )**: Flow: types first in react-native-renderer ([#25363](https://github.com/facebook/react/pull/25363)) //<Jan Kassens>//
- **[9143864ae](https://github.com/facebook/react/commit/9143864ae )**: Flow: well formed exports for smaller packages ([#25361](https://github.com/facebook/react/pull/25361)) //<Jan Kassens>//
- **[21a851e03](https://github.com/facebook/react/commit/21a851e03 )**: Fix devtools typos and grammar ([#24587](https://github.com/facebook/react/pull/24587)) //<Alexandru Tasica>//
- **[cfafeb685](https://github.com/facebook/react/commit/cfafeb685 )**: Remove extra space in Wedge.js ([#24611](https://github.com/facebook/react/pull/24611)) //<Kerim Büyükakyüz>//
- **[9c3de25e1](https://github.com/facebook/react/commit/9c3de25e1 )**: Flow: types first in reconciler ([#25362](https://github.com/facebook/react/pull/25362)) //<Jan Kassens>//
- **[7b25b961d](https://github.com/facebook/react/commit/7b25b961d )**: [Fizz/Float] Float for stylesheet resources ([#25243](https://github.com/facebook/react/pull/25243)) //<Josh Story>//
- **[4c016e7aa](https://github.com/facebook/react/commit/4c016e7aa )**: Refactor: use  property shorthand ([#25366](https://github.com/facebook/react/pull/25366)) //<zhangrenyang>//
- **[06066c1a5](https://github.com/facebook/react/commit/06066c1a5 )**: Make RulesOfHooks-test more consistent with ExhaustiveDeps-test //<Lauren Tan>//
- **[49ae0fad8](https://github.com/facebook/react/commit/49ae0fad8 )**: Fix RulesOfHooks test case indentation //<Lauren Tan>//
- **[abbbdf4ce](https://github.com/facebook/react/commit/abbbdf4ce )**: Put modern StrictMode behind a feature flag ([#25365](https://github.com/facebook/react/pull/25365)) //<Samuel Susla>//
- **[434110390](https://github.com/facebook/react/commit/434110390 )**: ReactHooks.js - delete emptyObject ([#25031](https://github.com/facebook/react/pull/25031)) //<Igor Berlenko>//
- **[31400ce29](https://github.com/facebook/react/commit/31400ce29 )**: Refactor: merge duplicate imports ([#25364](https://github.com/facebook/react/pull/25364)) //<jerry-lllman>//
- **[3517bd9f7](https://github.com/facebook/react/commit/3517bd9f7 )**: Refactor useEvent ([#25336](https://github.com/facebook/react/pull/25336)) //<Lauren Tan>//
- **[6cf06a929](https://github.com/facebook/react/commit/6cf06a929 )**: Remove outdated comments. ([#24464](https://github.com/facebook/react/pull/24464)) //<zhangenming>//
- **[20a257c25](https://github.com/facebook/react/commit/20a257c25 )**: Refactor: more word doubles removed ([#25352](https://github.com/facebook/react/pull/25352)) //<Vic Graf>//
- **[8cadcffd5](https://github.com/facebook/react/commit/8cadcffd5 )**: Fix typo: reconcilation -> reconciliation ([#25355](https://github.com/facebook/react/pull/25355)) //<zhangrenyang>//
- **[ebbe599a2](https://github.com/facebook/react/commit/ebbe599a2 )**: Fix EventListener fork ([#25347](https://github.com/facebook/react/pull/25347)) //<Sebastian Markbåge>//
- **[97d75c9c8](https://github.com/facebook/react/commit/97d75c9c8 )**: Move react-dom implementation files to react-dom-bindings ([#25345](https://github.com/facebook/react/pull/25345)) //<Sebastian Markbåge>//
- **[3de926449](https://github.com/facebook/react/commit/3de926449 )**: [Fizz] experimental_useEvent ([#25325](https://github.com/facebook/react/pull/25325)) //<dan>//
- **[5b59dd640](https://github.com/facebook/react/commit/5b59dd640 )**: Fix duplicate words tests ([#25333](https://github.com/facebook/react/pull/25333)) //<Vic Graf>//
- **[cb5084d1c](https://github.com/facebook/react/commit/cb5084d1c )**: [ESLint] Check useEvent references instead ([#25319](https://github.com/facebook/react/pull/25319)) //<Lauren Tan>//
- **[c89a83695](https://github.com/facebook/react/commit/c89a83695 )**: Update RulesOfHooks with useEvent rules ([#25285](https://github.com/facebook/react/pull/25285)) //<Lauren Tan>//
- **[efc6a08e9](https://github.com/facebook/react/commit/efc6a08e9 )**: [Flight] Implement error digests for Flight runtime and expose errorInfo in getDerivedStateFromError ([#25302](https://github.com/facebook/react/pull/25302)) //<Josh Story>//
- **[c1d414d75](https://github.com/facebook/react/commit/c1d414d75 )**: Add ref to Offscreen component ([#25254](https://github.com/facebook/react/pull/25254)) //<Samuel Susla>//
- **[135e33c95](https://github.com/facebook/react/commit/135e33c95 )**: Flow: typing of Scheduler ([#25317](https://github.com/facebook/react/pull/25317)) //<Jan Kassens>//
- **[cc8cb145f](https://github.com/facebook/react/commit/cc8cb145f )**: Flow: add some missing types in react-reconciler ([#25316](https://github.com/facebook/react/pull/25316)) //<Jan Kassens>//
- **[112d0498c](https://github.com/facebook/react/commit/112d0498c )**: [Fizz] Move digest from errorInfo to Error instance ([#25313](https://github.com/facebook/react/pull/25313)) //<Josh Story>//
- **[d1bb1c586](https://github.com/facebook/react/commit/d1bb1c586 )**: Fix memory leak after repeated setState bailouts ([#25309](https://github.com/facebook/react/pull/25309)) //<Andrew Clark>//

Changelog:
[General][Changed] - React Native sync for revisions 0cac4d5...9fb581c

jest_e2e[run_all_tests]

Reviewed By: yungsters

Differential Revision: D40383219

fbshipit-source-id: dc2a44bd05df041e0c7f2e1060640b1d2c372187
2022-10-17 09:52:15 -07:00
Moti Zilberman 49cb7f28c8 Break runtime cycle between VirtualizedList and VirtualizedListContext
Summary:
Breaks the runtime dependency cycle introduced in D40259791 (https://github.com/facebook/react-native/commit/971599317b7bdf1152157206f9503a23ac8c4162) by converting a value import to a type import. (Unlike runtime dependency cycles, type-level cycles are OK as long as they are reasonably small.)

Changelog:
[General][Fixed] - Fix require cycle warning in VirtualizedList

Reviewed By: javache

Differential Revision: D40412019

fbshipit-source-id: 33bf3af12be64a1932549a0d11f2ce8b3c483218
2022-10-17 06:58:15 -07:00
Mohit Charkha 9fb3700d35 Extract MisnamedModuleInterfaceParserError from Flow and Typescript into error-utils.js (#34916)
Summary:
This PR is part of https://github.com/facebook/react-native/issues/34872
This PR extracts MisnamedModuleFlowInterfaceParserError exception to a separate function inside an error-utils.js file

## 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] - Extract MisnamedModuleInterfaceParserError to a seperate function inside error-utils.js

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

Test Plan:
yarn jest react-native-codegen
Added unit case in `error-utils-test.js` file

<img width="980" alt="Extract MisnamedModuleInterfaceParserError test Screenshot" src="https://user-images.githubusercontent.com/86604753/194853899-22c1ce05-fe55-4102-a83b-15c707a20000.png">

Reviewed By: cipolleschi

Differential Revision: D40226541

Pulled By: motiz88

fbshipit-source-id: 6698ceff192c592383aa3419ac31de524c605919
2022-10-17 06:47:13 -07:00