Commit Graph

26947 Commits

Author SHA1 Message Date
Intl Scheduler ccaa3a6091 translation auto-update for i18n/instagram-sandbox.config.json on master
Summary:
Chronos Job Instance ID: 1125907824975914
Sandcastle Job Instance ID: 22517999042723056
allow-large-files
ignore-conflict-markers
opt-out-review

Differential Revision: D44193889

fbshipit-source-id: 8e59dcb6237d2d3763650850666aeef8ef16b825
2023-03-18 00:30:05 -07:00
Evan Yeung cd048d4abf Deploy 0.202.0 to xplat
Summary: Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D44155581

fbshipit-source-id: 358df8c40395812216afef1c99f93c576a425b11
2023-03-17 15:46:25 -07:00
Vincent Riemer 728e8a0177 Ensure that pointercancel events have a zeroed location
Summary:
Changelog: [Internal] - Ensure pointercancel events have zeroed location properties

When looking at the pointercancel test the remaining assertion failures were from the expectation that pointercancel events should be reported at [0, 0]. This diff ensures this occurs.

Reviewed By: NickGerleman

Differential Revision: D43886424

fbshipit-source-id: dda37153bd077500599f35db99f114c1a0823120
2023-03-17 15:38:22 -07:00
Vincent Riemer bfee3d9d8d Ensure trailing leave/out events are fired after a cancel event
Summary:
Changelog: [Internal] - Ensure trailing leave/out pointer events are fired after a cancel event

The pointercancel test checks that pointerleave/pointerout events are fired after a pointercancel which preivously wasn't occuring so this added call ensures so.

Reviewed By: NickGerleman

Differential Revision: D43886121

fbshipit-source-id: 9ea801e8f5fcd5855832cfac973bda6ba905998d
2023-03-17 15:38:22 -07:00
Nicola Corti 346de2d16a Compile the GTest suite with CMake (#36477)
Summary:
That's a first step to make sure our C++ tests can effectively run.
Here I'm setting up the pipeline to at least compile those tests and make sure they can be executed on a Android Emulator

Changelog:
[Internal] [Changed] - Setup CMake to run the GTest suite

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

Test Plan: CI needs to be green.

Reviewed By: rshest

Differential Revision: D44066754

Pulled By: cortinico

fbshipit-source-id: f963e0d7d4d9473eada53d7feecfabc21f3c3196
2023-03-17 13:40:57 -07:00
baranga 790df10fa9 Fix check of "reduce motion" setting on android (#36508)
Summary:
On Android `AccessibilityInfo.isReduceMotionEnabled()` returns false even when "Disable Animations" is enabled. This fixes https://github.com/facebook/react-native/issues/31221.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[ANDROID] [FIXED] - Fix check of "reduce motion" setting on android

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

Test Plan: Have some code logging the value of `AccessibilityInfo.isReduceMotionEnabled()` or using it to change the UI. Run that code on Android without and with "Disable Animations" enabled. See the value is always `false` without the fix, but changes to `true` when  "Disable Animations" is enabled with the fix.

Reviewed By: cortinico, rshest

Differential Revision: D44163583

Pulled By: javache

fbshipit-source-id: ad239454ea68b381e0c7f024df797b3646aeefd7
2023-03-17 11:42:54 -07:00
Nicola Corti b0c30ada21 Fix test_buck by using RuntimeEnvironment.application (#36515)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36515

Buck is using a older version of Robolectric which doens't have
`RuntimeEnvironment.getApplication()`. Reverting to the older
accessor.

Changelog:
[Internal] [Changed] - Fix test_buck by using RuntimeEnvironment.application

Reviewed By: cipolleschi

Differential Revision: D44171240

fbshipit-source-id: d2b49e3b08ffd737bc70ea3e0cb6b291cc36425f
2023-03-17 10:26:34 -07:00
Nicola Corti d904164434 Make robolectric tests run in offline mode (#36510)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36510

This sets up a small offline mirror for Robolectric tests
and allows to run them both on CircleCI and on the internal CI.

allow-large-files

Changelog:
[Internal] [Changed] - Make robolectric tests run in offline mode

Reviewed By: cipolleschi

Differential Revision: D44066692

fbshipit-source-id: 3974d92169ed5c8947f72c953e83a7bf6fadca54
2023-03-17 10:26:34 -07:00
Nicola Corti 5cbabe30d3 Use the default build task rather than buildAll
Summary:
We can now use the `build` lifecycle task rather than a custom buildAll.
This task will also run linters and other checks on our builds.

Speficially I realized we were missing some permission in the manifest of RN-Tester
which were missed once we bumped to SDK 33.

Changelog:
[Internal] [Changed] - Use the default `build` task rather than `buildAll`

Reviewed By: cipolleschi

Differential Revision: D44055845

fbshipit-source-id: c9adbbeaaaf7ab8a8000fc1dce84ec39427fb26e
2023-03-17 10:26:34 -07:00
Nicola Corti a389373442 Enable JVM Unit Tests for Gradle
Summary:
This makes sure all the tests are executed inside the `ReactAndroid/src/test` folder.
Currently, we're not executing those tests as they're broken. In this diff I took care of:
- Re-enabling them as much as I could
- Ignoring the ones that are ignored also on BUCK

Those tests will have to be entirely re-written as they're using PowerMock which is
unmaintained and not working well with JDK 17+ (that's also why I had to add
the `--illegal-access=permit` and the `--add-opens` directing to allow mocking).

In general, I believe this is a net positive change as it allows us to add new JUnit tests
that are effectively executed, while the current status is ignoring all of them.

Changelog:
[Internal] [Changed] - Enable JVM Unit Tests for Gradle

Reviewed By: cipolleschi

Differential Revision: D41523697

fbshipit-source-id: dc9f2c4c93d0e6b231e8240a583ca31220152d3f
2023-03-17 10:26:34 -07:00
Tim Gates 342c0beafa docs: Fix a few typos (#36372)
Summary:
##Changelog:
[Internal] -

There are small typos in:
- Libraries/Core/setUpTimers.js
- Libraries/LogBox/Data/LogBoxData.js
- Libraries/Pressability/Pressability.js
- Libraries/Renderer/implementations/ReactFabric-dev.js
- Libraries/Renderer/implementations/ReactNativeRenderer-dev.js
- ReactCommon/react/nativemodule/core/platform/ios/RCTBlockGuard.h

Fixes:
- Should read `snapshot` rather than `snapsho`.
- Should read `symbolication` rather than `sybolication`.
- Should read `polyfilled` rather than `polyfiled`.
- Should read `instance` rather than `instace`.
- Should read `gesture` rather than `gestute`.

Semi-automated pull request generated by
https://github.com/timgates42/meticulous/blob/master/docs/NOTE.md

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

Reviewed By: cortinico, cipolleschi

Differential Revision: D43816768

Pulled By: rshest

fbshipit-source-id: 1346cb3a26748c41d72a3c388d81713ddf2272ed
2023-03-17 09:35:21 -07:00
Ian Jones 3b8459d66b xplat RN: fix flow for useSyncExternalStore
Summary:
They flow type for useSyncExternalStore is incorrect and in consistent with www.

v1.0.0 of use-sync-external-store has the third parameter:
https://github.com/facebook/react/blob/4997515b96eede5ab1ca622e0439a0707f8d4afd/packages/use-sync-external-store/src/useSyncExternalStoreShimClient.js#L37
This revision is 1.0.0:
https://github.com/facebook/react/blob/4997515b96eede5ab1ca622e0439a0707f8d4afd/packages/use-sync-external-store/package.json

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D44163470

fbshipit-source-id: 6582b20ba09f5840b444a1ca3d8fc12d6c783a00
2023-03-17 06:20:15 -07:00
Ruslan Lesiutin 714b502b0c | RN Monorepo | Migrate to package (#36434)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36434

Changelog: [Internal]

This is a squashed stack of 18 commits, starting from D43202126

allow-large-files

Reviewed By: cortinico

Differential Revision: D43977381

fbshipit-source-id: 0da552ddb85f2f61a0be0ef071915b35f3f8555c
2023-03-17 05:03:25 -07:00
Carlos Mesquita 1c1dfab5bc fix(eslint-plugin-specs): removes unnecessary ENOENT error check (#36448)
Summary:
```javascript
      // workaround https://github.com/nodejs/node/issues/31481
      // todo: remove the ENOENT error check when we drop node.js 13 support
      case 'ENOENT':
      case 'EACCES':
```

Well, there was a TODO comment asking to remove `ENOENT` error check when react native drop nodejs 13 support since nodejs 14 has fixed the bug that motivated this check. Now react native minimum nodejs version supported is nodejs 14, so this check is not needed anymore.

## Changelog

[Internal] [Fixed] - Removes `ENOENT` error check

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

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

Reviewed By: NickGerleman

Differential Revision: D44025087

Pulled By: cortinico

fbshipit-source-id: f42cb7105a088e2eea207da12d4e63c6d26f3c77
2023-03-17 04:26:36 -07:00
Vincent Riemer 379d9d4918 Refactor PointerEvent emitting into its own gesture recognizer
Summary:
Changelog: [iOS][Internal] - Refactor PointerEvent emitting into its own gesture recognizer

In doing some exploration of a full e2e implementation of the click event I found pretty early on the necessity of addressing the pointerCancel on scroll functionality which, to implement properly without degrading the existing touch gesture handler — involves extracting all the pointer event handling code written so far into its own gesture handler so it can "fail" (when a scroll view wants to take priority) without affecting the existing touch handlers.

This diff is only a refactor and doesn't add/change any new functionality.

allow-large-files

Reviewed By: sammy-SC

Differential Revision: D43372806

fbshipit-source-id: e16f75121fd121d3f82ab43cfc6fab0629654f26
2023-03-16 16:31:36 -07:00
Vincent Riemer b2fda3eca7 Add platform test for pointercancel events caused by touch scrolling
Summary:
Changelog: [Internal] - Add platform test for pointercancel events caused by touch scrolling

This diff adds a new ported Web Platform Test which [verifies that pointercancel events are properly emitted once a touch causes scrolling](https://github.com/web-platform-tests/wpt/blob/master/pointerevents/pointerevent_pointercancel_touch.html).

Reviewed By: lunaleaps

Differential Revision: D43855277

fbshipit-source-id: 94a106058ba2c5e5fe4c1980519ceceddb2bb389
2023-03-16 12:23:25 -07:00
jiggag 93c1fbd2d8 Fix typos (RCTCustomRefreshControlProtocol) (#36363)
Summary:
Fix typo `RCTCustomRefreshContolProtocol` > `RCTCustomRefreshControlProtocol`

## Changelog

[INTERNAL] [FIXED] - Fixed typo RCTCustomRefreshControlProtocol

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

Test Plan: none

Reviewed By: cortinico

Differential Revision: D44024938

Pulled By: cipolleschi

fbshipit-source-id: 1fbc4e75361334586e46e14ee746cbb94d230a92
2023-03-16 09:47:31 -07:00
Pranav Yadav c0a46c696b Merge defaultExports.forEach(statement => ... (Flow, TS) to findNativeComponentType fn in parser-commons.js (#36466)
Summary:
>[Codegen 95] Extract the `defaultExports.forEach(statement =>` (Flow, TS) function in `parser-commons`, so that it accept a Parser parameter to unify the behaviors between flow and typescript. The Parser object needs to be enriched with all the methods to extract the required information from the Node, if they are not there yet.

### Changes

- merged TS & Flow parsers' logic for `defaultExports.forEach(statement =>` of `/components/index.js:findComponentConfig()` into;
- `findNativeComponentType` fn to `parsers-commons.js`
- add `getTypeArgumentParamsFromDeclaration` & `getNativeComponentType` fn's
- add **_tests_** for getTypeArgumentParamsFromDeclaration & `getNativeComponentType` fn's

## Changelog

[INTERNAL] [CHANGED] - Merge `defaultExports.forEach(statement => ...` (Flow, TS) to `findNativeComponentType` fn in `parser-commons.js`

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

Test Plan: - `yarn lint && yarn run flow && yarn jest react-native` ⇒ �

Reviewed By: rshest

Differential Revision: D44088862

Pulled By: cipolleschi

fbshipit-source-id: 91bf0edcd53b2e054160af34d7c128355c178b26
2023-03-16 09:47:31 -07:00
yux-m 94f505ba2b Extract inner switch case 'TSTypereference' to function translateTypeReferenceAnnotation() (#36463)
Summary:
> [Codegen 91] Extract the inner switch in typescript/modules/index.js at line to parse the case TSTypereference ([lines](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/typescript/modules/index.js#L194-L275))into a function translateTypeReferenceAnnotation() (the goal is to try and get a simpler switch statement and to spot structural similiarities between the flow and typescript index.js files)

Part of Issue https://github.com/facebook/react-native/issues/34872

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[INTERNAL] [CHANGED] - Extract inner switch case 'TSTypereference' to function translateTypeReferenceAnnotation().

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

Test Plan:
- yarn lint
- yarn run flow
- yarn test react-native-codegen

Reviewed By: cortinico

Differential Revision: D44027755

Pulled By: cipolleschi

fbshipit-source-id: b32d6adc56fcd0e1b42c255b16828b2306941d57
2023-03-16 09:47:31 -07:00
Luna Wei c0abff11b6 Precedent textContentType when set
Summary: Changelog: [iOS][Changed] - Give precedence to `textContentType` property for backwards compat as mentioned in https://github.com/facebook/react-native/issues/36229#issuecomment-1470468374

Reviewed By: necolas

Differential Revision: D44106291

fbshipit-source-id: 5702d7f171735d1abe6cfbc9ca1ad8f21751d51e
2023-03-16 08:26:53 -07:00
Gabriel Tomitsuka dc2cbed07c Improve error messages for invalid function types in react-native-codegen (#36498)
Summary:
The supported `CodegenTypes` aren't provided in the docs, which leads to many issues for developers working to transition native components to support Fabric.
However, explicit error messages are provided in many cases (e.g., to use specific numeric types instead of `number` attributes or to remove nested optionals in arrays).
This isn't the case for the common use case of TypeScript functions, which are very commonly used for event handlers in native components (such as `onChange`), forcing devs to search their way through the `react-native` codebase until they find [this file](https://github.com/facebook/react-native/blob/681d7f8113d2b5e9d6966255ee6c72b50a7d488a/Libraries/Types/CodegenTypes.js#L18).

By providing an explicit error message, we can significantly improve developer experience for those working to transition libraries/components, leading to higher Fabric adoption.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[GENERAL] [ADDED] - Create explicit error message for TypeScript functions used as props in Codegen components, redirecting devs to the supported function types `BubblingEventHandler` and `DirectEventHandler`.

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

Test Plan:
* `yarn run lint` shows no errors
* no impact on `yarn && yarn jest react-native-codegen`, which failed 362 tests before and after my changes.

Reviewed By: cipolleschi, sshic

Differential Revision: D44132960

Pulled By: dmytrorykun

fbshipit-source-id: d805ec8403613bf4e070cbd2904ff5a2648ec5fc
2023-03-16 08:17:45 -07:00
Helena Ford 4acef8e4a4 fix: EventEmitter ts definition file (#36462)
Summary:
There's an error in the `d.ts` file for EventEmitter which causes the following error:

```
This expression is not constructable.
  Type 'typeof import(".../vendor/emitter/EventEmitter")' has no construct signatures.
const emitter = new EventEmitter();
                      ~~~~~~~~~~~~
```

See https://github.com/facebook/react-native/blob/dce9d8d5de381fe53760ddda0d6cbbdfb5be00e4/Libraries/vendor/emitter/EventEmitter.js#L63

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[GENERAL] [FIXED] -Fixes an issue with the EventEmitter type definition file

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

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

Reviewed By: cipolleschi

Differential Revision: D44130846

Pulled By: javache

fbshipit-source-id: 64cecdf55e58b99b243392811226e5095d5dc006
2023-03-16 06:04:51 -07:00
Alex Hunt 681d7f8113 Hotfix for Jest preset changes in 0a3c555 (#36495)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36495

It looks like Jest is not running `babel/transform-modules-commonjs` on all files, and therefore when including `"import"` as a Package Exports condition in Jest, this misbehaved (https://github.com/facebook/react-native/commit/0a3c55562b5ba43b00c21ca4d7b2cba0c8eb6206).

This is a hotfix to restore CI stability.

Changelog:
[Fix][Internal] Hotfix adjusting Jest changes added in https://github.com/facebook/react-native/commit/0a3c55562b5ba43b00c21ca4d7b2cba0c8eb6206

Reviewed By: cipolleschi, hoxyq

Differential Revision: D44130442

fbshipit-source-id: 6407519d0d5459ef422afe21be26a2e3141bedf3
2023-03-16 04:57:16 -07:00
Jerry 419b41f06d fix: fix animated components ref types (#36472)
Summary:
I found Animated components like `View`, `Text`, `ScrollView`, `Image` ref type inferred as `any` when ref callback used.

![Screen Shot 2023-03-14 at 7 32 53 PM](https://user-images.githubusercontent.com/64301935/224975295-21047dab-7bd1-4023-93d4-a6ee5c47f1e5.png)

this is happening because of `unknown` type is included as union type as below.

![Screen Shot 2023-03-14 at 7 33 01 PM](https://user-images.githubusercontent.com/64301935/224975937-6ee49f7e-55f7-4391-a752-c52c5171ec02.png)

So I excluded `unknown` type inferring via fixing `TAugmentRef` utility type.

Result below!

![Screen Shot 2023-03-14 at 7 33 36 PM](https://user-images.githubusercontent.com/64301935/224976685-da66e5ec-3ef0-41dd-9e1f-2bb8bfcdf598.png)

## Changelog

[GENERAL] [FIXED] - fix animated components ref type inferred `any`

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

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

Test Plan: Ran `yarn test-typescript` and `yarn test-typescript-offline` with no errors.

Reviewed By: cipolleschi

Differential Revision: D44055510

Pulled By: dmytrorykun

fbshipit-source-id: 0d380a2c2198c84d586889e912dec5d2304c213a
2023-03-16 04:23:15 -07:00
Zihan Chen (MSFT) ac5aec3f5c Add minimum necessary .d.ts files to react-native-codegen (2) (#36397)
Summary:
- Add .d.ts files for generators
- export each generators because `react-native-windows` need its own selection of generators.

## Changelog

[GENERAL] [CHANGED] - Add minimum necessary .d.ts files to react-native-codegen (2)

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

Test Plan:
`npm run build` in `packages/react-native-codegen` and see all .d.ts files appear in `lib`.
Checked .d.ts file in typescript playground.

Reviewed By: rshest

Differential Revision: D43941811

Pulled By: cipolleschi

fbshipit-source-id: 28f5bd56f27531ecf25223620a580358018b779d
2023-03-16 03:32:27 -07:00
Alex Hunt 0a3c55562b Update custom "exports" conditions in Jest environment
Summary:
Updates the default set of `"exports"` condition names in our `ReactNativeEnv` for Jest, so that it aligns with the defaults in React Native CLI (https://github.com/react-native-community/cli/pull/1862).

Also includes a subtle update to how this is accomplished. Instead of overriding `exportConditions()`, we assign to the underlying class property — this allows users (once https://github.com/facebook/jest/pull/13989 is merged) to override `customExportConditions` via [`testEnvironmentOptions`](https://jestjs.io/docs/configuration#testenvironmentoptions-object).

```js
  preset: 'react-native',
  testEnvironmentOptions: {
    customExportConditions: ['test', 'react-native'],
  },
```

Changelog: [Internal]

Reviewed By: jacdebug

Differential Revision: D43879056

fbshipit-source-id: 86fffe2b5fdf9d8492d25b8b12a78be75b5fa3be
2023-03-15 17:18:08 -07:00
David Vacca b1b6673796 Refactor usages of TextLayoutManager.sTextPaintInstance
Summary:
Refactor usages of TextLayoutManager.sTextPaintInstance

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D43888689

fbshipit-source-id: 64a198f3ca07e32666701204d94e6e75b3ab53ad
2023-03-15 16:03:39 -07:00
David Vacca 8c3cb4e6db Refactor TextLayoutManager.isRTL() method
Summary:
Quick refactor of refactor TextLayoutManager.isRTL() method to cleanup the method and remove lint warning

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D43888197

fbshipit-source-id: 779fb84527f95b3c04504eaa4302be55ab328634
2023-03-15 16:03:39 -07:00
Adam Gleitman 9ee0e1c78e Use SocketRocket for web socket library (#36471)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36471

The previous native web socket API, `RCTSRWebSocket`, appears to be an older version of the one provided as part of [SocketRocket](https://github.com/facebookincubator/SocketRocket). The latter has several improvements, such as the ability to respect proxy settings, which has been requested by a user of a React Native app.

Everything translates over pretty easily, and considering that SocketRocket is already a dependency of Flipper, there doesn't seem to be much additional cost to swapping out the libraries. If we wanted to make things even slimmer, it may even be possible to make the WebSocket library be optional for release builds.

## Changelog

[IOS] [CHANGED] - Use SocketRocket for web socket library

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

Test Plan:
Validated the following:
* The WebSocket test page in RNTester
* Live reloading

Reviewed By: cortinico

Differential Revision: D43768835

Pulled By: javache

fbshipit-source-id: 11e1ac2700bc92991897c594622e6687339bfcbf
2023-03-15 13:32:59 -07:00
George Zahariev 7fee407564 Update React Native codegen to support Partial as alias of $Partial
Summary:
`Partial` is the new name of `$Partial`

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D43993220

fbshipit-source-id: 38e8a6bcfa559857b2ab88efee6b904b387bdc0d
2023-03-15 12:13:36 -07:00
Rubén Norte 06b97ca28e Back out "React Native sync for revisions fccf3a9...47cf4e5"
Summary:
There's some problem in the last sync that changes the memoization behavior in some product code. We'll revert and investigate.

Changelog: [internal]

Reviewed By: bvanderhoof

Differential Revision: D44100907

fbshipit-source-id: 233b478dd6f2f29121ac05323047ab6099b6b56c
2023-03-15 11:38:15 -07:00
Pieter De Baets 01e7ff5513 Fix incorrect hyphenation frequency in TextLayoutManagerMapBuffer
Summary: Changelog: [Android][Fixed] Fixed text measurement issue related to hyphenation frequency

Reviewed By: makovkastar

Differential Revision: D44093758

fbshipit-source-id: 71b7b6cd862586b673a49f5e6efaf9aeeb25c6e1
2023-03-15 11:35:51 -07:00
Dmitry Rykun b07cf33279 Use RN Build Utils for Building Hermes Artifacts
Summary:
We moved Hermes some build utils from [Hermes repo](https://github.com/facebook/hermes/tree/main/utils) to [React Navtie repo](https://github.com/facebook/react-native/tree/main/sdks/hermes-engine/utils) a while ago to have more control over them. However some paths on the CI were not updated. We continued to use old build scripts for Hermes prebuilds. Some unfortunate side effects are:
- `HERMES_ENABLE_DEBUGGER` is [hardcoded to true](https://github.com/facebook/hermes/blob/main/utils/build-apple-framework.sh#L65). That makes Hermes much slower in Release configuration.
- BUILD_TYPE is [set to Release](https://github.com/facebook/hermes/blob/main/utils/build-apple-framework.sh#L10) instead of `MinSizeRel` which inreases Hermes binary size.

This diff copies these build utils from RN to Hermes source directory before we perform Hermes build.

Changelog
[Internal]

Reviewed By: cipolleschi

Differential Revision: D44066721

fbshipit-source-id: f45ad6a31fb01c10199f69cc7bbcbbc83b793d34
2023-03-15 11:13:17 -07:00
Rob Hogan a8714075e8 Back out D43959013 - [hermes] Update the hermes packages to 0.10.0 in 'fbsource'
Summary: Changelog: [Internal]

Reviewed By: jacdebug

Differential Revision: D44085857

fbshipit-source-id: b5e0732016942595d9fa98f38524602f9e793811
2023-03-15 08:38:44 -07:00
Rubén Norte 08757962d2 Use getter instead of constant to provide access to FabricUIManager binding
Summary:
The `FabricUIManager` module was providing access to the global binding defined by Fabric, adding proper typing for it.

The problem about this module is that it only evaluated the global binding once (during module evaluation) and it cached the result. If this module happened to be loaded before the binding is defined, which can happen in apps using the legacy renderer and Fabric together, this modules caches an `undefined` value indefinitely.

This refactors the module as a getter function to make sure this lazy behavior is handled correctly in the callsites.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D44065186

fbshipit-source-id: 7c5cfe674605f03ecb8ca0dabc4c823e0013da6b
2023-03-15 08:36:40 -07:00
Rubén Norte 913732b3a4 Create feature flag for DOM trees in Fabric
Summary: Changelog: [internal]

Reviewed By: rshest

Differential Revision: D44088652

fbshipit-source-id: a289b6abbc46141943bb99d9003972eec84ba2da
2023-03-15 08:36:40 -07:00
Rubén Norte 6c208c24d5 React Native sync for revisions fccf3a9...47cf4e5
Summary:
This sync includes the following changes:
- **[47cf4e578](https://github.com/facebook/react/commit/47cf4e578 )**: Restore some guards in ReactFabricGlobalResponderHandler after refactor ([#26394](https://github.com/facebook/react/pull/26394)) //<Rubén Norte>//
- **[cfc1274e3](https://github.com/facebook/react/commit/cfc1274e3 )**: Disable IE innerHTML workaround behind a flag ([#26390](https://github.com/facebook/react/pull/26390)) //<Sebastian Markbåge>//
- **[a57f40d83](https://github.com/facebook/react/commit/a57f40d83 )**: Undo dependency injection of batching ([#26389](https://github.com/facebook/react/pull/26389)) //<Sebastian Markbåge>//
- **[d310d654a](https://github.com/facebook/react/commit/d310d654a )**: Avoid meta programming to initialize functions in module scope  ([#26388](https://github.com/facebook/react/pull/26388)) //<Sebastian Markbåge>//
- **[21aee59e4](https://github.com/facebook/react/commit/21aee59e4 )**: Delete unused DOM files ([#26387](https://github.com/facebook/react/pull/26387)) //<Sebastian Markbåge>//
- **[6bd53a5bd](https://github.com/facebook/react/commit/6bd53a5bd )**: Remove FeatureFlags fork for `react-dom/unstable_testing` ([#26383](https://github.com/facebook/react/pull/26383)) //<Sebastian Markbåge>//
- **[2788d0d8d](https://github.com/facebook/react/commit/2788d0d8d )**: Allow empty string to be passed to formAction ([#26379](https://github.com/facebook/react/pull/26379)) //<Sebastian Markbåge>//
- **[f828bad38](https://github.com/facebook/react/commit/f828bad38 )**: Extracted definition and access to public instances to a separate module in Fabric ([#26321](https://github.com/facebook/react/pull/26321)) //<Rubén Norte>//
- **[131768166](https://github.com/facebook/react/commit/131768166 )**: Support Context as renderable node ([#25641](https://github.com/facebook/react/pull/25641)) //<Andrew Clark>//
- **[d4f58c3b8](https://github.com/facebook/react/commit/d4f58c3b8 )**: Support Promise as a renderable node  ([#25634](https://github.com/facebook/react/pull/25634)) //<Andrew Clark>//
- **[633461486](https://github.com/facebook/react/commit/633461486 )**: Add disableLegacyContext test gates where needed ([#26371](https://github.com/facebook/react/pull/26371)) //<Andrew Clark>//
- **[432ffc9d0](https://github.com/facebook/react/commit/432ffc9d0 )**: Convert more Scheduler.unstable_flushAll in tests to new test utils ([#26369](https://github.com/facebook/react/pull/26369)) //<Tianyu Yao>//
- **[69fd78fe3](https://github.com/facebook/react/commit/69fd78fe3 )**: Update Float tests to check for specific errors ([#26367](https://github.com/facebook/react/pull/26367)) //<Andrew Clark>//
- **[93c10dfa6](https://github.com/facebook/react/commit/93c10dfa6 )**: flushSync: Exhaust queue even if something throws ([#26366](https://github.com/facebook/react/pull/26366)) //<Andrew Clark>//
- **[be353d251](https://github.com/facebook/react/commit/be353d251 )**: [Flight Reply] Add undefined and Iterable Support ([#26365](https://github.com/facebook/react/pull/26365)) //<Sebastian Markbåge>//
- **[ef8bdbecb](https://github.com/facebook/react/commit/ef8bdbecb )**: [Flight Reply] Add Reply Encoding ([#26360](https://github.com/facebook/react/pull/26360)) //<Sebastian Markbåge>//
- **[a8875eab7](https://github.com/facebook/react/commit/a8875eab7 )**: Update more tests to not rely on sync queuing ([#26358](https://github.com/facebook/react/pull/26358)) //<Andrew Clark>//
- **[d1ad984db](https://github.com/facebook/react/commit/d1ad984db )**: [Flight] Add support for returning `undefined` from render ([#26349](https://github.com/facebook/react/pull/26349)) //<Sebastian Silbermann>//
- **[39d4b9365](https://github.com/facebook/react/commit/39d4b9365 )**: [Internal tests] Close MessageChannel port to prevent leak ([#26357](https://github.com/facebook/react/pull/26357)) //<Andrew Clark>//
- **[3706edb81](https://github.com/facebook/react/commit/3706edb81 )**: [Float][Fizz]: Don't preload nomodule scripts ([#26353](https://github.com/facebook/react/pull/26353)) //<Josh Story>//
- **[2b003a5cc](https://github.com/facebook/react/commit/2b003a5cc )**: Split out ServerReferenceMetadata into Id and Bound Arguments ([#26351](https://github.com/facebook/react/pull/26351)) //<Sebastian Markbåge>//
- **[62cd5af08](https://github.com/facebook/react/commit/62cd5af08 )**: Codemod redundant async act scopes ([#26350](https://github.com/facebook/react/pull/26350)) //<Andrew Clark>//
- **[037378202](https://github.com/facebook/react/commit/037378202 )**: Internal `act`: Call scope function after an async gap ([#26347](https://github.com/facebook/react/pull/26347)) //<Andrew Clark>//
- **[d8e49f2af](https://github.com/facebook/react/commit/d8e49f2af )**: Use setTimeout to schedule work on the server in Edge environments ([#26348](https://github.com/facebook/react/pull/26348)) //<Sebastian Markbåge>//
- **[83643778b](https://github.com/facebook/react/commit/83643778b )**: Internal test helpers: Use Node's MessageChannel to queue task ([#26345](https://github.com/facebook/react/pull/26345)) //<Andrew Clark>//
- **[44d380794](https://github.com/facebook/react/commit/44d380794 )**: Move internalAct to internal-test-utils package ([#26344](https://github.com/facebook/react/pull/26344)) //<Andrew Clark>//
- **[d81447304](https://github.com/facebook/react/commit/d81447304 )**: [Internal API only] Delete non-awaited form of act ([#26339](https://github.com/facebook/react/pull/26339)) //<Andrew Clark>//
- **[702fc984e](https://github.com/facebook/react/commit/702fc984e )**: Codemod act -> await act (4/?) ([#26338](https://github.com/facebook/react/pull/26338)) //<Andrew Clark>//
- **[9fb2469a6](https://github.com/facebook/react/commit/9fb2469a6 )**: Restore definition of NativeMethods as an object for React Native ([#26341](https://github.com/facebook/react/pull/26341)) //<Rubén Norte>//
- **[161f6ae42](https://github.com/facebook/react/commit/161f6ae42 )**: Codemod act -> await act (3/?) ([#26336](https://github.com/facebook/react/pull/26336)) //<Andrew Clark>//
- **[58605f798](https://github.com/facebook/react/commit/58605f798 )**: Codemod act -> await act (2/?) ([#26335](https://github.com/facebook/react/pull/26335)) //<Andrew Clark>//
- **[703c67560](https://github.com/facebook/react/commit/703c67560 )**: Codemod act -> await act (1/?) ([#26334](https://github.com/facebook/react/pull/26334)) //<Andrew Clark>//
- **[b380c2485](https://github.com/facebook/react/commit/b380c2485 )**: Convert class equivlance tests to flushSync ([#26333](https://github.com/facebook/react/pull/26333)) //<Andrew Clark>//
- **[8f812e75d](https://github.com/facebook/react/commit/8f812e75d )**: Refactor ReactFabricHostComponent ([#26323](https://github.com/facebook/react/pull/26323)) //<Rubén Norte>//
- **[978fae4b4](https://github.com/facebook/react/commit/978fae4b4 )**: [Float][Fiber] implement a faster hydration match for hoistable elements ([#26154](https://github.com/facebook/react/pull/26154)) //<Josh Story>//
- **[8a9f82ed5](https://github.com/facebook/react/commit/8a9f82ed5 )**: [Float][Fizz][Fiber] - Do not hoist elements with `itemProp` & hydrate more tolerantly in hoist contexts ([#26256](https://github.com/facebook/react/pull/26256)) //<Josh Story>//
- **[3cad3a54e](https://github.com/facebook/react/commit/3cad3a54e )**: Use content hash for facebook-www builds ([#26331](https://github.com/facebook/react/pull/26331)) //<Jan Kassens>//
- **[ba353a50a](https://github.com/facebook/react/commit/ba353a50a )**: Build: make version in build artifacts match ([#26329](https://github.com/facebook/react/pull/26329)) //<Jan Kassens>//
- **[6e1756a5a](https://github.com/facebook/react/commit/6e1756a5a )**: Move suspended render logic to ensureRootIsScheduled ([#26328](https://github.com/facebook/react/pull/26328)) //<Andrew Clark>//
- **[1528c5ccd](https://github.com/facebook/react/commit/1528c5ccd )**: SchedulerMock.unstable_yieldValue -> SchedulerMock.log ([#26312](https://github.com/facebook/react/pull/26312)) //<Andrew Clark>//
- **[4bbac04cd](https://github.com/facebook/react/commit/4bbac04cd )**: Upgrade Flow to 0.201 ([#26326](https://github.com/facebook/react/pull/26326)) //<Jan Kassens>//
- **[eb616a12f](https://github.com/facebook/react/commit/eb616a12f )**: Extract duplicated methods in Fabric and the legacy renderer to a shared module ([#26319](https://github.com/facebook/react/pull/26319)) //<Rubén Norte>//
- **[49f741046](https://github.com/facebook/react/commit/49f741046 )**: Fix: Infinite act loop caused by wrong shouldYield ([#26317](https://github.com/facebook/react/pull/26317)) //<Andrew Clark>//
- **[106ea1c58](https://github.com/facebook/react/commit/106ea1c58 )**: Support Iterables in Flight ([#26313](https://github.com/facebook/react/pull/26313)) //<Sebastian Markbåge>//
- **[f905da227](https://github.com/facebook/react/commit/f905da227 )**: [Flight] Send server reference error chunks to the client ([#26293](https://github.com/facebook/react/pull/26293)) //<Hendrik Liebau>//
- **[e0241b660](https://github.com/facebook/react/commit/e0241b660 )**: Simplify Webpack References by encoding file path + export name as single id ([#26300](https://github.com/facebook/react/pull/26300)) //<Sebastian Markbåge>//
- **[25685d8a9](https://github.com/facebook/react/commit/25685d8a9 )**: Codemod tests to waitFor pattern (9/?) ([#26309](https://github.com/facebook/react/pull/26309)) //<Andrew Clark>//
- **[64dde7082](https://github.com/facebook/react/commit/64dde7082 )**: Codemod tests to waitFor pattern (8/?) ([#26308](https://github.com/facebook/react/pull/26308)) //<Andrew Clark>//
- **[3cb5afb82](https://github.com/facebook/react/commit/3cb5afb82 )**: Codemod tests to waitFor pattern (7/?) ([#26307](https://github.com/facebook/react/pull/26307)) //<Andrew Clark>//
- **[e98695db9](https://github.com/facebook/react/commit/e98695db9 )**: Codemod tests to waitFor pattern (6/?) ([#26305](https://github.com/facebook/react/pull/26305)) //<Andrew Clark>//
- **[9a52cc8bc](https://github.com/facebook/react/commit/9a52cc8bc )**: Convert ReactLazy-test to waitFor pattern ([#26304](https://github.com/facebook/react/pull/26304)) //<Andrew Clark>//
- **[03462cfc7](https://github.com/facebook/react/commit/03462cfc7 )**: [Fizz] External runtime: fix bug in processing existing elements ([#26303](https://github.com/facebook/react/pull/26303)) //<mofeiZ>//
- **[faacefb4d](https://github.com/facebook/react/commit/faacefb4d )**: Codemod tests to waitFor pattern (4/?) ([#26302](https://github.com/facebook/react/pull/26302)) //<Andrew Clark>//
- **[06460b6fb](https://github.com/facebook/react/commit/06460b6fb )**: Remove unnecessary (and incorrect) code for compatibility with Paper in the Fabric version of GlobalResponderHandler ([#26290](https://github.com/facebook/react/pull/26290)) //<Rubén Norte>//
- **[ce8a72fd4](https://github.com/facebook/react/commit/ce8a72fd4 )**: Codemod tests to waitFor pattern (2/?) ([#26296](https://github.com/facebook/react/pull/26296)) //<Andrew Clark>//
- **[1f1f8eb55](https://github.com/facebook/react/commit/1f1f8eb55 )**: [Float][Fizz][Fiber]: Refactor <style> Resource implementation to group on flush ([#26280](https://github.com/facebook/react/pull/26280)) //<Josh Story>//
- **[5c633a48f](https://github.com/facebook/react/commit/5c633a48f )**: Add back accidentally deleted test comments ([#26294](https://github.com/facebook/react/pull/26294)) //<Andrew Clark>//
- **[b72ed698f](https://github.com/facebook/react/commit/b72ed698f )**: Fixed incorrect value returned as public instance from reconciler ([#26283](https://github.com/facebook/react/pull/26283)) //<Rubén Norte>//
- **[25a8b9735](https://github.com/facebook/react/commit/25a8b9735 )**: Codemod tests to waitFor pattern (1/?) ([#26288](https://github.com/facebook/react/pull/26288)) //<Andrew Clark>//
- **[e52446733](https://github.com/facebook/react/commit/e52446733 )**: New internal testing helpers: waitFor, waitForAll, waitForPaint ([#26285](https://github.com/facebook/react/pull/26285)) //<Andrew Clark>//
- **[d49e0e0be](https://github.com/facebook/react/commit/d49e0e0be )**: Removed unused imperative events implementation from React Native renderer ([#26282](https://github.com/facebook/react/pull/26282)) //<Rubén Norte>//
- **[41110021f](https://github.com/facebook/react/commit/41110021f )**: Fix: Selective hydration causing incorrect thenable type passed to DevTools ([#26275](https://github.com/facebook/react/pull/26275)) //<Andrew Clark>//
- **[67a61d5bd](https://github.com/facebook/react/commit/67a61d5bd )**: [Flight Fixture] Show SSR Support with CSS ([#26263](https://github.com/facebook/react/pull/26263)) //<Sebastian Markbåge>//
- **[40755c01a](https://github.com/facebook/react/commit/40755c01a )**: [Flight Fixture] Proxy requests through the global server instead of directly ([#26257](https://github.com/facebook/react/pull/26257)) //<Sebastian Markbåge>//
- **[b2ae9ddb3](https://github.com/facebook/react/commit/b2ae9ddb3 )**: Cleanup enableSyncDefaultUpdate flag ([#26236](https://github.com/facebook/react/pull/26236)) //<Jan Kassens>//
- **[6ff1733e6](https://github.com/facebook/react/commit/6ff1733e6 )**: [Float][Fizz][Fiber] support type for ReactDOM.preload() options ([#26239](https://github.com/facebook/react/pull/26239)) //<Josh Story>//
- **[1173a17e6](https://github.com/facebook/react/commit/1173a17e6 )**: [Float][Fizz][Fiber] implement preconnect and prefetchDNS float methods ([#26237](https://github.com/facebook/react/pull/26237)) //<Josh Story>//
- **[a8f971b7a](https://github.com/facebook/react/commit/a8f971b7a )**: Switch to mount dispatcher after use() when needed ([#26232](https://github.com/facebook/react/pull/26232)) //<Sophie Alpert>//
- **[96cdeaf89](https://github.com/facebook/react/commit/96cdeaf89 )**: [Fizz Node] Fix null bytes written at text chunk boundaries ([#26228](https://github.com/facebook/react/pull/26228)) //<Sophie Alpert>//
- **[c04b18070](https://github.com/facebook/react/commit/c04b18070 )**: Remove eventTime field from class Update type ([#26219](https://github.com/facebook/react/pull/26219)) //<Andrew Clark>//
- **[60144a04d](https://github.com/facebook/react/commit/60144a04d )**: Split out Edge and Node implementations of the Flight Client ([#26187](https://github.com/facebook/react/pull/26187)) //<Sebastian Markbåge>//
- **[70b0bbda7](https://github.com/facebook/react/commit/70b0bbda7 )**: [fizz][external-runtime] Fix: process mutation records before disconnecting ([#26169](https://github.com/facebook/react/pull/26169)) //<mofeiZ>//
- **[c7967b194](https://github.com/facebook/react/commit/c7967b194 )**: Distribute bundles more evenly into CI shards ([#26208](https://github.com/facebook/react/pull/26208)) //<Sebastian Silbermann>//
- **[bb1e3d0e1](https://github.com/facebook/react/commit/bb1e3d0e1 )**: Fail yarn build if any bundle fails to build ([#26207](https://github.com/facebook/react/pull/26207)) //<Sebastian Silbermann>//
- **[62e6c4612](https://github.com/facebook/react/commit/62e6c4612 )**: Move Mutation/Persistence fork inline into the functions ([#26206](https://github.com/facebook/react/pull/26206)) //<Sebastian Markbåge>//
- **[80cf4a099](https://github.com/facebook/react/commit/80cf4a099 )**: Update Closure Compiler ([#26205](https://github.com/facebook/react/pull/26205)) //<Sebastian Markbåge>//
- **[6b6d0617e](https://github.com/facebook/react/commit/6b6d0617e )**: Update Rollup and related plugins to their most recent versions ([#24916](https://github.com/facebook/react/pull/24916)) //<Glenn 'devalias' Grant>//
- **[bc38a3dfa](https://github.com/facebook/react/commit/bc38a3dfa )**: Update rollup config to use moduleSideEffects ([#26199](https://github.com/facebook/react/pull/26199)) //<Ming Ye>//
- **[c9d9f524d](https://github.com/facebook/react/commit/c9d9f524d )**: Make enableCustomElementPropertySupport a dynamic flag in www build ([#26194](https://github.com/facebook/react/pull/26194)) //<Andrew Clark>//
- **[189f70e17](https://github.com/facebook/react/commit/189f70e17 )**: Create a bunch of custom webpack vs unbundled node bundles ([#26172](https://github.com/facebook/react/pull/26172)) //<Sebastian Markbåge>//
- **[fbf3bc315](https://github.com/facebook/react/commit/fbf3bc315 )**: Add `scale` as a unitless property ([#25601](https://github.com/facebook/react/pull/25601)) //<Jonny Burger>//

Changelog:
[General][Changed] - React Native sync for revisions fccf3a9...47cf4e5

jest_e2e[run_all_tests]

Reviewed By: sammy-SC

Differential Revision: D44090004

fbshipit-source-id: 6ac2d1d22a078d07ce011481063e78843bded28e
2023-03-15 07:33:16 -07:00
MaeIg 26b22a6827 Remove hardcoded language from modules/index.js (#36435)
Summary:
This PR aims to remove the hardcoded language constants to use common parser instead. It is a task of https://github.com/facebook/react-native/issues/34872:
> [Codegen 89 - Assigned to MaeIg] Remove the const language variable from flow/modules/index.js and replace its usage with parser.language()
> [Codegen 90 - Assigned to MaeIg] Remove the const language variable from typescript/modules/index.js and replace its usage with parser.language()

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[Internal] [Changed] - Remove hardcoded language from modules/index.js to use common parser instead

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

Test Plan:
yarn flow:
<img width="145" alt="image" src="https://user-images.githubusercontent.com/40902940/224333480-600cefd0-9dc6-4142-8e88-db20785e49e6.png">

yarn lint:
<img width="504" alt="image" src="https://user-images.githubusercontent.com/40902940/224333852-d510594f-053e-4866-8ceb-5e3e3d074bc2.png">

yarn test
<img width="383" alt="image" src="https://user-images.githubusercontent.com/40902940/224333600-8c772829-2362-4943-895d-1949a0d88918.png">

Reviewed By: cortinico

Differential Revision: D43979030

Pulled By: cipolleschi

fbshipit-source-id: 39c5b99fc628620f1831ed8c4ee531eec0e866c4
2023-03-15 07:14:26 -07:00
Tarun Chauhan d9f2cbe455 extract Visitor to parsers primitives (#36459)
Summary:
Part of Codegen Issue https://github.com/facebook/react-native/issues/34872
> [Codegen 88] Move the Visitor.js file from parsers/flow/Visitor.js to parser-promitives.js. Copy the TSInterfaceDeclaration(node: $FlowFixMe) function and add it to the Visitor.js just copied. Remove the parsers/typescript/Visitor.js. Make sure we use the same Visitor in both parsers. (We will end up with a Visitor that is the union of the two, being able to handle both Flow and TS. In this specific case, this trade-off make sense as it allows us to remove one file, several duplicated lines for a small price.)

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[Internal][Changed] - Extract Visitor function to parsers primitives and remove both parsers visitor files

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

Test Plan:
```
yarn jest
yarn flow
yarn lint
yarn format-check
```

Reviewed By: cortinico

Differential Revision: D44021825

Pulled By: cipolleschi

fbshipit-source-id: ea465404830402c44081143ee0539107dc75776c
2023-03-15 07:14:26 -07:00
Tarun Chauhan 347d6f8d89 Extract throwIfMoreThanOneCodegenNativecommands error in error-utils (#36407)
Summary:
Part of Codegen Umbrella Issue: https://github.com/facebook/react-native/issues/34872
> [Codegen 99] Extract the throwIfMoreThanOneCodegenNativecommands error in the error-utils.js file and extract the error code from [Flow](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/flow/components/index.js#L111-L133) and [TS](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/typescript/components/index.js#L112-L114)

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[Internal] [Changed] - Extract throwIfMoreThanOneCodegenNativecommands error in error-utils

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

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

Reviewed By: christophpurrer

Differential Revision: D43912403

Pulled By: cipolleschi

fbshipit-source-id: 1c51fc01465a1baa5f06ccea09c3342584bb82cc
2023-03-15 07:14:26 -07:00
TatianaKapos 6a395cb2d7 Change PerformanceApiExample to use ModulePathing (#36478)
Summary:
Recent integration from Windows brought in PerformanceApiExample that uses relative pathing to access react-native library. This causes us to have to override the file since our file structure is different. https://github.com/microsoft/react-native-windows/issues/11373

This PR changes the example to use module pathing instead.

## Changelog

[GENERAL] [CHANGED] - Change PerformanceApiExample to use ModulePathing

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

Test Plan: Tested and passed Windows tests

Reviewed By: rshest

Differential Revision: D44089501

Pulled By: javache

fbshipit-source-id: 99993a4f81556b4fef7c5d15af26b20df960ebf9
2023-03-15 05:47:17 -07:00
gabrieldonadel 43986e8c72 chore: Add functionTypeAnnotation to codegen Parser class (#36468)
Summary:
This PR adds a  `functionTypeAnnotation`  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, refactoring the `throwIfModuleTypeIsUnsupported`  function to accept a `Parser` instead of a `ParserType` and use the newly created function instead of the `if (language)` logic.

## Changelog

[Internal] [Added] - Add `functionTypeAnnotation` to codegen Parser class

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

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

![image](https://user-images.githubusercontent.com/11707729/224882017-2c31f326-047d-4c21-91e0-3396203ce1c5.png)

Reviewed By: cipolleschi

Differential Revision: D44056853

Pulled By: rshest

fbshipit-source-id: f22b9efe53df16f7916eb1a9cea8b9531f1194f5
2023-03-15 05:44:57 -07:00
Ruslan Shestopalyuk b89358263a Use by default new Performance API implementation if available
Summary:
## Changelog:
[Internal] -

Now that Performance API implementation is getting close to the final stage, it should be safe to replace the `global.performance` instance with the corresponding new implementation. This is done *only* if the actual native implementation is present, however (otherwise the behaviour will be exactly the same as before). Currently this is the case for all VR apps, Catalyst and very soon will be the case for fb4a/ios.

Reviewed By: cipolleschi

Differential Revision: D44057951

fbshipit-source-id: 7ccff4a4930175def69ef4d8a44335fbbd4a5df4
2023-03-15 05:36:24 -07:00
Ian Childs 102e40a88d Disable Android platform for more failing tests
Reviewed By: jselbo

Differential Revision: D44022065

fbshipit-source-id: 29568cdf2703eec8fb020b79ea93873ab7807050
2023-03-15 04:08:19 -07:00
Oleksandr Melnykov 57a2508ae6 Back out "React Native sync for revisions fccf3a9...f828bad"
Summary:
Changelog:
[Internal][Fixed] - Reverting the React sync because it's causing some JS errors.

Original commit changeset: 8ac9754c5ffe

Original Phabricator Diff: D44024996

Reviewed By: kassens

Differential Revision: D44069453

fbshipit-source-id: f3985cc98fea17393df12673aa8b708c988b7e80
2023-03-14 21:28:00 -07:00
Oleksandr Melnykov 534a0499c7 Back out "Remove direct references to the global and untyped nativeFabricUIManager"
Summary:
Changelog:
[Internal][Fixed] - Reverting the React sync because it's causing some JS errors.

Original commit changeset: d8300acb5dab

Original Phabricator Diff: D44029301

Reviewed By: kassens

Differential Revision: D44069428

fbshipit-source-id: cad6a936ebffaa2672a96460ab2c171b30db2def
2023-03-14 21:28:00 -07:00
Oleksandr Melnykov 06f054c852 Back out "Create feature flag for DOM trees in Fabric"
Summary:
Changelog:
[Internal][Fixed] - Reverting the React sync because it's causing some JS errors.

Original commit changeset: 77bb1ee4faaa

Original Phabricator Diff: D43981608

Reviewed By: kassens

Differential Revision: D44069455

fbshipit-source-id: d928185e1dd7f4baf5bca1d08a21988da6fd7edc
2023-03-14 21:28:00 -07:00
Ramanpreet Nara cbdbb47467 Refactor: Move ModuleProvider param to the end in TurboModuleBinding::install()
Summary:
For the TurboModule interop layer, we'll pass in a second ModuleProvider. We'll default that second parameter to null, when the interop layer is disabled. This change will make that easier.

Changelog: [General][Changed] - Re-organize the parameters of TurboModuleBinding::install()

Reviewed By: javache, cortinico

Differential Revision: D43993199

fbshipit-source-id: 2d339cab1f9bfe481f4b72401caa203cd7536da1
2023-03-14 21:16:22 -07:00
Ramanpreet Nara aa28ea01d2 Refactor: Simplify signature of TurboModuleBinding::getModule
Summary:
Previously, the signature of TurboModuleBinding::getModule was

https://www.internalfb.com/code/fbsource/[839b8756fb58bf8cfa38a7d9f90b4b2b99889a37]/xplat/jsi/jsi/jsi.h?lines=111-112

**Problem:** TurboModuleBinding::getModule couldn't be called from [global.nativeModuleProxy](https://www.internalfb.com/code/fbsource/[cacaf79996c24c52fcedc90933b77dcf3411cf54]/xplat/ReactNative/venice/ReactInstance.cpp?lines=25-46) (i.e: jsi::HostObject::get), where only the prop name was available:

https://www.internalfb.com/code/fbsource/[839b8756fb58bf8cfa38a7d9f90b4b2b99889a37]/xplat/jsi/jsi/jsi.h?lines=133

## Changes
This diff simplifies the signature of TurboModuleBinding::getModule to accept only what it needs: a jsi::Runtime, and moduleName

This way, TurboModuleBinding::getModule can be called from:
- jsi::HostFunction (for [global.__turboModuleProxy](https://www.internalfb.com/code/fbsource/[cc6106d532afd3f179b586d6acb4e99edb09bb96]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp?lines=34-48))
- **new:** jsi::HostObject::get (for [global.nativeModuleProxy](https://www.internalfb.com/code/fbsource/[cacaf79996c24c52fcedc90933b77dcf3411cf54]/xplat/ReactNative/venice/ReactInstance.cpp?lines=25-46)).

Changelog: [Internal]

Reviewed By: javache, cortinico

Differential Revision: D43993198

fbshipit-source-id: e1207a129b1033f96d2753c88d372bb7eb4364f3
2023-03-14 21:16:22 -07:00
Nick Gerleman 2d41e6642e Fix types + documentation for CellRendererComponent
Summary:
CellRendererComponent can be given a more useful description, and more constrained type, to ensure it is used more correctly.

Changelog:
[General][Fixed] - Fix types + documentation for CellRendererComponent

Reviewed By: yungsters

Differential Revision: D43925572

fbshipit-source-id: 26aae6a2df989993c97709ffbf1544df7cbae036
2023-03-14 15:32:05 -07:00