Commit Graph

5629 Commits

Author SHA1 Message Date
Pieter De Baets 2afcea2b91 Track observed pointer-events using a single bitset
Summary:
Noticed that we were using a different tag for each pointer event observed (and that weren't clearing these properly when recyling views).

Each of these tags is a hashmap entry and a boxed boolean, so we can do much better by just using a single (boxed) integer.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D40077519

fbshipit-source-id: 130e78c3641eaedfa8787644b98763fd4367bc27
2022-10-07 04:44:48 -07:00
Nicola Corti 73bcedb903 Expose rrc_image to consuming builds
Summary:
This change will expose the rrc_image module to be consumed via Prefab by user projects. This is needed as part of a change of the codegen to support custom states.

Changelog:
[Internal] [Changed] - Expose rrc_image to consuming build

Reviewed By: cipolleschi

Differential Revision: D40098541

fbshipit-source-id: 2e07d8b19f53ba93920009603c95a43b01f131eb
2022-10-06 16:41:46 -07:00
Nicola Corti e13aaaa9a4 Expose react_render_imagemanager to consuming builds
Summary:
This change will expose the `react_render_imagemanager` module to be consumed via Prefab by user projects. This is needed as part of a change of the codegen to support custom states.

Changelog:
[Internal] [Changed] - Expose react_render_imagemanager to consuming build

Reviewed By: cipolleschi

Differential Revision: D40022929

fbshipit-source-id: ece47503b11a641067ae6db82f1d69b244c9c5be
2022-10-06 16:41:46 -07:00
David Vacca 9a44e5bdd8 Create documentation to write C++ ViewManagers in React AR apps
Summary:
Create documentation to write C++ ViewManagers in React AR apps

changelog: [internal] internal

Differential Revision: D40119174

fbshipit-source-id: edce0e6b226a30007c39f924b5896fa2267e98b7
2022-10-06 16:15:04 -07:00
Nicola Corti c9e6a6056d Hide the C++/Cmake configuration from user space inside the framework
Summary:
This change encapsulates all the NDK configuration logic inside the React Native
Gradle Plugin. The changes are additive so that the user can still specify a
custom configuration if they wish.

So far I've applied the changes to RN Tester. Changes to the template require a
bump of the Gradle Plugin NPM package.

Changelog:
[Android] [Changed] - Hide the C++/Cmake configuration from user space inside the framework

Reviewed By: cipolleschi

Differential Revision: D40139557

fbshipit-source-id: 013220695791e3d0d458e118de16953e0545c3de
2022-10-06 06:40:22 -07:00
Joshua Selbo 87acdfb436 Remove androidx args on library wrappers
Summary:
Changelog:
[Internal][Removed] - Remove legacy AndroidX arguments on buck targets

Differential Revision: D39835294

fbshipit-source-id: dbbdd7546d60c459b7f9184654dad7a8d5a196e8
2022-10-05 13:49:48 -07:00
Ruslan Shestopalyuk aa5d43fe54 Merge enablePropIteratorSetter flags into a single one in CoreFeatures (#34869)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34869

Changelog: [Internal]

This merges all instances of `enablePropIteratorSetter` into a single one.

Both `AccesibilityProps` and `BaseTextProps` had their own instances if it, which is now redundant.

Reviewed By: cipolleschi

Differential Revision: D40062555

fbshipit-source-id: b6ccf5a9538612dd731a6f9c4eaceeebcb6d95be
2022-10-05 05:09:37 -07:00
Pieter De Baets bed977b178 Reset View tag when recycling
Summary:
Automation tests were hitting issues with view recycling enabled because we use the main tag field to lookup views, and not properly resetting it when recycling.

Changelog: [Internal]

Reviewed By: jehartzog

Differential Revision: D40076594

fbshipit-source-id: 5f518b979a23562f7e7fc8271488678e78f50e91
2022-10-05 04:23:26 -07:00
Lorenzo Sciandra 232e4474e6 chore: re-align version to be 1000.0.0 on main everywhere (#34817)
Summary:
While working on https://github.com/facebook/react-native/pull/34513 I noticed that on main branch the versioning is not really consistent everywhere. So this PR is an attempt at realigning so that on the main branch, RN is 1000.0.0 everywhere - in a way, it's cleaning up the room for the monorepo work to go flawlessly).

It's just a pass of `node scripts/set-rn-version.js --to-version 1000.0.0`.

There's the small chance that some versions where kept to 0.0.0 on purpose (build tools are weird), so we might just have to close this off. No big deal :)

## Changelog

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

[Internal] [Changed] -  re-align version to be 1000.0.0 on main everywhere

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

Test Plan: CI is green and when imported, nothing breaks.

Reviewed By: cortinico

Differential Revision: D39926953

Pulled By: cortinico

fbshipit-source-id: ff66530382f891e17c00b35edf97c03591b6a9a8
2022-10-04 08:36:21 -07:00
Nicola Corti 06df917071 Propagate common flag to autolinked libraries (#34853)
Summary:
I'm handling this TODO i left to unbreak the CI.
We need to make sure all the autolinked libraries are getting the folly flags and other common flags propagated correctly.

## Changelog

[Internal] [Change] - Propagate common flag to autolinked libraries

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

Test Plan: Will rely on a green CI

Reviewed By: cipolleschi

Differential Revision: D40055134

Pulled By: cortinico

fbshipit-source-id: fb9afab954ab402f6a3ab417aba934035580f936
2022-10-04 04:18:53 -07:00
Nicola Corti 0b4417b43f Cleanup the template after prefab support (#34843)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34843

We can now remove a lot of unnecessary code to copy .so
files around as they're consumed via prefab from :ReactAndroid

Changelog:
[Android] [Changed] - Cleanup the Android template after prefab support

Reviewed By: cipolleschi

Differential Revision: D40014642

fbshipit-source-id: 00e69ea62bdb4882b40b8b6f19cdf80235c847b5
2022-10-04 03:27:07 -07:00
Nicola Corti 6d6d455618 Consume fbjni via Prefab (#34831)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34831

Historically we had to download an unzip the fbjni Android Archive to use it.
Here I'm updating the way how we consume to use prefab so we can remove a lot
of unnecessary configuration, also from the app template.

Changelog:
[Internal] [Changed] - Consume fbjni via Prefab

Reviewed By: cipolleschi

Differential Revision: D39964574

fbshipit-source-id: 1b18682c2b36aabb1fc1a3819ca09e575182eae4
2022-10-04 02:54:49 -07:00
Ruslan Shestopalyuk 9864586b21 Factor out feature flags for RN Fabric core
Summary:
A follow up to D38708718 (https://github.com/facebook/react-native/commit/403fea25f65a38f4b4d8e0edcf89741b29e62059) review, this factors feature flags for Fabric core code into a separate file, `CoreFeatures`.

Keeping them together is arguably better for maintenance and makes code easier to reason about.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D40007784

fbshipit-source-id: 1885d5d6200575c6015f063d8b05813b18b47ffb
2022-10-03 05:38:31 -07:00
Anandraj Govindan 9d08d55bbe Use NMake generator for Hermes build on Windows (#34790)
Summary:
CMake on Windows uses "Visual Studio **" generators are [multi-configuration](https://cgold.readthedocs.io/en/latest/glossary/multi-config.html),

which requires the hermes cli and hermes runtime build flavors to be compatible. Using the "MakeFile" generator will avoid the requirement and keeps the gradle script simpler. Please note that the "Makefile" generator is the default when only "Visual Studio Community edition" with default packages is available.

Use NMake generator for Hermes build on Windows

## Changelog
CMake on Windows uses "Visual Studio **" generators are [multi-configuration](https://cgold.readthedocs.io/en/latest/glossary/multi-config.html),

which requires the hermes cli and hermes runtime build flavors to be compatible. Using the "MakeFile" generator will avoid the requirement and keeps the gradle script simpler. Please note that the "Makefile" generator is the default when only "Visual Studio Community edition"  with default packages  is available.

[Android] [Fixed] - Use NMake generator for Hermes build on Windows

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

Test Plan: Verified that RN build on Windows with multiple SKUs of Visual studio.d

Reviewed By: cortinico

Differential Revision: D39889332

Pulled By: cortinico

fbshipit-source-id: f2d39d981e7c58c8cb93a4322155c844cb6bded3
2022-10-03 05:09:20 -07:00
Anandraj Govindan 85c0c0f21f Fixing failure building RN codegen CLI on Windows (#34791)
Summary:
Ensuring the file paths uses forward slashes as separator to avoid the characters from being interpreted as ASCII escape characters.

## Changelog

Fixing build failure building RN codegen CLI on Windows. Ensuring the file paths uses forward slashes as separator to avoid the characters from being interpreted as ASCII escape characters.

[Android] [Fixed] - Fixing failure building RN codegen CLI on Windows

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

Test Plan: Ensured RN main branch builds on Windows with new architecture turned on.

Reviewed By: cipolleschi

Differential Revision: D39889468

Pulled By: cipolleschi

fbshipit-source-id: 7d79eac9f433908cc86dd7ca2eec841739ef6365
2022-10-03 04:56:32 -07:00
Pieter De Baets b9e9e852a6 Check for active catalyst instance when using RNLog
Summary:
Works around a crash identified by Sapienz in D39852058 (https://github.com/facebook/react-native/commit/30411ae1a42e46d0e5a2da494a39ed2767ba8808)

These logs will still be logged to the console, as they were before

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D39968830

fbshipit-source-id: 5d7a5d935e85a7d67e7780d95b2253e50888ad90
2022-10-03 04:13:53 -07:00
Ruslan Shestopalyuk 110b191b14 Refactor ViewPropsMapBuffer -> general MapBuffer props mechanism
Summary:
Previously, ViewPropsMapBuffer conversions were hardcoded deep in Android infrastructrue. I've generalized this into a different mechanism to allow any Props struct to support MapBuffer props.

There are still some things that need to be cleaned up and this should be treated as experimental. One thing we likely want to do is remove the hardcoded IDs (fine for codegen'd code; less so for handwritten) and use compile-time-hashed IDs instead with human-readable string names.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D38708719

fbshipit-source-id: 64603dee7f21828be31346c555d99862dab304ea
2022-10-03 04:11:02 -07:00
Ruslan Shestopalyuk 403fea25f6 Refactor MapBuffer experimental setup: use one config for all Props, with a Trait to indicate support
Summary:
Instead of having a special flag just for View MapBuffer props, we now use one flag to indicate that MapBuffer should be used for all props; each XShadowNode must set a special trait indicating if that ShadowNode supports MapBuffer props.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D38708718

fbshipit-source-id: b398ec62a0db9c0ff23c0007c5503cf2838c4173
2022-10-02 02:46:25 -07:00
Nicola Corti 98aa66a646 Fix broken template tests due to missing boost headers (#34829)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34829

I realized there is a race condition in how prefab headers are prepared and bundled. If the download of boost is not 'fast enough' the headers will be missing during prefab preparation.
This fixes it.

Changelog:
[Internal] [Changed] - Fix broken template tests due to missing boost headers

Reviewed By: cipolleschi

Differential Revision: D39968622

fbshipit-source-id: 4680f84c15f4443a16def45d41a10a1083f4f196
2022-09-30 14:25:41 -07:00
Nicola Corti 30371904c1 Unblock template jobs on main due to accidental PRIVATE linking
Summary:
I accidentally broke `main` as I added a PRIVATE link for external libraries.
I need to get back to this, but for the meantime I'm disabling this linking
to make the CI green.

Changelog:
[Internal] [Fixed] - Unblock template jobs on main due to accidental PRIVATE linking

Reviewed By: cipolleschi

Differential Revision: D39932205

fbshipit-source-id: 5acbf567e0c194224a01141273665a293ead8e32
2022-09-30 01:37:48 -07:00
Nick Gerleman 87e7912b95 Add YGGutter Enum
Summary:
This adds the YGGutter enum, used to choose between row/column gap variants (row-gap, column-gap, gap).

This used later in changes from https://github.com/facebook/yoga/pull/1116, in the APIs which deal with setting gap on style on yoga node.

Note the original PR called this `YGGap`, but this ending up leading to a couple public method signatures that could appear ambiguous:
1. `SetGap(YGGap gap, float gapLength)`: Enums like `YGAlign` are the vaues for an `align` prop. `YGGap` controls the variant of the gap (like `YGEdge` does for left/right/top/bottom variants). So the enum reads as if it is the `gapValue`, and it looks like we have two of the same parameter.
2. `SetGap(YGGap gapDirection, float gap)`: This is misleading, because the direction gaps flow is the cross-axis of flex-direction.
3. `GetGap(YGGap gap)`: `gap` is the variant, but looks like an out param.

The [CSS Box Alignment](https://www.w3.org/TR/css-align-3/#column-row-gap) spec refers to these gaps as "Gutters", which removes the ambiguity.

Changelog:
[General][Added] - Add YGGutter Enum

Reviewed By: yungsters

Differential Revision: D39922412

fbshipit-source-id: 4b0baf800fecb3d03560a4267c7fb4c4330fd39e
2022-09-29 22:25:24 -07:00
Nick Gerleman 5f9689a0d0 Fixup Enum Generator
Summary:
https://github.com/facebook/yoga/pull/1116 adds a new enum. The enum generator is out of date with copyright header, and some codemods, but it also looks like there were manual changes, types added, etc since generation. I fixed up the script to incorporate generating the changes folks made manually, and also added an enum that was previously only added manually to the C ABI.

Changelog:
[General][Fixed] - Fixup Yoga Enum Generator

Reviewed By: yungsters

Differential Revision: D39922252

fbshipit-source-id: b678fa9a43a896873d8c434745bdaf3f16fd991f
2022-09-29 22:25:24 -07:00
Christopher Jones 30411ae1a4 Replace Toast with Log.w on ReactImageView when null URL specified (#34819)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34819

This is crashing on A12 because of using the regular Context instead of the application context. That said, this probably makes more sense as a log warning.

Reviewed By: javache

Differential Revision: D39852058

fbshipit-source-id: 1ac93f8cc9ecdb14f60baca175c8ecff2ff42ac0
2022-09-29 11:21:10 -07:00
Nicola Corti 9f930e2572 Move react_nativemodule_core to be consumed via prefab
Summary:
This removes the old way of consuming `libreact_nativemodule_core.so` from
`Android-prebuilt.cmake` to using Prefab which is natively supported
by the Android pipeline.

This is the last mode that we'll have to handle the prefab for.
I'll do the cleanup just after this change landed.

Changelog:
[Internal] [Changed] - Move `react_nativemodule_core` to be consumed via prefab

Reviewed By: cipolleschi

Differential Revision: D39929261

fbshipit-source-id: 61669da2cfd0545160a2a4c596c8e4adb22303ec
2022-09-29 09:45:15 -07:00
Nicola Corti 427ce5f2d2 Expose folly flags and make folly_runtime available to be consumed via prefab
Summary:
This removes the old way of consuming `libfolly_runtime.so` from
`Android-prebuilt.cmake` to using Prefab which is natively supported
by the Android pipeline.

Moreover, I've exposed a `folly-flags.cmake` file which can be used by libraries
to know which lists of flags they need to use for Folly.

Changelog:
[Internal] [Changed] - Move `folly_runtime` to be consumed via prefab

Reviewed By: cipolleschi

Differential Revision: D39928571

fbshipit-source-id: 4864c37813ec681a6a464c97de6dfc078f5553f1
2022-09-29 07:44:56 -07:00
Nicola Corti 4a336f0637 Move yoga to be consumed via prefab
Summary:
This removes the old way of consuming `libyoga.so` from
`Android-prebuilt.cmake` to using Prefab which is natively supported
by the Android pipeline.

Changelog:
[Internal] [Changed] - Move `yoga` to be consumed via prefab

Reviewed By: cipolleschi

Differential Revision: D39927496

fbshipit-source-id: f7ab2a3aab3cb42effa648dfeff6711d183260e4
2022-09-29 07:08:21 -07:00
Nicola Corti 8717d2d672 Move react_renderer_mapbuffer to be consumed via prefab
Summary:
This removes the old way of consuming `libreact_renderer_mapbuffer.so` from
`Android-prebuilt.cmake` to using Prefab which is natively supported
by the Android pipeline.

Changelog:
[Internal] [Changed] - Move `react_renderer_mapbuffer` to be consumed via prefab

Reviewed By: cipolleschi

Differential Revision: D39927266

fbshipit-source-id: e82c2bda02c85a2a6747b92a3f20f2a5118bda65
2022-09-29 07:08:21 -07:00
Nicola Corti f37b3bc052 Move fabricjni to be consumed via prefab
Summary:
This removes the old way of consuming `libfabricjni.so` from
`Android-prebuilt.cmake` to using Prefab which is natively supported
by the Android pipeline.

Changelog:
[Internal] [Changed] - Move `fabricjni` to be consumed via prefab

Reviewed By: cipolleschi

Differential Revision: D39927210

fbshipit-source-id: dbd8814a6cad38d09484561120df911ab24b5f8a
2022-09-29 07:08:21 -07:00
Nicola Corti 3e5b9d4f5e Move glog to be consumed via prefab
Summary:
This removes the old way of consuming `libglog.so` from
`Android-prebuilt.cmake` to using Prefab which is natively supported
by the Android pipeline.

Changelog:
[Internal] [Changed] - Move `glog` to be consumed via prefab

Reviewed By: cipolleschi

Differential Revision: D39927147

fbshipit-source-id: 99f0241da1dece0efc8d928c3d25f30f3fa48a09
2022-09-29 07:08:21 -07:00
Nicola Corti 277a64f03e Move jsi to be consumed via prefab
Summary:
This removes the old way of consuming `libjsi.so` from
`Android-prebuilt.cmake` to using Prefab which is natively supported
by the Android pipeline.

Changelog:
[Internal] [Changed] - Move `jsi` to be consumed via prefab

Reviewed By: cipolleschi

Differential Revision: D39924434

fbshipit-source-id: cb92d3a4ed6cb87e75462082506f310feb7bec9f
2022-09-29 04:39:37 -07:00
Nicola Corti 7c55e6cd7e Move rrc_view to be consumed via prefab
Summary:
This removes the old way of consuming `librrc_view.so` from
`Android-prebuilt.cmake` to using Prefab which is natively supported
by the Android pipeline.

Changelog:
[Internal] [Changed] - Move `rrc_view` to be consumed via prefab

Reviewed By: cipolleschi

Differential Revision: D39924231

fbshipit-source-id: 231809631f807ea2ea40d2581759f391adfba94d
2022-09-29 04:39:37 -07:00
Nicola Corti 93bb05afd4 Move react_render_graphics to be consumed via prefab
Summary:
This removes the old way of consuming `libreact_render_graphics.so` from
`Android-prebuilt.cmake` to using Prefab which is natively supported
by the Android pipeline.

Changelog:
[Internal] [Changed] - Move `react_render_graphics` to be consumed via prefab

Reviewed By: cipolleschi

Differential Revision: D39923620

fbshipit-source-id: 9edb6557b4d195e1703b1ae532ca14126930a43a
2022-09-29 04:39:37 -07:00
Nicola Corti 6ebc89f09c Move react_render_core to be consumed via prefab
Summary:
This removes the old way of consuming `libreact_render_core.so` from
`Android-prebuilt.cmake` to using Prefab which is natively supported
by the Android pipeline.

Changelog:
[Internal] [Changed] - Move `react_render_core` to be consumed via prefab

Reviewed By: cipolleschi

Differential Revision: D39923551

fbshipit-source-id: b800d4369f0de8edbc68b11d9efecf2cb5ea68c1
2022-09-29 04:39:37 -07:00
Nicola Corti 268a4cb268 Move react_newarchdefaults to be consumed via prefab
Summary:
This removes the old way of consuming `react_newarchdefaults.so` from
`Android-prebuilt.cmake` to using Prefab which is natively supported
by the Android pipeline.

Changelog:
[Internal] [Changed] - Move `react_newarchdefaults` to be consumed via prefab

Reviewed By: cipolleschi

Differential Revision: D39857115

fbshipit-source-id: 194a75b530b21e593b0390565a3b91155e07f17e
2022-09-29 02:53:10 -07:00
Nicola Corti 527cc34267 Move react_render_componentregistry to be consumed via prefab
Summary:
This removes the old way of consuming `libreact_render_componentregistry.so` from
`Android-prebuilt.cmake` to using Prefab which is natively supported
by the Android pipeline.

Changelog:
[Internal] [Changed] - Move `react_render_componentregistry` to be consumed via prefab

Reviewed By: cipolleschi

Differential Revision: D39856487

fbshipit-source-id: 98006054481a5635ee3241e3281455cd934eca08
2022-09-28 12:58:21 -07:00
Nicola Corti 86fcab613f Move react_debug to be consumed via prefab
Summary:
This removes the old way of consuming `react_debug.so` from
`Android-prebuilt.cmake` to using Prefab which is natively supported
by the Android pipeline.

Changelog:
[Internal] [Changed] - Move `react_debug` to be consumed via prefab

Reviewed By: cipolleschi

Differential Revision: D39889945

fbshipit-source-id: e31f3c3027718a54c0a7228db00d145c1f3f7873
2022-09-28 12:18:18 -07:00
Nicola Corti 278dad6438 Move react_codegen_rncore to be consumed via prefab
Summary:
This removes the old way of consuming `react_codegen_rncore` from
`Android-prebuilt.cmake` to using Prefab which is natively supported
by the Android pipeline.

Changelog:
[Internal] [Changed] - Move `react_codegen_rncore` to be consumed via prefab

Reviewed By: cipolleschi

Differential Revision: D39855726

fbshipit-source-id: a8ee00ea31422a20832909b9d7e5a8123cf88c84
2022-09-28 08:32:03 -07:00
Nicola Corti 83048da5b8 Move runtimeexecutor to be consumed via prefab
Summary:
This removes the old way of consuming `runtimeexecutor` from
`Android-prebuilt.cmake` to using Prefab which is natively supported
by the Android pipeline.

Changelog:
[Internal] [Changed] - Move `runtimeexecutor` to be consumed via prefab

Reviewed By: cipolleschi

Differential Revision: D39852978

fbshipit-source-id: 87795118f1bcf496a3c50791f920d8b230932555
2022-09-28 08:32:03 -07:00
Nicola Corti 4bcb0ab762 Move turbomodulejsijni to be consumed via prefab
Summary:
This removes the old way of consuming `turbomodulejsijni.so` from
`Android-prebuilt.cmake` to using Prefab which is natively supported
by the Android pipeline.

Changelog:
[Internal] [Changed] - Move `turbomodulejsijni` to be consumed via prefab

Reviewed By: cipolleschi

Differential Revision: D39851647

fbshipit-source-id: 6201546ad47a53b366a54b022457fce7b744f064
2022-09-28 08:32:03 -07:00
Nicola Corti 49b14cc603 Move react_render_debug to be consumed via prefab (#34802)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34802

This removes the old way of consuming `libreact_render_debug.so` from
`Android-prebuilt.cmake` to using Prefab which is natively supported
by the Android pipeline.

Changelog:
[Internal] [Changed] - Move `react_render_debug` to be consumed via prefab

Reviewed By: cipolleschi

Differential Revision: D39849622

fbshipit-source-id: 45451dfe92ecce94d1b466094baae05a75ed803f
2022-09-27 09:30:50 -07:00
Rachit Mishra 3f3394a566 fix: handle webview provider missing exception (#34456)
Summary:
The [existing fix](https://github.com/facebook/react-native/blob/fb936dfffb3ca2d9bc0969dfe36a70bdf66783e0/ReactAndroid/src/main/java/com/facebook/react/modules/network/ForwardingCookieHandler.java#L151) to handle missing WebView provider uses string comparison based checks to handle the exception gracefully, or otherwise simply throw the exception. This ends up crashing the app for the end user.

<img width="1319" alt="Screenshot 2022-08-19 at 4 33 31 PM" src="https://user-images.githubusercontent.com/933314/185605137-24757dad-806e-4cca-b000-7d6ce2d191e1.png">

Fatal exceptions are bad in any case and not good user experience, we can gracefully handle this by [returning](https://github.com/facebook/react-native/compare/main...rachitmishra:react-native-1:patch-2#diff-f7ca1976002c4612051e4949395e64511b6f769e347c488e9a0d15cb5331fe76R141) `null` for all cases when WebView provider is not found.

## 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] - Gracefully handle crash if no WebView provider is found on the device

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

Test Plan: IMO no testing is required as we were already returning null in certain cases after handling the exception message, also `ForwardingCookieManager::getCookieManager` is already marked `Nullable` so we are safe there.

Reviewed By: lunaleaps

Differential Revision: D39809020

Pulled By: cortinico

fbshipit-source-id: 54b290ad7740859bdc84401904236c32761a4631
2022-09-26 13:30:14 -07:00
Nicola Corti bf55a3a392 Make sure ccache is considered as part of the CMake build
Summary:
I've just realized that CMake is ignoring `ccache`, even if you have it
installed. This is the necessary change needed to verify if the user
has `ccache` installed and eventually use it.

While not a necessary change for Prefab supprot, this is a nice to have
that I've discovered while working on it.

Changelog:
[Internal] [Changed] - Make sure ccache is considered as part of the CMake build

Reviewed By: cipolleschi

Differential Revision: D39815089

fbshipit-source-id: be62e5fe98954593fd907ec21c41950a967cff04
2022-09-26 08:48:04 -07:00
Paige Sun 9a253d1864 Back out "Back out "[Venice][iOS] Fix: Install Fabric UIManager before main bundle execution""
Summary:
Changelog: [Internal][Bridgeless][iOS]

# Before diff
Be in Venice > run Metro > run FBiOS > navigate to any RN surface.

 `UIManagerBinding createAndInstallIfNeeded` happens After `ReactInstance loadScript -> evaluateJavaScript`: install Fabric UIManager before main bundle execution

Reviewed By: RSNara

Differential Revision: D39760231

fbshipit-source-id: f17bf02e9b1fb0f9b0ff24c86aa6dc9349c42192
2022-09-23 17:32:49 -07:00
Rubén Norte 30fe6b341b Restore flags to disable Fabric background executor
Summary:
We want to fix the order of execution of layout, layout effects and passive effects in React Native, but the use of the Fabric background executor for layout complicates this (and other things).

This brings back a flag to disable this background thread to do layout synchronously in JavaScript, before the execution of layout effects and passive effects.

This is expected to regress performance on some screens, so we need to address the antipatterns in those screens before shipping this.

Changelog: [internal]

Reviewed By: javache

Differential Revision: D39727131

fbshipit-source-id: 4323b089234d3304ca3bfe5697668fb44ac64c12
2022-09-23 05:51:36 -07:00
Riccardo Cipolleschi b7add0aadb Always generate an EmptyNativeState (#34754)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34754

This Diff is the second step of enabling the CodeGen to parse and generate a NativeState for the components.

The feature has been largely requested by the OSS community but it could be also helpful for people in Meta.

## Changelog
[General][Added] - Always generate an empty NativeState for Fabric Components

Reviewed By: cortinico

Differential Revision: D39696435

fbshipit-source-id: e24768af78f59696c0b4db009e8065bb5c89316b
2022-09-22 06:41:44 -07:00
Samuel Susla 15dbd9121d Back out "Fix: Install Fabric UIManager before main bundle execution"
Summary:
Original commit changeset: 4491d6de1109

Original Phabricator Diff: D39493654 (https://github.com/facebook/react-native/commit/447be629091579b8656e1b10e365f3429a61bbf3)

changelog: [internal]

Reviewed By: javache

Differential Revision: D39727129

fbshipit-source-id: 412a7fc5e4bf8db26cde7d420e71cf1f314cdc93
2022-09-22 06:36:59 -07:00
Kudo Chien 3d7e1380b4 Fix port as -1 if dev server without specifying port on Android (#34705)
Summary:
when specifying dev server without port, e.g. http://www.example.com/, there are some issues.

1. redbox error
<img src="https://user-images.githubusercontent.com/46429/190540390-8ee420f2-7642-427b-9f2e-e0c6d31015f8.png" width="30%">

2. showing -1 in loading view

<img src="https://user-images.githubusercontent.com/46429/190540727-158f35ad-359f-443a-a4b0-768dd2f7e400.png" width="50%">

the root cause is coming from [`java.net.URL.getPort()` will return -1 when the url doesn't have a port](https://developer.android.com/reference/java/net/URL#getPort()). this pr replaces the parser to [`okhttp3.HttpUrl`](https://square.github.io/okhttp/4.x/okhttp/okhttp3/-http-url/#port) that it will have default port 80 for http or port 443 for https. the two call paths should only serve http/https address, not file:// address. it should be safe to change from java.net.URL to okhttp3.HttpUrl.

not fully related, in the case above, android will connect to `ws://www.example.com/:8097` for react-devtools
we should strip the trailing slash in *setUpReactDevTools.js*

## Changelog

[Android] [Fixed] - Fix port as -1 if dev server without specifying port on Android

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

Test Plan:
test on rn-tester with the following steps

1. `yarn start`
2. open another terminal and run `ngrok http 8081` and it will return a tunnel url, e.g. `71a1-114-36-194-97.jp.ngrok.io`
3. open dev setting in app and change the dev server to `71a1-114-36-194-97.jp.ngrok.io`
5. reload the app

Reviewed By: cipolleschi

Differential Revision: D39573988

Pulled By: cortinico

fbshipit-source-id: 397df90ab30533207bd87a3f069132d97c22c7fd
2022-09-22 04:20:44 -07:00
Nicola Corti 596111fabf Cleanup of ReactAndroid/build.gradle after AGP 7.3.x bump (#34747)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34747

Just a minor cleanup after the AGP bump.

Changelog:
[Internal] [Changed] - Cleanup of ReactAndroid/build.gradle after AGP 7.3.x bump

Reviewed By: cipolleschi

Differential Revision: D39687286

fbshipit-source-id: 441e449b51b25e4152cf1e7e7e22c7c9f1432d05
2022-09-21 04:28:34 -07:00
Luna Wei bcb58089c4 Create PointerEventState
Summary: Changelog: [Internal] - A refactor to pass the object PointerEventState containing relevant state / and also properties for pointerEvent objects

Reviewed By: vincentriemer

Differential Revision: D39626285

fbshipit-source-id: e2ff5313ef03d7d2d36c35ca459950ec07650df2
2022-09-20 12:01:07 -07:00
Luna Wei 4ca089f94c Simplify Coalescing Key
Summary:
Changelog: [Internal]
Stop using `TouchEventCoalescingKeyHelper` for tracking and stop making the distinction between traditional touch events (down, up, move) vs hover only events. The only events that currently coalesce are `onpointermove` events. This change uses just one counter now that we increment whenever some non-move event is fired.

Let me know if there's a simpler way to ensure counter doesn't overflow.
This change also ensures we're overriding `getCoalescingKey` which isn't used by Fabric but for old event emitter it might be (which we use for native animations). Part of that requires the `coalescingKey` to be a short so updated to that.

There was also a bug where I forgot to pass `mLastButtonState` to one of the dispatch calls. Will be wrokign on refactor so its less argument soup.

Reviewed By: javache

Differential Revision: D39530927

fbshipit-source-id: 689fa98580b206a480cc08121971cdf96bdbbfaa
2022-09-20 12:01:07 -07:00