Commit Graph
29915 Commits
Author SHA1 Message Date
Joe Vilches 7459529ee4 Introduce positionAbsoluteChild (#41491)
Summary:
X-link: https://github.com/facebook/yoga/pull/1473

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

To simplify the logic a bit I introduce a new function called `positionAbsoluteChild`. This function will, eventually, be the **sole function that matters** when determining the layout position of an absolute node. Because [absolute nodes do not participate in flex layout](https://drafts.csswg.org/css-flexbox/#abspos-items), we can determine the position of said node independently of its siblings. The only information we need are the node itself, its parent, and its containing block - which we have all of in `layoutAbsoluteChild`.

Right now, however, this is purely a BE change with no functionality different. There was a big set of if statements at the end of `layoutAbsoluteChild` that would position the node on the main and cross axis for certain cases. The old code had it so that the main and cross axis had basically the same logic but the code was repeated. This puts that logic, as is, in `positionAbsoluteChild` and calls that from `layoutAbsoluteChild`.

I will soon edit this function to actually do what it is envisioned to do (i.e. be the sole place that position is set for absolute nodes).

Reviewed By: NickGerleman

Differential Revision: D51272855

fbshipit-source-id: 68fa1f0e0f4d595faf2af1d9eaceb467382ca406
2023-12-04 19:35:30 -08:00
Joe Vilches a48e0d590e Use containing block to adjust absolute child position (#41490)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41490

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

This change has most of the logic needed for supporting `position: static`. We do two things here that fix a lot of the broken static test:

1) We pass in the containing node to `layoutAbsoluteChild` and use it to properly position the child in the case that insets are defined.
2) We rewrite the absolute child's position to be relative to it's parent in the event that insets are defined for that child (and thus it is positioned relative to its CB). Yoga's layout position has always be relative to parent, so I feel it is easier to just adjust the coordinates of a node to adhere to that design rather than change the consumers of yoga.

The "hard" part of this algorithm is determining how to iterate the offset from the containing block needed to do this translation described above. That is handled in `layoutAbsoluteDescendants`.

Reviewed By: NickGerleman

Differential Revision: D51224327

fbshipit-source-id: ae6dc54fe2a71bebb4090ba21a0afb0125264cbc
2023-12-04 19:35:30 -08:00
Joe Vilches 43ab5fe38c Allow the containing block to set trailing position of absolute descendants (#41489)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41489

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

If we are going to allow the containing block to layout its absolute descendants and NOT the direct parent then we need to change step 11 which is concerned with setting the trailing position in the case we are row or column reverse. This is the very last step in the function and is positioned that way because it operates on the assumption that all children have their position set by this time. That is no longer a valid assumption if CBs layout their absolute children. In that case the CB also needs to take care of setting the position here.

Because of this problem I moved some things around. It now works like:

* If errata is set, the direct parent will set trailing position for all non absolute children in step 11
* If errata is set the CB will set trailing position of absolute descendants after they are laid out inside of layoutAbsoluteDescendants

Reviewed By: NickGerleman

Differential Revision: D51217291

fbshipit-source-id: a7eea0d3623f9041b73d609a1de2bfb0f0343a26
2023-12-04 19:35:30 -08:00
Joe Vilches 33d6a59bea Let containing blocks layout their absolute descendants, not parents (#41488)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41488

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

The way we plan on implementing `position: static` is by changing how we lay out absolutely positioned nodes. Instead of letting their direct parent lay them out we are going to let their containing block handle it. This is useful because by the time the containing block gets to this step it will already know its size, which is needed to ensure that absolute nodes can get the right value with percentage units. Additionally, it means that we can "translate" the position of the absolute nodes to be relative to their parent fairly easily, instead of some second pass that would not be possible with a different design.

This change just gets the core pieces of this process going. It makes it so that containing blocks will layout out absolute descendants that they contain. We also pass in the containing block size to the owner size args for `layoutAbsoluteChild`. This new path will only happen if we have the errata turned off. If there is no positioned ancestor for a given node we just assume the root is. This is not exactly how it works on the web - there is a notion of an initial containing block - but we are not implementing that as of right now.

Reviewed By: NickGerleman

Differential Revision: D51182593

fbshipit-source-id: 88b5730f7f4fec4f33ec64288618e23363091857
2023-12-04 19:35:30 -08:00
Joe Vilches e48da2aff3 Insets no longer apply to statically positioned nodes (#41369)
Summary:
X-link: https://github.com/facebook/yoga/pull/1454

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

One of the most basic aspects of statically positioned nodes is that [insets do not apply to them](https://developer.mozilla.org/en-US/docs/Web/CSS/position#static). So I put a guard inside `Node::relativePosition` where we take that into account when setting the position.

Reviewed By: NickGerleman

Differential Revision: D50507808

fbshipit-source-id: 7aab4138b06e60936db0ddb6019a9a30f1ded2db
2023-12-04 19:35:30 -08:00
Christoph Purrer b101dd0e34 Use C++17 namespace (#41771)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41771

Changelog: [Internal]

Since we are already enforcing C++20 (and 17), we can set the namespace declaration to the C++17 style

Reviewed By: NickGerleman

Differential Revision: D51789991

fbshipit-source-id: 165d7d4e652d60ab200e2355e084010a02f470a4
2023-12-04 19:07:51 -08:00
Christoph Purrer 974e584891 Update GenerateModuleH fixture (#41780)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41780

This updates our test fixture with more concrete examples from:
https://github.com/facebook/react-native/blob/main/packages/rn-tester/NativeCxxModuleExample/NativeCxxModuleExample.js

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D51804559

fbshipit-source-id: 3290bc5447e0b47551ad73f5b041e332443e71c6
2023-12-04 14:50:46 -08:00
Ruslan Lesiutin cd395b552b feat[ReactFabricPrivateInterface]: add getInternalInstanceHandleFromPublicInstance (#41786)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41786

Changelog: [Internal]

This is the preprequisite for https://github.com/facebook/react/pull/27783

Reviewed By: rubennorte

Differential Revision: D51808831

fbshipit-source-id: c8ddf67d7ad35a670fa462c246dcb7230ba47716
2023-12-04 13:06:16 -08:00
David Vacca e9b80971c7 Integrate binary-compatibility-validator into RN Android build system
Summary:
In this diff I'm integrating 'org.jetbrains.kotlinx.binary-compatibility-validator' into RN Android build gradle system.

The tool allows dumping binary API of a JVM part of a Kotlin library that is public in the sense of Kotlin visibilities and ensures that the public binary API wasn't changed in a way that makes this change binary incompatible

More context on https://github.com/Kotlin/binary-compatibility-validator#building-the-project-locally

bypass-github-export-checks

Reviewed By: cortinico

Differential Revision: D51262577

fbshipit-source-id: 1894f4e55a4019e3ce1585e9df12dee69944e5ce
2023-12-04 12:22:58 -08:00
Christoph Purrer a481ae7484 Remove flow exact object syntax {| brace pipe |} from TM example (#41779)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41779

Changelog: [Internal]

`exact_by_default` (https://flow.org/en/docs/types/objects/#exact-and-inexact-object-types) is turned on - https://github.com/facebook/react-native/blob/main/.flowconfig#L40 - so we don't need these extra `|`.

Reviewed By: rshest

Differential Revision: D51803601

fbshipit-source-id: bef3699333471948330c4ae541e7a7023a7b1485
2023-12-04 11:07:21 -08:00
Gijs Weterings e5df45c1c5 Stabilize View-backface-visibility-e2e.js (#41785)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41785

Changelog: [Internal] modify backface visibility e2e test to comfortably fit within user viewport

Reviewed By: makovkastar

Differential Revision: D51806469

fbshipit-source-id: a8a8a1426a154b452c29df07561b7302f3150bd1
2023-12-04 10:51:58 -08:00
Christoph Purrer 749b8dd2d4 Add logic to generate recursive TM members (#41768)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41768

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D51572375

fbshipit-source-id: e4ce0726c457ea02a7710ea1d21bbd697e35848a
2023-12-04 08:56:42 -08:00
Oskar Kwaśniewski 09b110fef8 fix: add verdaccio generated files to .gitignore (#41783)
Summary:
When working with Verdaccio (testing the template, releasing packages) - I've stumbled upon a lot of changes in the repo:

![CleanShot 2023-12-04 at 13 14 12@2x](https://github.com/facebook/react-native/assets/52801365/74ce53a2-b885-41f4-9a12-968a8577285e)

## Changelog:

[INTERNAL] [ADDED] - Add verdaccio generated files to .gitignore

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

Test Plan: CI Green

Reviewed By: christophpurrer

Differential Revision: D51808583

Pulled By: huntie

fbshipit-source-id: fec2a13883590d0c6af179c3804fba9d4235dde2
2023-12-04 07:52:06 -08:00
Christoph Purrer ead73de464 Add a BinaryTreeNode example for Cxx TMs (#41767)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41767

Changelog: [Internal]

Adds a simple example showing a direct recursive node in a Cxx TM.

Currently we can't auto-generate [the necessary C++ Types](https://reactnative.dev/docs/next/the-new-architecture/cxx-custom-types#struct-generator) - but we can add it later if this scenarios becomes really common.

Direct recursive nodes, can't be value types - it would require infinite memory. Hence they are nullable and managed by a smart pointer.

Reviewed By: rshest

Differential Revision: D51784136

fbshipit-source-id: f6f0710d03583bdf1e6e72ba42d8df7f8ff8d915
2023-12-04 05:54:50 -08:00
Christoph Purrer 5754b4a123 Add GraphNode example for Cxx TMs (#41766)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41766

Changelog: [Internal]

Adds a simple example showing a recursive node, stored inside a collection in a Cxx TM.

Currently we can't auto-generate [the necessary C++ Types](https://reactnative.dev/docs/next/the-new-architecture/cxx-custom-types#struct-generator) - but we can add it later if this scenarios becomes really common.

Reviewed By: rshest

Differential Revision: D51783974

fbshipit-source-id: 7352db1a354cd7da32febc650f7cc5e10dd16d2d
2023-12-04 04:19:47 -08:00
Kacper Kafara 385473522c Fix typos in ReactCompoundViewGroup comments (#41729)
Summary:
Was stepping with debugger through the code & noticed few typos.

## Changelog:

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

Pick one each for the category and type tags:

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

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[ANDROID] [FIXED] - Typos in `ReactCompoundViewGroup` comments

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

Test Plan: Typos in docs

Reviewed By: cortinico

Differential Revision: D51753447

Pulled By: arushikesarwani94

fbshipit-source-id: b373d67ca8b6c9f22d80ea1ccee98ecc5151b325
2023-12-01 21:23:06 -08:00
Arushi Kesarwani 5e406ccea0 Fixing Bridgeless Exception caused by the UIManager changes
Summary:
Forward-fixing the crash in Bridgeless mode caused by UIManagerProvider changes to replace JSI Module

bypass-github-export-checks

Reviewed By: philIip

Differential Revision: D51778494

fbshipit-source-id: f1837d7b164051e326e1227c432e493bad16cd51
2023-12-01 20:15:20 -08:00
Joe Vilches 01c627e392 Change strict layout conformance to not use the new static changes (#41733)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41733

I am currently implementing position: static in Yoga. I have a huge stack of changes that is ready to ship but we are waiting on the default position type to be relative before shipping. The reason being, my changes will affect a whole ton of styles where there is no position set so if we can make static no longer the default we can safely ship this new code. However, this will take a while and keeping up with this stack of diffs though merge conflicts, flakey tests, and general slowness for my IDE is getting annoying. So a solution here is to ship that stack and make it so that no one gets this functionality by changing the strict layout conformance to include the errata that is gating my changes. The end result being that the code can be shipped but will have no affect at the time being.

Right now, because that code is in a different branch and not on prod, this change will do nothing.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D51731778

fbshipit-source-id: f0b7fd8559adb19e1658b3ac64fcfc4c5f8ecdf7
2023-12-01 14:32:07 -08:00
Sam Zhou 448e6b8f84 Deploy 0.223.2 to xplat
Summary: Changelog: [Internal]

Reviewed By: pieterv

Differential Revision: D51768863

fbshipit-source-id: 716add02d82cdfa56f2d3fc4d4560fcb26e8f426
2023-12-01 13:42:10 -08:00
Arushi Kesarwani c30f2b6205 Refactor DefaultReactNativeHost to use the new way of Fabric initialization (#41739)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41739

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

Reviewed By: philIip

Differential Revision: D51719555

fbshipit-source-id: bad471a8a273accecb0641ccaa77223534cd45fd
2023-12-01 12:19:07 -08:00
Christoph Purrer 288708f411 react-native: Platformize android|ios textinput (#41600)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41600

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D51515743

fbshipit-source-id: 156d9119d84d82f31b62b89b1916365547ce0afe
2023-12-01 10:34:12 -08:00
Thibault Malbranche 84b0027028 feat: improve e2e local testing script (#41751)
Summary:
iOS?ios?android?Android?
Always making typos when using the local testing script with the platform argument... No more!

## Changelog:

[INTERNAL][ADDED] - Improved E2E local testing script to be more flexible

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

Reviewed By: cortinico

Differential Revision: D51758529

Pulled By: huntie

fbshipit-source-id: d9e633567a59fcfac1057cf1f21714ccef27ebb2
2023-12-01 10:32:55 -08:00
Arushi Kesarwani 75019c8707 Using UIManagerProvider instead of JSIModule in UIManagerHelper (#41738)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41738

Replacing the callsite to `context.getFabricUIManager()` in UIManagerHelper instead of `getJSIModule()`

Fixing the crash by directly making `getFabricUIManager()` of `ReactContext` independent of the assertion.

Reviewed By: philIip

Differential Revision: D51719040

fbshipit-source-id: f9118b16614724a1d6dabe59d5c4d25dd4bdbc73
2023-12-01 09:38:54 -08:00
Nicola Corti a3f238a44e AGP to 8.2.0 (#41747)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41747

Let's update AGP to the latest minor

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

Reviewed By: cipolleschi

Differential Revision: D51749138

fbshipit-source-id: fe473b6d1613b73e60e65848c20098e3f77d3a61
2023-12-01 08:41:02 -08:00
Nicola Corti 0e9c93c14d Gradle to 8.5 (#41748)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41748

Bumping to the latest stable of Gradle

Changelog:
[Internal] [Changed] - Gradle to 8.5

Reviewed By: cipolleschi

Differential Revision: D51749139

fbshipit-source-id: 2ee0f9a6c910dd5221f7f63c0c599d4ab181e10a
2023-12-01 08:41:02 -08:00
Tomasz Żelawski 1a0e1741c0 Add NDEBUG flag for Release builds for both architectures (#41715)
Summary:
Currently React Native defines `NDEBUG` flag for all pods in Fabric only. This is useful for other libraries, like Reanimated, because they have no easy way of defining their compilation flags (at least none that I know of). Therefore defining `NDEBUG` for both architectures would be beneficial.

## Changelog:

Pick one each for the category and type tags:

[IOS] [CHANGED] - Add `NDEBUG` flag for Release builds for both architectures

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

Test Plan:
Run ruby test suite.

## Notes

For the time being I just copied
`prepare_pod_target_installation_results_mock`
and
`def prepare_installer_for_cpp_flags`
to `utils-test.rb` since I wasn't sure how to handle the installer mock.

Reviewed By: cortinico

Differential Revision: D51708382

Pulled By: cipolleschi

fbshipit-source-id: ff206f8fc151934dbae89aacd1bc69c57b4f28ee
2023-12-01 07:03:26 -08:00
Pieter De Baets dbf0984682 Schedule CatalystInstanceImpl destruction using new thread (#41720)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41720

We currently go via the UI thread, so we can use AsyncTask to schedule the final bit of async ReactContext destruction. This is a requirement for the AsyncTask API, which is also deprecated. We should figure out a better way to schedule and re-use threads across React Native Android, but until then, we can just create a new Thread here, which is also what we do for instance creation.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D51706689

fbshipit-source-id: cf17e20e91b195b956b1701e6d91d563fdba4d15
2023-12-01 06:52:48 -08:00
Oskar Kwaśniewski 847f5dedcc Fix typo in circleci config (#41727)
Summary:
This PR fixes typo in CircleCI config

## Changelog:

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

Pick one each for the category and type tags:

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

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

[INTERNAL] [FIXED] - Typo in circleci config

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

Test Plan: CI Green

Reviewed By: cipolleschi

Differential Revision: D51748329

Pulled By: cortinico

fbshipit-source-id: 99f54c5b9ec4113205642076c010b748ab6229f6
2023-12-01 04:35:19 -08:00
Arushi Kesarwani f941f939bf Adding getFabricUIManager() APIs to ReactContext (#41728)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41728

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

Reviewed By: philIip

Differential Revision: D51718430

fbshipit-source-id: c897ab0ee9e755e3fdb3d1e5629177818870f293
2023-11-30 21:24:54 -08:00
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