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

5812 Коммитов

Автор SHA1 Сообщение Дата
Nicola Corti 3487640512 Fix prefab prefix for fabricjni (#35648)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35648

The `fabricjni` prefab module was missing the `react/fabric` prefix.
I'm adding it here.
Ref: https://github.com/reactwg/react-native-releases/discussions/41#discussioncomment-4402506

Changelog:
[Internal] [Changed] - Fix prefab prefix for fabricjni

Reviewed By: cipolleschi

Differential Revision: D42047434

fbshipit-source-id: 202db49cd1ada2462652dbd7e56bad6779c263ac
2022-12-15 04:54:14 -08:00
Nicola Corti 52f4ff7bbf Expose `react_render_animations` via prefab. (#35643)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35643

The `react_render_animations` was not exposed via prefab. I'm adding it to make possible for
Reanimated to integrate on top of us via prefab.
Ref https://github.com/reactwg/react-native-releases/discussions/41#discussioncomment-4398084

Changelog:
[Internal] [Changed] - Expose `react_render_animations` via prefab.

Reviewed By: cipolleschi

Differential Revision: D42033642

fbshipit-source-id: da4b3665f4fb1c7f8266fa6896585176504435c3
2022-12-14 11:33:48 -08:00
Nicola Corti 822396d1ff Expose ReactAndroid/src/main/jni/react/cxxcomponents via prefab (#35619)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35619

Reference https://github.com/reactwg/react-native-releases/discussions/41#discussioncomment-4353534
I'm exposing `ReactAndroid/src/main/jni/react/cxxcomponents` to be consumed via prefab.
It will be available to both: `react_nativemodule_core` and `reactnativejni`

Changelog:
[Internal] [Changed] - Expose ReactAndroid/src/main/jni/react/cxxcomponents via prefab

Reviewed By: cipolleschi

Differential Revision: D41965512

fbshipit-source-id: 3a5a7473267e2e161d9d7fb0e8dfa74593b47b6e
2022-12-13 02:22:32 -08:00
Nicola Corti bb5fee8f59 Expose ReactCommon/cxxreact headers via Prefab
Summary:
Reference https://github.com/reactwg/react-native-releases/discussions/41#discussioncomment-4353534
I'm exposing the headers inside `ReactCommon/cxxreact` to be access via the Prefab API.

Changelog:
[Internal] [Changed] - Expose ReactCommon/cxxreact headers via Prefab

Reviewed By: cipolleschi

Differential Revision: D41965511

fbshipit-source-id: 726b2948262b4b07cb40996fa1ccf9726a5197ce
2022-12-13 02:22:32 -08:00
Xin Chen cf9c7d51ef Fix edge case when delete is queued with conflict layout animation
Summary:
This is a two step (1/2) fix to a race that could caused a `DELETE`...`CREATE` mutations being sent over to the fabric mounting layer. Such combination was assumed not possible from the differ, yet it happened at least in the existence of layout animation and when certain commits happen while animation is active.

This race condition could cause a view to get deleted at the end of one UI frame, yet the mount instructions generated from animation in the next frame still need to access the deleted view and caused crashes like T112157805. Note that even though such crash is recorded as `RetryableMountingLayerException` and is a soft crash (which only gets logged but not crash in production), the out-of-order mount instructions could lead to illegal view state and make the surface unusable, like what's shown here:

{F820669000}

The diff fixes this issue by removing the `DELETE` [conflict animation](https://fburl.com/code/5ctckvz3) keyframe, as well as the `CREATE` [immediate mutations](https://fburl.com/code/txyomytd) from the layout animation. The Fabric mounting layer assumes no combination of `DELETE...CREATE` in the same frame from differ + [layout animation overrides](https://fburl.com/code/zn17uqch).

Reviewed By: sammy-SC

Differential Revision: D41895427

fbshipit-source-id: d6df02663ba707af6db4a63a325ac776ca54d18e
2022-12-13 01:17:37 -08:00
David Vacca a120679619 Add support for String props on C++ Components
Summary:
This diff adds support for String props on C++ Components

changelog: [internal] internal

Reviewed By: genkikondo

Differential Revision: D41784029

fbshipit-source-id: 3065186074e1feca3dd0dd724105f1596146ee1d
2022-12-12 20:05:23 -08:00
Xin Chen a3c47d3baa Replace RN Dev Tool perf logger usage of API 24 method in java.util.Comparator.naturalOrder
Summary:
Previous diff D41486648 is causing crashes and a sev S311353, which is due to usages of an old Android API that only work after level 24 (D36500518 (0fc42fd35c)). ~~This diff updates the implementation to use a compatible API, but with worse runtime complexity.~~

~~https://fburl.com/txd0r89e is a good explanation on the two algorithm to calculate a streaming median value. This diff uses the approach described in https://stackoverflow.com/a/4903642.~~

## Update
Following suggestion from sshic, I preserved the existing algorithm but with a custom comparator approach.

Changelog: [Internal]

Reviewed By: makovkastar

Differential Revision: D41505143

fbshipit-source-id: 494e07fa627b5cf8bad7971fa5de86d270a7412c
2022-12-12 13:50:44 -08:00
generatedunixname89002005325672 0f089ea2db Daily `arc lint --take KTFMT`
Reviewed By: adamjernst

Differential Revision: D41833756

fbshipit-source-id: 0ecc95aff3bdadadb0769dec55d27fb84fe50e95
2022-12-12 07:51:03 -08:00
David Vacca 57ffa12a08 Delete references of CppComponentRegistry from FabricJSIModuleProvider
Summary:
Delete references of CppComponentRegistry from FabricJSIModuleProvider since it's not necessary anymore

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D41638893

fbshipit-source-id: 8a7b032ead5972609dd4d3c1e40d9d60299c6480
2022-12-10 15:42:08 -08:00
David Vacca 4ab125961b Delete references of CppComponentRegistry from the internals of React Native Android renderer
Summary:
Delete references of CppComponentRegistry from the internals of React Native Android renderer, since it's not necessary anymore

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D41638890

fbshipit-source-id: c4b08853722874dbb21891817836862225469dd9
2022-12-10 15:42:08 -08:00
Lulu Wu 11b53908a7 Remove atomic fix
Summary:
Changelog:
[Android][Changed] - Remove testing code for atomic fix

Reviewed By: fkgozali

Differential Revision: D41730846

fbshipit-source-id: e73e3b9530969683d4247759f3923f105d79cd34
2022-12-10 14:45:22 -08:00
David Vacca ee437bf904 Delete isRootComponent method
Summary:
Delete isRootComponent method, since it's not necessary anymore

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D41638887

fbshipit-source-id: d1d58e07684cb8fd0fc48cfa1f3f92434c1d14c4
2022-12-10 10:30:47 -08:00
David Vacca d9e7be76cd Delete ComponentDeprecatedAPI
Summary:
Deletes references to ComponentDeprecatedAPI in favour of Component API

changelog: [internal] internal

Reviewed By: rshest

Differential Revision: D41638892

fbshipit-source-id: c83b2303650475aa59b438e46e96f976db586a27
2022-12-10 10:30:47 -08:00
David Vacca 30d50430a9 Delete C++ ViewManagers
Summary:
This diff deletes the first implementation of C++ ViewManagers integrated into the internals of Fabric

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D41638894

fbshipit-source-id: 2e7aebff587e2e57b7f3fbf37a24b04943c74573
2022-12-10 10:30:47 -08:00
fabriziobertoglio1987 006527fea7 Fix onAccessibilityAction on Fabric (#35507)
Summary:
fixes https://github.com/facebook/react-native/issues/30841#issuecomment-1228128357. onAccessibilityAction does not work on Fabric and logs:

```
E/unknown:ReactEventEmitter( 3845): com.facebook.react.bridge.ReactNoCrashSoftException:
Cannot find EventEmitter for receiveEvent: SurfaceId[1] ReactTag[104] UIManagerType[2]
```

## Changelog

[Android] [Fixed] - Fix onAccessibilityAction on Fabric

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

Test Plan: https://github.com/facebook/react-native/pull/35507#issuecomment-1330876598

Reviewed By: javache

Differential Revision: D41707777

Pulled By: philIip

fbshipit-source-id: 0f4550a17f4b8bfc1aefa404059b367907f8f60d
2022-12-09 03:47:28 -08:00
Fredia Huya-Kouadio 4f142bf803 Update the logic to check for the source of a MotionEvent
Summary: Changelog: [Internal] Update logic to check for source of MotionEvent for PointerEvents

Reviewed By: lunaleaps

Differential Revision: D41851881

fbshipit-source-id: af3a49d75fc3d58e70d210e7f93d3a6dba90d1c3
2022-12-09 02:38:26 -08:00
Michael Anthony Leon 8284303ec8 Always include inspector
Summary:
Changelog:
[Android][Changed] - Include the inspector in all build modes, and only turn it off/on at runtime.

Reviewed By: jpporto

Differential Revision: D40248901

fbshipit-source-id: f13c58f631e4617a6f157df8899e128959af450a
2022-12-08 14:57:29 -08:00
David Vacca 0df2530c9e Fix lint warning in ReactChoreographer
Summary: changelog: [internal] internal

Reviewed By: javache

Differential Revision: D41621588

fbshipit-source-id: b85e001589f4b0eb7bc5b82329b2fcd9473a0dd2
2022-12-07 11:30:21 -08:00
David Vacca a98861f836 Extend Component to integrate layout and hierarchy of components
Summary:
In this diff I'm extending component to integrate layout and hierarchy of components

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D41621587

fbshipit-source-id: e31c87676ec3068036fb6e9444bce85934b18b7b
2022-12-07 11:30:21 -08:00
Alexander Oprisnik 605a52fe3e Added possibility to mark Fresco image pipeline as already initialized for RN apps
Summary:
Changelog:
[Android][Added] - Added possibility to mark Fresco image pipeline as already initialized

Reviewed By: defHLT

Differential Revision: D41741638

fbshipit-source-id: 46f059297f3af8c1f9cb4b93ce4add895bce85df
2022-12-07 10:35:01 -08:00
Pieter De Baets c2a4654d37 Switch TurboModules over to generated getName method
Summary:
Apply the codegen improvements from D41615387

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D41687534

fbshipit-source-id: 1d56f8fcb8d8b546291350785172a3b02abb0873
2022-12-07 06:35:01 -08:00
Pieter De Baets 90538909f9 Emit name constant as part of Java codegen
Summary:
We have the expected module name available as part of the codegen schema, so we can remove the need for developers to implement the `getName` method as part of their module implementation.

Note that this method is not actually used when the TurboModules infra is used, as the moduleName from the turbo module manager is passed through to the TurboModule base class instead. Moving the method to codegen will make it easier to remove this method altogether once the old architecture is fully removed.

Changelog: [Android][Added] Support generating `getName` in react-native-codegen for Java TurboModules

Reviewed By: mdvacca

Differential Revision: D41615387

fbshipit-source-id: 6b117645fa39e5e9ab014b21198496a52f6f2ae2
2022-12-07 06:35:01 -08:00
Samuel Susla 1d3fa40c59 Add setNativeProps to Fabric
Summary:
changelog: Introduce setNativeProps to Fabric

Add support for `setNativeProps` in Fabric for backwards compatibility. It is still recommended to move away from `setNativeProps` because the API will not work with future features.

We can make step [Migrating off setNativeProps](https://reactnative.dev/docs/new-architecture-library-intro#migrating-off-setnativeprops) in migration guide optional.

Reviewed By: yungsters, mdvacca

Differential Revision: D41521523

fbshipit-source-id: 4d9bbd6304b8c5ee24a36b33039ed33ae1fc21f8
2022-12-06 04:47:51 -08:00
Robert Balicki 96d6680e00 Add iOS + Android support for getting/setting reload-and-profile-related settings
Summary:
@public
* Add support for getting/setting reload-and-profile-related settings in iOS + Android

## Changelog:
[General][Added] - Add support for getting/setting reload-and-profile-related settings in iOS + Android

Reviewed By: NickGerleman

Differential Revision: D41040611

fbshipit-source-id: df99fb0101dfdfc6808708a5a6ecd9cb96a357d5
2022-12-05 22:07:30 -08:00
Sim Sun 92a705b0e0 deps(android): bump soloader to 0.10.5 (#35569)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35569

SoLoader should not be used on Android 7+ unless the app is delivered as [Exopackage](https://buck.build/article/exopackage.html), requires [Android Native Library Merging](https://engineering.fb.com/2018/01/23/android/android-native-library-merging/) or uses [Superpack](https://engineering.fb.com/2021/09/13/core-data/superpack/) compression.
The 0.10.5 soloader would direclty use system linker on Android 7+ by default.

you can change this behavior via adding below meta-data in app's manifest file
```
<application ...>
    <meta-data
        tools:replace="android:value"
        android:name="com.facebook.soloader.enabled"
        android:value="true" />
</application>
```
## Changelog

[Android] [Changed] - Bump Soloader to 0.10.5

https://github.com/facebook/SoLoader/compare/v0.10.4...v0.10.5

Reviewed By: cortinico

Differential Revision: D41691125

fbshipit-source-id: 7d63b090de66bc42c0b473b4bf85eb65442549dd
2022-12-05 11:51:56 -08:00
Neil Mitchell bdb2fd6979 Add support for Buck oncall annotations (#35562)
Summary:
Newer versions of Buck (not released open source) support an `oncall` annotation to denote who owns a particular BUCK file. These annotations are useful to support so that if BUCK files are updated with such annotations they don't break.

## Changelog

[Internal] [Changed] - support oncall annotation in BUCK files

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

Test Plan: The `test_buck` CI job validates that the file can be evaluated by open-source Buck. I ran this on a CircleCI fork, and it passed.

Reviewed By: motiz88

Differential Revision: D41731925

Pulled By: cortinico

fbshipit-source-id: 7d0ae164c3e6289d4aa76892658d46bbe4faf99c
2022-12-05 06:12:46 -08:00
Nicola Corti 7933dd78da Remove .mk prebuilt file and .mk file generation from codegen (#35540)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35540

We now don't need to generate .mk files anymore, therefore I'm removing
this logic from the codegen. In RN 0.72 users should be fully migrated
to CMake.

Changelog:
[Android] [Removed] - Remove .mk prebuilt file and .mk file generation from codegen

Reviewed By: rshest

Differential Revision: D41654122

fbshipit-source-id: 3a3c01fa8ab4d48460338e1a9ce2ecbd6df25f47
2022-12-05 03:27:37 -08:00
fabriziobertoglio1987 759056b499 Override default Talkback automatic content grouping and generate a custom contentDescription (#33690)
Summary:
The Implementation of the functionality consists of:

1) Checking that an element has no contentDescription and no text and has other content to announce (role, state, etc.) which causes this issue (for ex. the accessibilityRole is announced before the contentDescription for ex. "Button, My text children component")
2) If Talkback finds no content to announce on the current node, a custom contentDescription is generated from the child elements that respect the following conditions:

>If an AccessibilityNodeInfo is considered "actionable" (which Talkback defines as having clickable=true, longClickable=true, or focusable=true, or having AccessibilityActions for any of those), AND it has some content to read like a contentDescription or text, it will be considered focusable.
>If an AccessibilityNodeInfo is considered "actionable" AND it does not have content to read like a contentDescription or text Talkback will parse descendant elements looking for non-focusable descendants to use as content.

3) implementation of a method getTalkbackDescription to generate the above contentDescription from child elements
4) over-ride parent contentDescription (accessibilityLabel) with the value returned from getTalkbackDescription

Related [notes on Android: Role description is announced before the components text, rather than after https://github.com/facebook/react-native/issues/31042][51]. This issue fixes [https://github.com/facebook/react-native/issues/31042][50].

## Changelog

[Android] [Added] - Override default Talkback automatic content grouping and generate a custom contentDescription

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

Test Plan:
**PR Branch**
[1]. Screenreader correctly announcing accessible/non-accessible items ([link][1])
[2]. Screenreader announces Pressability items ([link][2])
[3]. Button role is announced after child contentDescription with TouchableNativeFeedback ([link][3])
[4]. Testing for regressions in Accessibility Actions ([link][4])
[5]. Screenreader focuses on ScrollView Items ([link][5])
[6]. Recordings of complete test cases in rn-tester app main and pr branch ([link][6])
[9]. TouchableOpacity with TextInput child announces contentDescription before the Role ([link][9])
[10]. One of the child has accessibilityState (hasStateDescription triggers the announcement) ([link][10])
[11]. One of the child has accessibilityHint (hasText triggers the announcement) ([link][11])

**Main**
[15]. The View does not announce the child component Text when accessibilityLabel is missing (automatic content grouping) ([link][15])
[8]. TouchableOpacity with child EditText annouces placeholder text before and after the role ([link][8])

[1]: https://github.com/fabriziobertoglio1987/react-native-notes/issues/14#issuecomment-1106375974 "Screenreader correctly announcing accessible/non-accessible items"
[2]: https://github.com/fabriziobertoglio1987/react-native-notes/issues/14#issuecomment-1106213313 "Screenreader announces Pressability items"
[3]: https://github.com/fabriziobertoglio1987/react-native-notes/issues/14#issuecomment-1109935139 "Button role is announced after child contentDescription"
[4]: https://github.com/fabriziobertoglio1987/react-native-notes/issues/14#issuecomment-1110541392 "Testing for regressions in Accessibility Actions"
[5]: https://github.com/fabriziobertoglio1987/react-native-notes/issues/14#issuecomment-1106012823 "Screenreader focuses on ScrollView Items"
[6]: https://github.com/fabriziobertoglio1987/react-native-notes/issues/14#issuecomment-1111942775 "Recordings of complete test cases in rn-tester app main and pr branch"
[7]: https://github.com/fabriziobertoglio1987/react-native-notes/issues/14#issuecomment-1139511589 "TouchableOpacity with child EditText annouces Button role before the child contentDescription"
[8]: https://github.com/fabriziobertoglio1987/react-native-notes/issues/14#issuecomment-1140967225 "TouchableOpacity with child EditText annouces placholder text before and after the role"
[9]: https://github.com/fabriziobertoglio1987/react-native-notes/issues/14#issuecomment-1140999648 "TouchableOpacity with TextInput child announces contentDescription before the Role"
[10]: https://github.com/fabriziobertoglio1987/react-native-notes/issues/14#issuecomment-1149479950 "One of the child has accessibilityState (hasStateDescription triggers the announcement)"
[11]: https://github.com/fabriziobertoglio1987/react-native-notes/issues/14#issuecomment-1149535215 "One of the child has accessibilityHint (hasText triggers the announcement)"

[15]: https://github.com/fabriziobertoglio1987/react-native-notes/issues/14#issuecomment-1088680339 "The View does not announce the child component Text when accessibilityLabel is missing (automatic content grouping)"

[50]: https://github.com/facebook/react-native/issues/31042 "Android: Role description is announced before the components text, rather than after https://github.com/facebook/react-native/issues/31042"
[51]: https://github.com/fabriziobertoglio1987/react-native-notes/issues/14 "notes on Android: Role description is announced before the components text, rather than after https://github.com/facebook/react-native/issues/31042"

Reviewed By: cipolleschi

Differential Revision: D39177512

Pulled By: blavalla

fbshipit-source-id: 6bd0fba9c347bc14b3839e903184c86d2bcab3d2
2022-12-01 21:32:04 -08:00
David Vacca fb84e092cf unique -> shared pointer in Component
Summary:
Refactor unique -> shared pointer in Component. This will be necessary in the next diffs of the stack

changelog: [intenal] internal

Differential Revision: D41629759

fbshipit-source-id: 335161c350692e25ac3443bd19675a89f9df60c4
2022-12-01 19:29:59 -08:00
Genki Kondo 07c8854a1c Consolidate OkHttpClient creation
Summary:
Consolidates creation of OkHttpClients used by RN panel apps into PanelAppOkHttpClientProvider. This diff adds no functional changes; however, a followup diff will leverage this to add an Interceptor for overriding the network tier.

Changelog:
[Internal] - Enable passing in custom OkHttpClient to NetworkingModule

Reviewed By: rshest

Differential Revision: D41621244

fbshipit-source-id: 8954f9adc6a0cfdf6312678e2dbd6be8ef9aa5ca
2022-12-01 10:24:55 -08:00
Nicola Corti daefeb1c0b Ensure local hermes.tar.gz doesn't get stale between subsequent runs.
Summary:
On main, We download and store `hermes.tar.gz` locally during builds.
If another commit on the Hermes repo lands, Gradle might not re-download the hermes.tar.gz
file.

This commit fixes it by using `useETag` that allows us to use ETag that Github exposes
to understand if the tarball has been updated or not.

Changelog:
[Internal] [Changed] - Ensure local hermes.tar.gz doesn't get stale between subsequent runs.

Reviewed By: javache

Differential Revision: D41652865

fbshipit-source-id: 9f6e02957989acb02f419286c94b05df701c8a04
2022-12-01 08:56:56 -08:00
Nicola Corti da4243b38d Properly expose `jscexecutor` as a prefab target (#35521)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35521

Inside RC3 the jscexecutor target was prepared for prefab consumption
but not properly exposed.
This was not caught by the CI as we're not effectively using this target,
but some of our popular libraries do (i.e. Reanimated). I'm exposing it here.

Changelog:
[Internal] [Changed] - Properly expose `jscexecutor` as a prefab target

Reviewed By: javache

Differential Revision: D41648349

fbshipit-source-id: 1a04bc21aa50eece304828ce1d99ae795a51af48
2022-12-01 04:25:22 -08:00
Xin Chen 0569f6500e Clean up unnecessary lambda function for preallocate after D40403682
Summary: `dispatchPreallocationInBackground_` is removed and we don't need to use the lambda function anymore.

Reviewed By: javache

Differential Revision: D41574447

fbshipit-source-id: 9c2b8a067fb86b75320b338e3f8c7989315f9b8b
2022-11-30 14:24:34 -08:00
Pieter De Baets e7dbfb2dbd Support colors in AnimatedInterpolation on Android
Summary:
Color support for AnimatedInterpolation was incomplete with native drivers, as only rgba type strings were supported. There was also an issue where color props instead a StyleAnimatedNode would never get applied. We were also potentially duplicating color parsing support, which is already centralized in `normalizeColor` / `processColor`.

Changelog: [Android][Added] Enable AnimatedInterpolation to interpolate arbitrary color types.

Reviewed By: mdvacca

Differential Revision: D40571873

fbshipit-source-id: 41857ab0391279c5307bc31b855ea8fbcb4cccd8
2022-11-30 10:19:12 -08:00
Nicola Corti ca9ef9f769 Rename hermes-* target to don't use dashes (#35506)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35506

In our build we had a mixture of `_` and `-` to separate targets.
Dashes don't play well with Gradle + as we expose them now via Prefab,
let's stick to use only underscores

Changelog:
[Internal] [Changed] - Rename target to don't use dashes

Reviewed By: cipolleschi

Differential Revision: D41578938

fbshipit-source-id: 8aa44aa2dc7bf4822b45e5044532837b989817d2
2022-11-29 10:43:54 -08:00
Pieter De Baets 229a1ded15 Remove ObjCTurboModule experiments with retaining JS callbacks in custom scopes
Summary: Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D41551086

fbshipit-source-id: b70965bcf2af6ebac921cc627c196ec108f73944
2022-11-29 08:29:05 -08:00
Pieter De Baets cadf850ac1 Remove JavaTurboModule experiments with retaining JS callbacks in custom scopes
Summary: Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D41551087

fbshipit-source-id: 5bdcd5f8c9bac99603f6187a9bc387827f5321c7
2022-11-29 08:29:05 -08:00
Pieter De Baets 1b994732e4 Fix pointer event dispatch to nested text nodes
Summary:
Noticed that we weren't receiving pointer events for nested Text spans when the new pointer events implementation was enabled.

Changelog: [Internal]

Reviewed By: lunaleaps

Differential Revision: D41496672

fbshipit-source-id: 9d0ed83d1bb5f42211ec655328035651f25fa471
2022-11-29 07:00:13 -08:00
Pieter De Baets 9c88dad7a2 Remove references to deleted experiments
Summary:
These experiments have been removed already, but we still have references to them in C++.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D41549465

fbshipit-source-id: 1158fb391b4279ef4eb6ad7123cb8113d7ecccef
2022-11-29 05:22:13 -08:00
Luna Wei 8b00b4f286 Text measurement, Math.ceil calculatedWidth
Summary: Changelog: [Internal] - Fix incorrect text container measurement for Android 11+

Reviewed By: mdvacca

Differential Revision: D41559873

fbshipit-source-id: 76c200693cd10b9b7fe883dd81b0c3c1dbdecf27
2022-11-28 15:57:37 -08:00
Luna Wei 4e668167f9 PointerEvents: Delete unused method
Summary: Changelog: [Internal] - Clean up unused function for PointerEvents

Reviewed By: vincentriemer, mdvacca

Differential Revision: D41089897

fbshipit-source-id: 8c44b88d919f771fdafb2402ec71366dad6c6ed6
2022-11-28 11:01:32 -08:00
Luna Wei 75a8847a42 Fix detection supportsHover
Summary: Changelog: [Internal] - Internal usage broke existing behavior, reverting to check if a flag is set.

Reviewed By: javache

Differential Revision: D41502122

fbshipit-source-id: 296bb1578cd63f935e4111bfec8d58f965149640
2022-11-28 10:28:13 -08:00
shivenmian b7a85b59b5 chore: renamed react-native-codegen to @react-native/codegen (#34804)
Summary:
Renamed react-native-codegen package to react-native/codegen and updated references, without changing the folder name; part of RFC480 (https://github.com/facebook/react-native/issues/34692). Follow-up from https://github.com/facebook/react-native/pull/34578

## Changelog

[General] [Changed] - Renamed react-native-codegen package to react-native/codegen and updated references

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

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

Reviewed By: cortinico

Differential Revision: D39883584

Pulled By: hoxyq

fbshipit-source-id: 0ef384b75c6edd248b31e37b8f05f64b4d39ca6f
2022-11-28 08:28:51 -08:00
Nicola Corti cf4269ab33 Expose `jscruntime` to be consumed via Prefab
Summary:
This is the last library that we should expose via Prefab.
Thanks to cipolleschi 's work here moving the file to `/ReactCommon/jsc` folder
we can easily expose it to be consumed by third parties.

Changelog:
[Internal] [Changed] - Expose `jscruntime` to be consumed via Prefab

Reviewed By: cipolleschi

Differential Revision: D41534564

fbshipit-source-id: fb4b2d801def8caf71638dcb74eb87f8230984d4
2022-11-28 04:13:55 -08:00
Riccardo Cipolleschi f3bf4d02ab Move JSCRuntime into its own folder (#35482)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35482

This change moves the JSCRuntime.h/cpp into a `jsc` folder.

This change is required for several reasons:
1. on iOS, the new `jsi`, `jsidynamic` and `jsc` setup is breaking the `use_frameworks!` with  `:linkage => :static` option with the old architecture. So it is a regression.
2. JSCRuntime is required by some libraries and needs to be exposed as a prefab and the current setup makes it hard to achieve.

allow-large-files

## Changelog:
[General][Changed] - Move JSCRuntime into a separate pod/prefab

Reviewed By: cortinico

Differential Revision: D41533778

fbshipit-source-id: 642240c93a6c124280430d4f196049cb67cb130b
2022-11-28 04:13:55 -08:00
Christoph Purrer 022e22cbd4 Replace folly::Optional with std::optional (#35436)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35436

Using std::optional as react-native has been using C++17 for quite some time

changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D41415031

fbshipit-source-id: d786647f64b4f90cf75409109830ae0885460c17
2022-11-28 02:08:12 -08:00
Nicola Corti e6c0ac0517 Fix compilation warnings for MapBuffer
Summary:
We have two warnings on MapBuffer which I'd like to resolve as they show up on console every time.
1. We're using a deprecated method receiveCommand, which is actually legit but was missing a propagation of the warning. I'm adding it.
2. We had a null check that that was always not null. That is enforced by the Kotlin type system. I've checked the code and
we're actually always returning non-nulls there or raising exceptions instead.

Changelog:
[Internal] [Changed] - Fix compilation warnings for MapBuffer

Reviewed By: javache

Differential Revision: D41522129

fbshipit-source-id: c2dbb660f95a2ff7dac6e4fcdf476e4058cf730e
2022-11-25 08:01:18 -08:00
Nicola Corti 92be0e3fde Allow `reactnativejni` to be consumed via prefab (#35461)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35461

This is another library which is adding prefab support as it's needed by
Expo libraries and Reanimated.

Changelog:
[Internal] [Changed] - Allow `reactnativejni` to be consumed via prefab

Reviewed By: cipolleschi

Differential Revision: D41520801

fbshipit-source-id: 91142a5b5051cfba478d93a2475a178eed6fbb29
2022-11-24 08:45:15 -08:00
Nicola Corti 332822150a Add missing headers to `react_nativemodule_core` prefab module (#35460)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35460

Reanimated reported that `react_nativemodule_core` was missing some headers.
Specifically the one from ReactAndroid::react_debug, ReactAndroid::react_render_core, ReactAndroid::glog,
and ReactAndroid::react_render_debug.

I'm adding them here so they get included in the shipped headers for `react_nativemodule_core`

Changelog:
[Internal] [Changed] - Add missing headers to `react_nativemodule_core` prefab module

Reviewed By: cipolleschi

Differential Revision: D41520751

fbshipit-source-id: 4627a2d0f880d4bb3ff2f0e43cd735cf9a3f2f9a
2022-11-24 08:45:15 -08:00
Nicola Corti 055d09cb76 Add prefab for _uimanager _scheduler and _mounting (#35458)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35458

We're adding prefab support for those modules as they're needed by Reanimated
and we're exposing headers for them as well.

Changelog:
[Internal] [Changed] - Add prefab for _uimanager _scheduler and _mounting

Reviewed By: cipolleschi

Differential Revision: D41520606

fbshipit-source-id: 76f3c81705e99057b92cd9b86d0601a2b1410f95
2022-11-24 08:45:15 -08:00
Nicola Corti b70707b96d Expose `hermes-executor` to be consumed via prefab (#35457)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35457

This exposes `hermes-executor` to be consumed via prefab so that
libraries can depend on it and use its symbols if needed (Expo and Reanimated need it).

Changelog:
[Internal] [Changed] - Expose `hermes-executor` to be consumed via prefab

Reviewed By: cipolleschi

Differential Revision: D41520019

fbshipit-source-id: d590a043ea89fdd8ff41b0ed20900c9cf381a1e4
2022-11-24 08:45:15 -08:00
Nicola Corti fe2716b8ae Consolidate hermes-executor-debug and -release inside a single target (#35454)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35454

Historically, we used to have hermes-executor debug and release as separate dynamic libraries.
This makes it impossible to prefab this library, so I have to reconcile it into a single library.

This will also help keep the setup consistent with the internal (BUCK) where we have a single target.

Changelog:
[Internal] [Changed] - Consolidate hermes-executor-debug and -release inside a single target

Reviewed By: cipolleschi

Differential Revision: D41519119

fbshipit-source-id: d9ddc30b72164daa29c735836ea433fd4d917fc8
2022-11-24 08:45:15 -08:00
Christoph Purrer 9517320176 Enable C++17 for cxxreact and jsiexecutor/inspector and ... (#35435)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35435

This raises the C++ language standard to C++17 which is needed to remove some folly:: dependencies

changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D41482821

fbshipit-source-id: 62af6e95e6e78378112a4ce4e9c3ab7df0587218
2022-11-23 18:48:47 -08:00
David Vacca 45a9b9f992 Remove unused method
Summary:
Remove unused method

changelog: [internal] intenral

Reviewed By: makovkastar

Differential Revision: D41386919

fbshipit-source-id: d0ce952ea5f52effb7791d3b97605ce9c4c65957
2022-11-21 12:27:24 -08:00
David Vacca 2f06b26634 refactor ViewGroupManager to use IViewGroupManager
Summary:
In this diff I'm  refactoring ViewGroupManager to implement IViewGroupManager
This will be used by ViewManagers that require to add views but don't depend on ViewGroupmanager

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D41386918

fbshipit-source-id: 427b9689eb3408c2477cf38494d42280b41fd7d8
2022-11-21 12:27:24 -08:00
David Vacca c0a0481656 Introduce IViewGroupManager
Summary:
In this diff I'm introducing IViewGroupManager to extract methods required to add/remove views from a viewGroup

This will be used by ViewManagers that require to add views but don't depend on ViewGroupmanager

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D41386920

fbshipit-source-id: a7d893d92d0f12766dcc71dfd1b22539c3b9687d
2022-11-21 12:27:24 -08:00
David Vacca 78e7311cd5 Fix lints and clean up interfaces
Summary:
quick diff to fix lints and clean-up interfaces in com.facebook.react.uimanager

changelog: [internal] internal

Reviewed By: NickGerleman

Differential Revision: D41382839

fbshipit-source-id: 7c28fb7b0120e13e6a601c96a58b144161f64d5f
2022-11-21 12:27:24 -08:00
Arushi Kesarwani 662b51fad2 Adding Dev Loading controller without activity for VR (#35392)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35392

Changelog:
    [General][Added] - For supporting Dev Loading View across platforms, adding the DevLoadingViewController without an activity/context.

Reviewed By: rshest

Differential Revision: D40947239

fbshipit-source-id: de124b0a7ee39dc7da3c1c45972a6703eff2f0ef
2022-11-21 11:59:01 -08:00
Nicola Corti 55b1670aa6 Void the Maven coordinates for react-native and hermes-engine (#35379)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35379

This diff moves the publishing coordinates from:
```
com.facebook.react:react-native
com.facebook.react:hermes-engine
```

to

```
com.facebook.react:react-android
com.facebook.react:hermes-android
```

I've picked those they are the most layout friendly when building from source, but we can discuss if we want others.
I've updated the Gradle plugin to have a dependencySubstitution rule + update the template with those changes.

It should now be possible to still use `implementation("com.facebook.react:react-native:+")` inside libraries
on 0.71+ and RNGP will resolve dependencies correctly.

Changelog:
[Android] [Changed] - Void the Maven coordinates for react-native and hermes-engine

Reviewed By: cipolleschi

Differential Revision: D41380525

fbshipit-source-id: 91e059fa261acb89bee7ca0c79c30c3d856a2c80
2022-11-18 04:46:16 -08:00
Alpha 15656342a8 Resolve android crash on display modal (#35380)
Summary:
From exception logging, found crashes due to `Attempt to invoke virtual method 'int android.view.ViewGroup.getChildCount()' on a null object reference`. Tracing through the stack, it appears the constructor for `ViewGroup` conditionally calls `initializeScrollbarsInternal()`, which in turn calls `getChildCount()`.  However `ReactModalHostView` overrides `getChildCount()`, so `getChildCount()` is called before `ReactModalHostView` constructor completes, resulting in null reference when accessing `mHostView` from `getChildCount()`.

## Changelog

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

[Android] [Fixed] - Fix crash on initialize modal

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

Test Plan: In the rn-tester project, display a modal.

Reviewed By: javache, cipolleschi

Differential Revision: D41392235

Pulled By: ryancat

fbshipit-source-id: ce78e4d458ad41769e78139ea0a8a038384e830d
2022-11-18 04:06:32 -08:00
Pieter De Baets e504141583 Remove 'using namespace' from header files
Summary:
Fix linter warning when pulling in some code into AR

Changelog: [Internal]

Reviewed By: NickGerleman, mdvacca

Differential Revision: D41269423

fbshipit-source-id: 4305d6c362a51e62b19b4d3590fb0823073dff9a
2022-11-17 06:19:07 -08:00
Ellis Tsung 2d2f9da80b Scale text line height according to system font size
Summary:
## Changelog:
[Android] [Added] - Added getter for line height in CustomLineHeightSpan

Reviewed By: javache

Differential Revision: D41324647

fbshipit-source-id: 4c2b18fb6566f5f9f25e26acb2f7f157f4ab75f8
2022-11-16 11:24:56 -08:00
David Vacca 5fda72f678 Inroduce BoxComponent
Summary:
The goal of this diff is to introduce the scafolding of a BoxComponent. This class will be eventually shared by Android and iOS

changelog: [internal] internal

Reviewed By: sammy-SC

Differential Revision: D41205801

fbshipit-source-id: e33e58062aa33e0c8e9a48fd112309a358f0a060
2022-11-15 12:17:18 -08:00
David Vacca 878b745fd6 Refactor Component -> ComponentDeprecatedAPI
Summary:
The goal of this diff is to refactor the name of Component to ComponentDeprecatedAPI

Also, I'm introducing a new very simple Component API, this new Component will evolve in the next few diffs and days

changelog: [internal] internal

Reviewed By: sammy-SC

Differential Revision: D41128461

fbshipit-source-id: b6aea08caa609153663cdd4165694cc57b4b76b6
2022-11-15 12:17:18 -08:00
David Buchan-Swanson 64ff077a66 fix detection of android emulator (#35111)
Summary:
at some point, the `Build.FINGERPRINT` of the emulator has changed and no longer includes `generic` as an option.

It apparently now, on all platforms, includes `google/sdk_gphone` at the beginning. Older emulators may still include `generic` in the `Build.FINGERPRINT` so we should maintain that check too.

## Changelog

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

[Android] [Fixed] - Fix android emulator detection for packager host

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

Test Plan: When running on a modern emulator, ensure that the packager attempts to load from `10.0.2.2`.

Reviewed By: cipolleschi

Differential Revision: D41266071

Pulled By: GijsWeterings

fbshipit-source-id: 43115dbde6a411fe2ebde23e720dff4812a4309f
2022-11-15 07:20:36 -08:00
Arushi Kesarwani b8893c7003 Deprecating create() for the Default Dev Support Manager Factory
Summary:
Changelog:
    [Internal][Changeded] - https://github.com/facebook/react-native/pull/31841 introduced customisations for DevSupportManager which made this create() redundant, hence deprecating and adding the annotation.

Reviewed By: cipolleschi

Differential Revision: D41292920

fbshipit-source-id: 9fc348a3f4f8f64ba6f7aee85f302e87e10e8cd5
2022-11-15 04:02:42 -08:00
Pieter De Baets 3921f05f59 Do not use InteractionManager to wait for Activity (#35289)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35289

This was originally added in D15258046 (c802d0b757) but seems to be the wrong solution to the problem from my perspective. InteractionManager does not provide timing information on the activity being available, but ReactContext's LifecycleEventListener does.

This should also address some of the issues raised in https://github.com/facebook/react-native/issues/25675

Changelog: [Android][Fixed] Linking.getInitialUrl should not wait for InteractionManager

Reviewed By: mdvacca

Differential Revision: D41157646

fbshipit-source-id: 6e23969212570204a7e076b6d4d9db004412da09
2022-11-14 03:38:52 -08:00
Kacper Kafara 4c1d5ad9c6 Fix variable expansion in ReactNative-application.cmake (#35306)
Summary:
Hi, while adjusting [react-native-screens](https://github.com/software-mansion/react-native-screens) to `0.71.0-rc.0` I encountered the same problems as reported [here](https://github.com/reactwg/react-native-releases/discussions/41#discussioncomment-4085694) by WoLewicki.

Basically inside `CMake`'s `foreach` loop iterator variable is not being expanded to the actual value:

```cmake
foreach(autolinked_library ${AUTOLINKED_LIBRARIES})
    target_link_libraries(autolinked_library common_flags) // <-- here we are literally linking to "autolinked_library".
endforeach()
```

## Changelog

[Android] [Fixed] - Fix Android autolinking failing because of not expanded variable

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

Reviewed By: christophpurrer, cipolleschi

Differential Revision: D41220408

Pulled By: rshest

fbshipit-source-id: 12ce993f0c5227ca7d3c2cc272fe3739126930b3
2022-11-12 09:11:46 -08:00
Arushi Kesarwani 1a4fa92b25 Abstracting Activity logic from Dev Loading View (#35256)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35256

Changelog:
    [General][Added] - Making Dev Loading View cross platform by abstracting out the activity/context logic from the controller in a polymorph class.

Reviewed By: rshest

Differential Revision: D40908923

fbshipit-source-id: db8e94f8ded5ffe0deeb88335cd7f3d1bf87243a
2022-11-11 05:12:02 -08:00
Sharon Zheng 29caed22cc rounded Views with borders shows small gap
Summary:
When a __rounded__ View on Android has a border, a small gap appears between the border and the center of the view (most noticeably when the background and border colors are the same)

Since the border is drawn on top of the other layers, the approach here is to make the center of the View slightly larger so that there is an overlap with the border, and closing the visible gap

There are 2 cases for a View with a border:
1. `borderWidth` is set for a consistent border width around all 4 edges
2. Uneven border widths are set (using `borderTopWidth`, `borderLeftWidth, ...)

**How is a rounded rectangle drawn?**
__Case 1__: `borderWidth` is set for a consistent border width around all 4 edges
- Before:
  - first, `mInnerClipPathForBorderRadius` was used to draw the center of the View
  - then the border is drawn along the path of `mCenterDraw` with a stroke width of the border width
- Now:
  - `mBackgroundColorRenderPath` is used to draw the center of the View and is exactly a slightly enlarged version of `mInnerClipPathForBorderRadius`

__Case 2__: Uneven border widths are set (using borderTopWidth, borderLeftWidth, ...)
- Before:
  - `mInnerClipPathForBorderRadius` was used to draw the center of the View
  - for each edge, a quadrilateral is drawn
  - `mOuterClipPathForBorderRadius` clips the outer edge of the border
  - `mInnerClipPathForBorderRadius` (same is used to draw the center of the View) clips the inner edge of the border
- Now:
  - `mBackgroundColorRenderPath` is used to draw the center of the View, allowing `mInnerClipPathForBorderRadius` to persist as the path that clips the inner edge of the border

When `mGapBetweenPaths` = 0, `mBackgroundColorRenderPath` == `mInnerClipPathForBorderRadius`, which is exactly the original implementation

Changelog:
[Internal][Fixed] - rounded Views with borders shows small gap

Reviewed By: mdvacca

Differential Revision: D39979567

fbshipit-source-id: 6db71d14ead6256e1b7becf73862e0a537c6a47b
2022-11-10 19:09:51 -08:00
Joshua Selbo 0cae91489b Replace testing-support-lib with androidx target
Summary: Changelog: [Internal] - codemod testing library Buck redirect to actual dependency

Reviewed By: hick209

Differential Revision: D41194082

fbshipit-source-id: 5f4815613fda53a213feb78de2cf4430b7eef9c7
2022-11-10 13:06:19 -08:00
Oleksandr Melnykov 394486eec5 Bump OSS Android build to SDK 33 (#35196)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35196

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

Reviewed By: cortinico

Differential Revision: D41007003

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

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

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

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

## Changelog

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

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

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

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

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

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

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

Reviewed By: NickGerleman

Differential Revision: D39893863

Pulled By: blavalla

fbshipit-source-id: f6af78b1839ba7d97eca052bd258faae00cbd27b
2022-11-08 12:26:59 -08:00
generatedunixname89002005287564 22456038df supermodule:xplat/default/public.react_native.infra
Reviewed By: jkeljo

Differential Revision: D41113685

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

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

Reviewed By: javache

Differential Revision: D41069277

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

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

## Changelog

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

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

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

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

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

Reviewed By: NickGerleman

Differential Revision: D39894307

Pulled By: blavalla

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

Reviewed By: mdvacca

Differential Revision: D40778326

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

Reviewed By: cortinico

Differential Revision: D41029102

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

# What

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

# Why

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

## Changelog

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

Reviewed By: NickGerleman

Differential Revision: D40873390

fbshipit-source-id: c7bac6ae65f85666b8616443db278ebb175b691b
2022-11-07 07:40:21 -08:00
Michael Anthony Leon f0b7cbe22e Add perftest dev support manager
Summary:
This is the 2nd iteration of D39468561 (4d1a56813c). We first check if the `BridgeDevSupportManager` can be used before we return the `PerfTestDevSupportManager`. This is to avoid a breakage of Quantum that happened on the previous diff.

Add a `DevSupportManager` that can be used for performance testing. This `DevSupportManager` allows the inspector connection to be established, but leaves everything else disabled.

Previously, if Developer Support was enabled on a release build, the application would present an error as it unsuccessfully attempted to use the bridge dev support manager.

This is now conceptually the new flow for deciding what DevSupportManager to choose.

```
if (developerSupportEnabled) {
  if (full support available) {
    use full support (i.e. bridge)
  } else {
    use profiling-only support (i.e. perftest)
  }
} else {
  disable dev support
}
```

The first attempt at this diff erroneously used this logic:

```
if (developerSupportEnabled) {
  if (debug build) {
    use full support (i.e. bridge)
  } else {
    use profiling-only support (i.e. perftest)
  }
} else {
  disable dev support
}
```

So now we are always checking to see if the `BridgeDevSupportManager` is available, and if it is, we use it.

(`enableOnCrease` indicates the development mode setting: https://www.internalfb.com/code/fbsource/[6b8a941fdf2a0fd58d9db36f5a59fa5fb53ad2df]/xplat/js/react-native-github/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java?lines=259)

Changelog: [internal]

Reviewed By: makovkastar

Differential Revision: D40948243

fbshipit-source-id: 50c6b6b905f5b9c5b5ecc090b36edbd6090ea774
2022-11-04 14:47:19 -07:00
Lulu Wu f207cfddf3 Add atomic registerSegment method to test
Summary:
In the top js errors there are 2 mids related to segment fetching:
- requireForFacebook.js:unknownModuleError (https://www.internalfb.com/logview/details/facebook_android_javascripterrors/ba11461526aff8a6842401b35b02f5a4), 11.64 K vs. 524
- asyncRequire.js:verifySegment (https://www.internalfb.com/logview/details/facebook_android_javascripterrors/5452ba893b8d9ba8e97e070cf6976b65) 5.39 K vs. 180

Both errors will result in surface not loading.

A lot of traces have logs similar with the following:

```11-01 19:57:51.166 27735  7626 W fb4a.BridgelessReact: registerSegment(segmentId = "1090", path = "/data/data/com.facebook.katana/app_overtheair/resources/412137089/414433453/hbc-seg-1090__DELIM__main.jsbundle")
11-01 19:57:51.167 27735  7445 I ReactNativeJS: Module 39122 in segment 0 doesn not exist moduleDefiner
11-01 19:57:51.171 27735  7445 E ReactNativeJS: Error: Requiring unknown module "39122"., js build: 414433453
11-01 19:57:51.175 27735  7445 E ReactNativeJS: Error: Segment meta module is not setup properly. Details: segmentId = 1090, metaModule === undefined
11-01 19:57:51.175 27735  7445 E ReactNativeJS:
11-01 19:57:51.175 27735  7445 E ReactNativeJS: This error is located at:
```

RegisterSegment lives through 3 threads while in bridge there are only 2 threads involved (native & JS):
- Native thread, log printed (fb4a.BridgelessReact: registerSegment...)
- Background thread: no log, added in this diff (Finish registerSegment...)
- JS thread: logs not printed, should print logs here:

https://www.internalfb.com/code/fbsource/[60521987354ed1ef9a0d10bafc60db3c25302ab4]/xplat/ReactNative/venice/ReactInstance.cpp?lines=308-330

Since the JS thread logs aren't printed and there are segment errors right after calling registerSegemnt, I think registerSegment is not done. It could be caused by:
- ReactInstance being null, I added logs in background thread to verify (Finish registerSegment...) since dispatching to background thread relies on non-nullable ReactInstance.
- Work on JS thread hasn't been executed when trying to use/verify the segment. I added atomic method ```registerSegmentAtomic``` to make sure JS thread is blocked until segment is fully registered.

```registerSegmentAtomic``` will be tested behind gating added in D40917444.

Changelog:
[Android][Changed] - Add feature flag enableAtomicRegisterSegment

Reviewed By: RSNara

Differential Revision: D40921759

fbshipit-source-id: 84221aa81f0c549f931a4847b154187299639ef4
2022-11-02 21:01:53 -07:00
Nicola Corti 46de03a46a Fix test_buck by not using lambdas inside ReactImagePropertyTest (#35181)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35181

As the title says, this unblocks `test_buck` by removign the lambdas used inside test.

Changelog:
[Internal] [Changed] - Fix test_buck by not using lambdas inside ReactImagePropertyTest

Reviewed By: cipolleschi

Differential Revision: D40958412

fbshipit-source-id: 60b8609a25985230dfd6c4dcdf983dc2a8cfaf64
2022-11-02 16:02:53 -07:00
Pieter De Baets b5ea5a2c4d Fix WebSocketModule not closing connections on reload
Summary:
Saw in the logs an ever increasing number of warnings coming from WebSocketModule about requesting an instance that has already gone away.

On module invalidation we should close all outstanding websockets, as they will no longer be able to send events to JS.

Changelog: [Android][Fixed] On instance destroy, websockets are correctly closed

Reviewed By: mdvacca

Differential Revision: D40897255

fbshipit-source-id: 1578de8baa342479d14ee1070c3314d45c7fbd8d
2022-11-02 10:24:56 -07:00
Nicola Corti 0fd282f2cd Link against the app codegen if available (#35176)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35176

This commit extends the ReactNative-application.cmake logic so
that if the app is using codegen at the app level, the generate library
is properly built and linked.

It helps us simplify the RN Tester setup and makes it easier for app users
to use the codegen at the app level.

Changelog:
[Internal] [Changed] - [Android] Link against the app codegen if available

Reviewed By: cipolleschi

Differential Revision: D40936941

fbshipit-source-id: 26fa4d764fb369c987e94e0c3bce61841b982b27
2022-11-02 08:22:05 -07:00
Ramanpreet Nara 7964d484bc Introduce soft exceptions in the bridgeless core
Summary: Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D40824468

fbshipit-source-id: c840610e923c35cc5c36b37e5c580d0296c1e46b
2022-11-01 17:14:11 -07:00
Luna Wei cfe811ab18 Fix natively driven animated.event for bubbling PointerEvents
Summary:
Changelog: [Internal]

Override logic for determining whether a dispatched `Event` triggers a native `EventAnimationDriver`.

Natively driven AnimatedEvents on bubbling events is not supported.  `PointerEvents` requires this and this diff adds custom matching logic such that if a parent specifies an `AnimatedEvent` on `onPointerMove` and a child view dispatches it, the `AnimatedEvent` will still fire.

Reviewed By: javache

Differential Revision: D38722563

fbshipit-source-id: 7cde57eaff9584b33c6ab15f1fe85c0a9bac132e
2022-11-01 12:50:05 -07:00
Luna Wei 565a7439ac Refactor EventDriverAnimations to customize event match
Summary:
Changelog: [Internal] - Refactor match logic on determining whether to run an EventAnimationDriver (drivers for natively animated events) for an Event dispatched.

Previously, drivers were stored by key on the NativeAnimatedNodesManager (based on event handler and viewTag) and has been refactored to be stored in a list for easier matching.

This diff changes it so the match logic for running an EventAnimationDriver happens on the Event instance. This change is motivated by PointerEvents needing custom match logic (done on a following change).

Reviewed By: javache

Differential Revision: D40691002

fbshipit-source-id: e4f6742a2af3b751214aefa1fc069f65e8e71d77
2022-11-01 12:50:05 -07:00
Xin Chen 58a1cd2367 Add unit test for ImageView to take null uri in source
Summary:
This is a follow up action item from S295231 and T136039462 where we want to make sure null uri in image source is handled properly. This diff adds an unit test to make sure we are using transparent image when uri is null.

Changelog:
[Android][Internal] - Add unit test to ImageView for null uri in source

Reviewed By: javache

Differential Revision: D40732791

fbshipit-source-id: fd468bfe7c33a4f3f8913ead3e84a1770d7c907f
2022-11-01 12:11:10 -07:00
Oleksandr Melnykov 1e6945e19e Back out "Add perftest dev support manager"
Summary: Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D40879099

fbshipit-source-id: ff302819829aa21a1dd7c19c06ed8c29821ba815
2022-10-31 23:01:40 -07:00
Ruslan Lesiutin 5738fe6426 refactor(AsyncStorage): move android files from react-native-github
Summary:
## Changelog:
[Android] [Removed] - Removed AsyncStorage module

Reviewed By: lunaleaps

Differential Revision: D40175995

fbshipit-source-id: b583579b8c2fa6c502f265ffe464b81672bd7da5
2022-10-31 14:39:19 -07:00
Nicola Corti 3dc7b37cf7 Sort parameters in DefaultNewArchitectureEntryPoint (#35115)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35115

When looking at the new entry point I've realized we have the dynamicLibraryName as first parameter.
As this API is not released yet, let's move it as last.

So users on Java can easily call DefaultNewArchitectureEntryPoint.load(true, true, true)
while now they will have to call DefaultNewArchitectureEntryPoint.load("...", true, true, true)

Users in Kotlin won't be affected by this.

Changelog:
[Internal] [Changed] - Sort parameters in DefaultNewArchitectureEntryPoint

Reviewed By: cipolleschi

Differential Revision: D40793370

fbshipit-source-id: 9dc1569d76a1479a738f8e0f41a4183d7c04538f
2022-10-28 04:22:22 -07:00
Nicola Corti 2097278d2a Update the template to load the correct JS engine at runtime. (#35095)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35095

This change will make sure that we load the correct JS engine at runtime,
by using the BuildConfig flag that RNGP sets for us.

This will solve a lot of noise in adb logcat for users seeing
stacktraces mentioning failing to load `jscexecutor` library.

This is also a breaking change, but as the API was not widely used nor
advertised in the template, we should be fine by just mentioning this in the release notes.

Changelog:
[Android] [Changed] - Update the template to load the correct JS engine at runtime

Reviewed By: cipolleschi

Differential Revision: D40710597

fbshipit-source-id: d59a7a52b22a9bf273ea89094c6620c3ecf6eb00
2022-10-27 04:47:25 -07:00
Nicola Corti 1069841837 Make it easier for user to toggle only Fabric or TurboModules in New Architecture (#35091)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35091

This diff refines the DefaultNewArchitectureEntryPoint to make it easier for user to
either turn on Fabric, TurboModules or both.

Changelog:
[Internal] [Changed] - Make it easier for user to toggle only Fabric or TurboModules in New Architecture

Reviewed By: cipolleschi

Differential Revision: D40710596

fbshipit-source-id: 236060b2ebccb1bf25e7f5c0fc15f54c5ce5f608
2022-10-26 13:03:33 -07:00
Nick Gerleman 51d14b9dbd Revert D40333083: Support persisted settings in Android + iOS
Differential Revision:
D40333083 (0fac9817df)

Original commit changeset: f3816e3bd7de

Original Phabricator Diff: D40333083 (0fac9817df)

fbshipit-source-id: 1a52a06b057c4c0ea6e3e4c3315ba73a883e3579
2022-10-26 12:28:44 -07:00
Robert Balicki 0fac9817df Support persisted settings in Android + iOS (#34964)
Summary:
* Add a DevToolsSettingsManager, which has android and iOS variants, which uses a new TM (Android) or takes advantage of the Settings TM (iOS) to get/set console patch settings
* This is backed by either the existing Settings module (iOS) or a new Java TM, which uses the SharedPreferences AP

## Testing

Manual testing

## Changelog

[General] [Added] - Add DevToolsSettingsManager

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

Test Plan: * Extensive manual testing

Reviewed By: NickGerleman

Differential Revision: D40333083

Pulled By: rbalicki2

fbshipit-source-id: f3816e3bd7dea3086f6f2269c3a099af14aebb3b
2022-10-25 21:01:25 -07:00
Nicola Corti c96c76eb91 Update the template to use RNGP (#35075)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35075

This diff updates the New App template for Android to use the React Native Gradle Plugin.
With this we can:
1. Get rid of all the C++ code.
2. Remove a lot of New Architecture logic in the build.gradle
3. Reuse the prebuilts of React Native/Hermes via prefab

Changelog:
[Android] [Changed] - Update the template to use RNGP

Reviewed By: cipolleschi

Differential Revision: D40673732

fbshipit-source-id: 70935248993d1e24904c982e75f12ad580faa9d8
2022-10-25 13:13:14 -07:00
Nicola Corti 6a3bfa7a62 Bump NDK to 23 and fbjni to 0.3.0 (#35066)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35066

This just bumps the NDK version used inside the template to be 23.
We can't merge this as it is but we have to wait for a bump of the Docker image for Android.

Changelog:
[Android] [Changed] - Bump NDK to 23

allow-large-files

Reviewed By: cipolleschi

Differential Revision: D40637103

fbshipit-source-id: e637140cbe6052e94a6efedf12f4b5b81b90a7eb
2022-10-25 02:31:10 -07:00
Riccardo Cipolleschi c63882238b Back out "add oncall annotation for BUCK files in xplat based on supermodule information - /home/s2shi/tmp/xplat_buck_oncall/xplat_buck_2nd_batch00" (#35065)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35065

Original commit changeset: ac76ea701e3d

Original Phabricator Diff: D40611860 (860b4d9144)

Open source is using BUCK 1 which does not seem to have the `oncall` directive.

Backing it out because it is breaking the external CI.

## Changelog
[internal]

Reviewed By: cortinico

Differential Revision: D40637084

fbshipit-source-id: 2be7296f859412210afe981adf500ab6540f7ee8
2022-10-24 10:44:39 -07:00
Riccardo Cipolleschi 52d37aa403 Back out "add oncall annotation for BUCK files in xplat based on supermodule information - /home/s2shi/tmp/xplat_buck_oncall/xplat_buck_batch10" (#35064)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/35064

Original commit changeset: 0fb0db845c04

Original Phabricator Diff: D40610875 (d941940b4c)

Open source is using BUCK 1 which does not seem to have the `oncall` directive.

Backing it out because it is breaking the external CI.

## Changelog
[internal]

Reviewed By: cortinico

Differential Revision: D40635873

fbshipit-source-id: 79ebd4db0972520fcca6ccb8c1725657a8ef7949
2022-10-24 10:44:39 -07:00
Jonathan Keljo e69e6f4014 supermodule:xplat/default/public.react_native.infra
Reviewed By: javache

Differential Revision: D40376280

fbshipit-source-id: d76e692fd8a571614729d0fb15ebde8895d3de28
2022-10-23 15:55:13 -07:00