Commit Graph

38536 Commits

Author SHA1 Message Date
Sam Zhou cd9b1d9e43 Replace $Call in babel-traverse libdef with conditional type (#41736)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41736

Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D51735062

fbshipit-source-id: 942264cdc9f71e4aaa6f730d68f5a2a6e2fc7493
2023-11-30 19:40:12 -08:00
Joe Vilches 89ec746b52 Change comment on Yoga measure modes in RN (#41732)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41732

Was reading the code in this file and noticed that this comment is no longer true after D51068417 (https://github.com/facebook/yoga/pull/1460). Updated the comment to reflect the current state of things

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D51730986

fbshipit-source-id: beaa5de9576d86e56def35f6e970376c7be8f7ee
2023-11-30 18:28:24 -08:00
Nick Gerleman 7e5f15b889 Remove unneeded const_cast (#41712)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41712

I fixed the const correctness of YGConfigGetErrata a while back when fixing up other YGConfig accessors.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D51689323

fbshipit-source-id: 1af3deb44ec03a8a65643fa1496c534ac8f6d057
2023-11-30 12:10:50 -08:00
Pieter Vanderwerff ede35df163 Deploy 0.223.0 to fbsource (#41725)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/41725

Reviewed By: SamChou19815

Differential Revision: D51713020

fbshipit-source-id: 84dc8c882f7603d642cb4ccb735fad0fb7e25d4d
2023-11-30 11:25:47 -08:00
Alex Taylor (alta) c98fa9ce8b Update hermes-parser and related packages in fbsource to 0.18.0 (#41689)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41689

Bump hermes-parser and related packages to 0.18.0.

Changelog: [internal]

Reviewed By: SamChou19815

Differential Revision: D51642821

fbshipit-source-id: b7abde7d3e0de195c18a5cb18d4cdd0a1d435127
2023-11-30 10:35:12 -08:00
Neil Dhar cfe129c832 Add JSI method for setting external memory size (#41436)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41436

Add a JSI API for associating some native memory with a JS object. This
is intended to provide a mechanism to trigger more frequent garbage
collection when JS retains large external memory allocations, in order
to avoid memory buildup.

This diff just adds the JSI method, without any implementations.

Changelog:
[General][Added] - Added JSI method for reporting native memory to the GC.

Reviewed By: tmikov

Differential Revision: D50524912

fbshipit-source-id: c8df0e18b0415d9523e0a00f6d0ed2faa648ac68
2023-11-30 08:58:02 -08:00
Pieter De Baets b41937e549 Fix ReactInstanceManager leak (#41719)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41719

We leak ReactInstanceManager into a static singleton in `ReactCxxErrorHandler.setHandleErrorFunc`. Clean it up in `destroy()`.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D51706624

fbshipit-source-id: 642825ba14ff0a9710b4435f5fb6026b3a81b711
2023-11-30 07:29:31 -08:00
Pieter De Baets 424ac63861 Clarify threading of OnViewAttach mount items (#41704)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41704

`mOnViewAttachItems` was set to be be concurrent, but this would be unexpected, as all mount item operations occur solely on the main thread.

Simplify this to be just a LinkedList and annotate the methods as being UI thread only.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D51662154

fbshipit-source-id: 9fe5784bce8a38d1339b5e3675791414676b6f4d
2023-11-30 04:38:19 -08:00
Krzysztof Piaskowy 31d8a93bf3 Fix Binding JNI type (#41657)
Summary:
New implementation:
This PR adds cast from interface Binding to BindingImpl class.

Previous implementation:
The changes made in this PR make the `mBinding` field of `FabricUIManager` visible for JNI.

Without these changes, calling the method `JFabricUIManager::getBinding()` would result in an error.

<img width="400" alt="Screenshot 2023-11-27 at 13 55 44" src="https://github.com/facebook/react-native/assets/36106620/04418291-8ce8-4bae-b16c-29a5c9f2ee52">

In the `react-native-reanimated` library, we utilize `JFabricUIManager::getBinding()`, and we have noticed this issue since version 0.73. This isn't perfect solution, but I'm not certain which change in RN or FBJNI is the source of the problem. If there are any alternative solutions worth considering, I am open to discussing them.

Usage of `getBinding()` in Reanimated:
https://github.com/software-mansion/react-native-reanimated/blob/main/android/src/main/cpp/NativeProxy.cpp#L57

## Changelog:

[ANDROID] [FIXED] - Fix type for unrecognisable field mBinding

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

Test Plan:
Just call `JFabricUIManager::getBinding` method (https://github.com/facebook/react-native/blob/v0.73.0-rc.5/packages/react-native/ReactAndroid/src/main/jni/react/fabric/JFabricUIManager.cpp#L14)

or run app with repro:
https://github.com/piaskowyk/missing-mBinding-repro
after the app lunch you will receive error from above screenshot.

Co-author: tomekzaw

Reviewed By: NickGerleman

Differential Revision: D51661873

Pulled By: javache

fbshipit-source-id: 1891c36bf25c503ebc9b0501211df03be6f74115
2023-11-30 04:32:16 -08:00
Joe Vilches 05ed0079ff Set up gating for position: relative as default (#41711)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41711

We want the default position to be relative for a number of reasons. This should be fine for the most part but putting a killswitch around this change just in case things blow up.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D51643446

fbshipit-source-id: 4f7d1e498eb663801ef6d88ba9cd9b64c781d66b
2023-11-29 20:35:14 -08:00
Ramanpreet Nara ee31ec9a3f Enable new lifecycle hooks by default everywhere (#41709)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41709

We shipped these new create()/reload()/destroy() methods to the Facebook app:
- Part 1: D50802718
- Part 2: D50803283

This diff just enables them everywhere, by default.

Created from CodeHub with https://fburl.com/edit-in-codehub

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D51590843

fbshipit-source-id: 02abeea78b7b7b844552989ad58d0a2f048424ad
2023-11-29 17:34:28 -08:00
Arushi Kesarwani c8db60c7aa Revert D50926218: Adding getFabricUIManager() APIs to ReactContext
Differential Revision:
D50926218

Original commit changeset: f311affb0f82

Original Phabricator Diff: D50926218

fbshipit-source-id: 313fd5aff1314860994487d1f4d17d2a2d5fe8c1
2023-11-29 12:01:12 -08:00
Arushi Kesarwani 93be03056b Revert D51224854: Refactor DefaultReactNativeHost to use the new way of Fabric initialization
Differential Revision:
D51224854

Original commit changeset: 2af802140436

Original Phabricator Diff: D51224854

fbshipit-source-id: 039337be7057c9625d4a6e53520a18cd5071813e
2023-11-29 12:01:12 -08:00
Rubén Norte 56291fadd4 Fix type definition of useMergeRefs (#41700)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41700

The type definition of `useMergeRefs` is incorrect, which forces all callsites to use `$FlowFixMe`. This fixes the definition and removes all the `$FlowFixMe`s caused by it.

Changelog: [internal]

Reviewed By: javache

Differential Revision: D51660716

fbshipit-source-id: 4d4d3a72bdca8c409fd1dda59cc2c94113b024bb
2023-11-29 12:00:29 -08:00
Rubén Norte c120ccb7ee Small refactor of image attached callbacks logic (#41701)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41701

I did a hotfix for this logic in D51618512. This does a small refactor to improve the code (moving more shared code to the hook and avoiding creating a closure unnecessarily in every call to it).

Changelog: [internal]

Reviewed By: javache

Differential Revision: D51660288

fbshipit-source-id: 472836840b19958402bd0de3e2c09c7cec004156
2023-11-29 12:00:29 -08:00
Nick Gerleman 10b3e0e868 Converge iOS oldarch scrollEventThrottle behavior (#41695)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41695

When I went to update documentation, I kinda internalized how inconsistent the API is if we don't change iOS Paper.

The potential for breaks is if an iOS-specific component ignores a warning, and uses `onScroll` without `scrollEventThrottle`, then relies on `onScroll` only being called once.

It didn't seem like we hit this scenario in practice when migrating Fabric ComponentView behavior, and components will need to support it in new arch anyway, so this change takes the less conservative option of unifying the behavior everywhere.

Changelog:
[iOS][Changed] - scrollEventThrottle no longer needs to be set for continuous scroll events

Reviewed By: cipolleschi

Differential Revision: D51647202

fbshipit-source-id: e2a57f3501b9096e4033cb198bbc214d53e9913c
2023-11-29 11:31:24 -08:00
Ramanpreet Nara c0375b8dad CxxReactPackage: Make initHybrid static (#41681)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41681

## Rationale

Make initHybrid static. So that the derived class can initialize the C++ part with constructor arguments.

**Note:** This diff just applies the fix from D51550623. into CxxReactPackage.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D51642219

fbshipit-source-id: 095e452e03848379288af960969789aa5e9c0542
2023-11-29 10:28:53 -08:00
Nicola Corti bae52388d2 Fix broken RN Tester custom ViewManager (#41708)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41708

RN-Tester is currently instacrashing due to a method accepting a `Float?` rather than a `Float`.
`Float` from Kotlin gets converted to Java's `float`, while `Float?` gets converted to the boxed type, which is not recognized by the framework and is making the app crash.

On top of this, the implementation of `setColor` was wrong as we don't properly handle the null case. Fixing it here as well.

Changelog:
[Internal] [Changed] - Fix broken RN Tester custom ViewManager

Reviewed By: NickGerleman

Differential Revision: D51667346

fbshipit-source-id: b7498a520936f81a0524ba53dc7230ad7ef57bf8
2023-11-29 09:40:05 -08:00
Moti Zilberman 54761213f6 Stop logging CREATE_I18N_ASSETS_MODULE events (#41703)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41703

TSIA

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D51661861

fbshipit-source-id: 6fd5e253d9113f6acf7f4fe889f35f9aa580797e
2023-11-29 08:18:50 -08:00
Riccardo Cipolleschi f1df4ceb84 Add CircleCI readme (#41706)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41706

This change introduces a ReadME in the CircleCI folder.
This can be used as documentation to learn more about our CircleCI setup and will also help GitHub employees in executing the migration.

## Changelog:
[Internal] - Add CircleCI documentation

Reviewed By: cortinico

Differential Revision: D51665453

fbshipit-source-id: f61325ed26572c4a8d4a68db1cca5934d3d968fb
2023-11-29 07:49:29 -08:00
Marcel Canhisares 3654089b0e (refactor): kotlinify layout property applicator test (#41649)
Summary:
This PR converts to kotlin the java code for LayoutPropertyApplicatorTest, as requested in: https://github.com/facebook/react-native/issues/38825

## Changelog:

[INTERNAL][CHANGED]: Convert LayoutPropertyApplicatorTest to Kotlin

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

Test Plan: `./gradlew :packages:react-native:ReactAndroid:test `

Reviewed By: rshest

Differential Revision: D51614921

Pulled By: cortinico

fbshipit-source-id: 06ee403a496f34afc9abeabc0c406391e316538a
2023-11-29 07:25:26 -08:00
Oskar Kwaśniewski 4ccd6e1242 feat: allow OOT platforms to use custom resolver.resolveRequest (#41697)
Summary:
Currently, when we have an additional platform in `react-native.config.js`, users cannot use custom `resolver.resolveRequest` functions as they are overwritten by `reactNativePlatformResolver`. Goal of this PR is to allow OOT platforms to use additional custom resolvers besides remapping react native imports.

## Changelog:

[GENERAL] [FIXED] - Allow Out Of Tree platforms to pass custom resolvers

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

Test Plan:
1. Add additional platform in `react-native.config.js`
2. Pass custom resolver to `metro.config.js`:

```js
resolveRequest: (context, moduleName, platform) => {
      console.log('resolveRequest', moduleName, platform);
      return context.resolveRequest(context, moduleName, platform);
 }
```
3. Check if user's `resolveRequest` function is called.

Reviewed By: huntie

Differential Revision: D51659721

Pulled By: robhogan

fbshipit-source-id: 952589b59a6fa34e9406d36c900be53a7c1a79c3
2023-11-29 05:53:54 -08:00
Will Schurman bb075d785d Fix android root view group removal during instance re-creation (#41678)
Summary:
This is my proposed solution to https://github.com/facebook/react-native/issues/41677.

Fixes https://github.com/facebook/react-native/issues/41677.

## Changelog:

[ANDROID] [FIXED] - Fix android root view group removal during instance re-creation

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

Test Plan:
Both with fabric enabled and disabled (new architecture):

1. Clone repro repo: https://github.com/wschurman/rn-reload-repro
2. Build and run on android (I use android studio)
3. Click reload button, see timestamp doesn't change (indicating that the view is not removed)
4. Apply this PR as a patch.
5. Re-build and run.
6. Click reload button, see view is correctly disposed of and the new view is set.

Reviewed By: cortinico

Differential Revision: D51658524

Pulled By: javache

fbshipit-source-id: d9a026cde677ad1ec113230bc31bd9297bca8bfc
2023-11-29 04:53:31 -08:00
Riccardo Cipolleschi dc95568375 Remove duplicated jobs in CircleCI (#41698)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41698

With the previous changes on the Pod configuration, the build setup for the New and Old architecture are the same.
The only observable difference happens at runtime.

This change:
1. Removes the build job that are split by architecture (which is now duplicated work)
2. Add two more test jobs to run runtime tests (unit and integration test) to make sure that the two architectures continue working.

## Changelog:
[Internal] - [CI] Remove duplicated build jobs, add tests jobs

Reviewed By: cortinico

Differential Revision: D51659275

fbshipit-source-id: 769c9ee004e7f4f1a7444f39c02b7083e007b780
2023-11-29 04:17:48 -08:00
Riccardo Cipolleschi 4a35f2512e Make sure that third party libraries include Fabric code (#41669)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41669

In some previous changes ([a607692](https://github.com/facebook/react-native/commit/a6076924bf43dff6cf4d38d51df279edba3882d0) and [6b53205](https://github.com/facebook/react-native/commit/6b5320540adfe16803ef41353f23115d08819309)) we make sure to always include all the pods (including Fabric) and we unify codegen to run in the same way on both architectures.
While doing so, we enabled codegen to run on libraries tat already migrated to Fabric.
These makes those libraries to fail when building as they were not including the Fabric code when the New Architecture is disabled.

This change will make sue that the code is always included, thus the library should always build, and it also make sure that we can control the New/Old Architecture at build time.

## Changelog
[iOS][Changed] - Make sure that libraries always include Fabric code also in the old architecture

Reviewed By: dmytrorykun

Differential Revision: D51617542

fbshipit-source-id: 883d1e258c341feb0405ad389bb8af34d64b59b8
2023-11-29 04:17:48 -08:00
Arushi Kesarwani 667d85bdda Refactor DefaultReactNativeHost to use the new way of Fabric initialization (#41496)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41496

Refactoring `DefaultReactNativeHost` to use the new way of Fabric initialization through `FabricUIManagerProviderImpl`

Reviewed By: christophpurrer

Differential Revision: D51224854

fbshipit-source-id: 2af8021404365fa2adc9388f44bcc7c6301137dc
2023-11-28 23:34:57 -08:00
Nick Gerleman 56b57e2db4 Ship "disableScrollEventThrottleRequirement" (#41676)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41676

This has been used in a significant amount of production for about 2 months, with no consistently statistically significant metric impact. Let's ship it.

Note that we would not want to keep this change in a holdout if we remove the warning, since new usages could be added that relied on the behavior not in the holdout.

It didn't seem worth the churn to make the same change to Paper, which leaves a question on how to handle the JS-side warning. Instead of jimmying in impl detection, I thought it might be more sane to remove the warning, though that also has a potential hit to Paper DevX.

Changelog:
[iOS][Changed] - `scrollEventThrottle` no longer needs to be set for continuous scroll events when using the new architecture.

Reviewed By: javache

Differential Revision: D51608970

fbshipit-source-id: 193019de208f3088519e6f6333dbec4e6b45a1eb
2023-11-28 20:06:12 -08:00
Xin Chen 44109dc2c0 Fix warm start logging for ReactMarker (#41693)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41693

This diff fixes app warm start time. Before this change, we cache the first time when app start timing is logged, and ignore future loggings. Some apps are warm started and the startup time should be updated.

Reviewed By: dmitry-voronkevich

Differential Revision: D50481710

fbshipit-source-id: 03e00b75ee7ac578209ae3478adabe567e92a950
2023-11-28 19:27:51 -08:00
Nick Gerleman 88a55baeaa Change default back to position: "relative" (#41480)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41480

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

The previous version of static didn't do anything inside of Yoga. Now that we're making it do something, this changes the default back to relative so that users with no errata set don't see their deafult styles changing.

Reviewed By: joevilches

Differential Revision: D51182955

fbshipit-source-id: c0ea357694e1367fb6786f1907dfff784b19a4bc
2023-11-28 18:51:34 -08:00
Nick Gerleman fa436b4a63 Explicitly default Fabric to position: "static" (#41481)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41481

This will allow us to keep RN on it's "pseudo-static" mode, while changing the Yoga default back to relative, to avoid breaking existing layouts.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D51182861

fbshipit-source-id: 25489d7f0642c4ff78340438c2b266e95a5fb207
2023-11-28 18:51:34 -08:00
Arushi Kesarwani 2ddd9cd5f5 Adding getFabricUIManager() APIs to ReactContext (#41506)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41506

Adding APIs for `getFabricUIManager()` to ReactContext and it's subclasses. This will replace the `getJSIModule()` post JSI module deletion.

Thereby replacing the callsite to context.getFabricUIManager() in UIManagerHelper.

NOTE: This still has fallback to getJSIModule() in case the UIManagerProvider is not set

Changelog:
[Internal] internal

Reviewed By: philIip

Differential Revision: D50926218

fbshipit-source-id: f311affb0f82895b254fd4664aa8ea23ab31bac0
2023-11-28 18:29:04 -08:00
Neil Dhar 02b94476af Handle UTF8 in native exception message (#41575)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41575

We currently do not validate the incoming native exception message
before passing it to the char* constructor of TwineChar16.

Treat it as UTF-8 and convert it to UTF-16 before creating the
JavaScript exception.

Changelog: [Internal]

Reviewed By: tmikov

Differential Revision: D49551640

fbshipit-source-id: 762f8038b29818d804bda5a7f3b4762621c94336
2023-11-28 16:50:06 -08:00
Ramanpreet Nara 9e4fa20b75 Extend default tmmdelegate to support many cxxreactpackages (#41680)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41680

Just like how React Native can have n ReactPackages, it will support n CxxReactPackages.

This way, many applications can share common CxxReactPackages.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D51484844

fbshipit-source-id: b9b70cab719e80a7ff7e635057d710f1a86fb1c9
2023-11-28 16:46:27 -08:00
Rubén Norte 40c7736a1d Fix incorrect wrapping of refs in Image component (#41679)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41679

This fixes a bug in the original implementation of image attached callbacks (still experimental). The problem was that we were unconditionally caching the ref passed to the underlying image component, which meant that whenever users passed new ref setters we wouldn't call them again.

This fixes that by forcing the creation of a new ref value whenever a new ref is passed to the image component.

Changelog: [internal]

Reviewed By: jehartzog

Differential Revision: D51618512

fbshipit-source-id: ac15160c528563c2131e8b3444dea4a6096f20bc
2023-11-28 16:36:35 -08:00
zhongwuzw aa9e824a75 Move ActionSheet UI operation to main thread (#41666)
Summary:
Fixes UI operation not on the main thread.
![image](https://github.com/facebook/react-native/assets/5061845/276f7e9c-dcf8-4ba1-af2d-c9fa990d41a1)

![image](https://github.com/facebook/react-native/assets/5061845/cfe85921-3cc9-4f32-b794-a6a8bc00ee1d)

## Changelog:

[IOS] [FIXED] - Move ActionSheet UI operation to main thread

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

Test Plan: None.

Reviewed By: philIip

Differential Revision: D51613525

Pulled By: cipolleschi

fbshipit-source-id: e5f543bbcc9bc0f5b6dda5bc2deb20279e851946
2023-11-28 15:14:54 -08:00
Ramanpreet Nara 129bd9d813 Ensure C++ default tmmd can access the CxxReactPackage (#41673)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41673

## The Problem
The cxxReactPackage property isn't initialized by the time initHybrid was executed. So, initHybrid was being called with null as the cxxReactPackage.

Why;
1. The default turbomodule manager delegate receives cxxReactPackage as a constructor param.
2. Java then executes all the constructors of the class hierarchy. This executes initHybrid.
3. Java finally initializes the properties of the derived class: default tmmd.cxxReactPackage (i.e: the parameter to initHybrid). **This is too late**

## The Fix
Refactor the code such that hybrid data creation doesn't depend on property initialization:
1. Create a static initHybrid method in default tmmd.
2. Call this static method with the cxxReactPackage, and assign the resultant HybridData to mHybridData (in tmmd).

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D51550623

fbshipit-source-id: ed2b7587351cfca408cda3c8cef4dcf7547e5f1e
2023-11-28 13:17:22 -08:00
Ramanpreet Nara 4c1bdea81d CxxReactPackage: Load So's during class loads (#41674)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41674

The problem: The Java runtime couldn't find CatalystCxxReactPackage.initHybrid.

Why: I think is because CxxReactPackage loads CatalystCxxReactPackage's so in its constructor. This might be too late to load the derived class's so.

So, I just switched derived delegates to load the so in the static initializer (i.e: the recomended approch for so loading):

https://www.internalfb.com/code/fbsource/[91c4e41c49ed191ac864250ccaec52c01ddaeccc]/fbandroid/libraries/soloader/java/com/facebook/soloader/SoLoader.java?lines=52-54%2C60-61%2C63-67

This way:
1. The So's are loaded plenty early (the method not found error went away).
2. We don't create our own so loading infra, which complicates this abstraction, and makes it harder to work with, even more.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D51550622

fbshipit-source-id: f4782d6fa9387f21fbf611191e9483e2a58b3a34
2023-11-28 13:17:22 -08:00
Ramanpreet Nara 00e70354ca CxxReactPackage: Use hungarian notation for hybridData (#41675)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41675

FBJni expects the HybridData object to exist on the mHybridData property of the java object. So, we have to call this propery mHybridData.

Otherwise, this fbjni class just won't work.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D51550621

fbshipit-source-id: d169266474717f0a38799ede7c07af57461012b7
2023-11-28 13:17:22 -08:00
Nicholas Block 528f97152b Backout - Schedule a Choreographer callback only if there is ongoing animation
Summary: caused performace problems with react app

Reviewed By: gpalves

Differential Revision: D51617862

fbshipit-source-id: 38c0c06dacdd7aa862fd523a7ce136e54ed55fa2
2023-11-28 08:57:23 -08:00
Samuel Susla a8fc20616f do not use ShadowNode::defaultSharedProps in UIManager::clone (#41667)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41667

changelog: [internal]

I made a mistake during refactor in D51471667 where I removed the check if rawProps is nullptr. We must check if props are empty during `UIManager::clone`, leaving the check for `ConcreteComponentDescriptor::cloneProps` does not lead to the same result.

There is a deeper problem here that needs to be analysed but this should resolve the lunch blocker.

Reviewed By: javache

Differential Revision: D51614396

fbshipit-source-id: 055694c4a71a914d8732a3632c50026cc24cbe7d
2023-11-28 08:10:17 -08:00
Nicola Corti 25196ba24f Fix several build warnings on RN Tester Android (#41660)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41660

While working on other things, I noticed those warnings firing on console which I'm fixing here.

Changelog:
[Internal] [Changed] - Fix several build warnings on RN Tester Android

Reviewed By: cipolleschi

Differential Revision: D51589072

fbshipit-source-id: 1ddb29afd0d150f1ccbc7a8def9f27ecedb69724
2023-11-28 07:08:54 -08:00
Nicola Corti 4f3094aba4 Kotlin to 1.8.22 (#41661)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41661

This aligns the Kotlin version used inside fbsource to the one used for React Native GitHub

Changelog:
[Internal] [Changed] - Kotlin to 1.8.22

Reviewed By: NickGerleman

Differential Revision: D51587726

fbshipit-source-id: 5f985bd50c7688e4d369184b79dbf1bdc799876e
2023-11-28 03:53:47 -08:00
Gabriel Donadel 94c7661206 Update 'cannot calculate shadow efficiently' log message (#39700)
Summary:
While working in an app I kept getting these `View X of type Y has a shadow set but cannot calculate shadow efficiently. Consider setting a background color to fix this` warnings even though I had added a background color to that view. Upon inspecting RCTView.m I notice that what is actually required to fix this is a solid background

To make this a bit clearer to developers I believe we should update this log message to explicitly say "solid background" instead of "background"

## Changelog:

[IOS] [CHANGED] - Update 'cannot calculate shadow efficiently' log message to explicitly say solid background

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

Test Plan: N / A

Reviewed By: christophpurrer

Differential Revision: D51584574

Pulled By: javache

fbshipit-source-id: b1741f7002ebb876e4a50959bef7f39df76a5c3c
2023-11-28 03:24:25 -08:00
Nick Gerleman 9078db77a9 Remove NumericBitfield (#41394)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41394

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

Now that are enums are unsigned, and we don't have BitfieldRef, we can convert the last remaining user of NumericBitfield to a plain old bitfield,  for better readability (e.g. the default values), debugability, and less complexity. We also break a cycle which lets us properly group public vs private members.

Reviewed By: joevilches

Differential Revision: D51159415

fbshipit-source-id: 7842a8330eed6061b863de3f175c761dcf4aa2be
2023-11-27 21:20:20 -08:00
Nick Gerleman 495fee4ff2 Remove yoga::Style::BitfieldRef (#41393)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41393

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

Removes the last of the non setter-style style setters.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D51155925

fbshipit-source-id: 2921c87d95ad36495b7013e592d5169015321545
2023-11-27 21:20:20 -08:00
Nick Gerleman 3294bc737c Remove yoga::Style::Ref (#41389)
Summary:
X-link: https://github.com/facebook/yoga/pull/1462

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

Moves the last usages of `yoga::Style::Ref` to setters.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D51154501

fbshipit-source-id: 52dbca7a76de500a8841387eb59fded463864de7
2023-11-27 21:20:20 -08:00
Oskar Kwaśniewski dc36be335f chore: remove duplicated pod 'Yoga' in RNTester (#41627)
Summary:
This PR removes duplicated `pod 'Yoga'` as it is already declared in `use_react_native`.

## Changelog:

[INTERNAL] [REMOVED] - duplicated pod 'Yoga' in RNTester

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

Test Plan: CI Green

Reviewed By: christophpurrer

Differential Revision: D51603340

Pulled By: NickGerleman

fbshipit-source-id: 89e77e5a544cb54d77b969462130725853b36d5d
2023-11-27 16:53:31 -08:00
Phillip Pan 09a289542c dispatch RCTNativeAnimatedTurboModule methods onto UIManager queue (#41472)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41472

Changelog: [Internal]

this module doesn't work correctly with synchronous void methods, fixing it here

Reviewed By: cipolleschi

Differential Revision: D51293023

fbshipit-source-id: 86b19eceac8f28142351961e061f07f57ed98bca
2023-11-27 15:04:20 -08:00
Nicola Corti e979a456eb AGP to 8.1.4 (#41662)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41662

This bumps AGP to the latest bugfix version

Changelog:
[Internal] [Changed] - AGP to 8.1.4

Reviewed By: NickGerleman

Differential Revision: D51589071

fbshipit-source-id: cd62c94a75b1718572acd1f45f817b16b7d5ed11
2023-11-27 14:52:15 -08:00
Bill Alves 86c5abac2a avoid scheduling frame callback if there are no events (#41658)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41658

changelog: [internal]

FabricEventDispatcher does not need to run on every frame. Whenever a new event is added to Fabric's event queue, it will call `FabricUIManager.onRequestEventBeat` in Java. This in turn calls `FabricEventDispatcher.maybePostFrameCallbackFromNonUI` and adds a frame callback on the Choreographer.

This makes code simpler, as we do not need to manage the frame callback subscription.

Reviewed By: sammy-SC

Differential Revision: D50604303

fbshipit-source-id: ce2c7b77678bfc14aa7ecac71e40f78263c7036a
2023-11-27 11:49:47 -08:00