Commit Graph
29365 Commits
Author SHA1 Message Date
David VaccaandFacebook GitHub Bot b8534e60fc Introduce StableReactNativeAPI annotation (#40879)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40879

Introduce StableReactNativeAPI annotation, the goal of this annotation is to describe classes, interfaces and members that are considered Stable and will remain part of the new architecture of React Native

changelog: [internal] internal

Reviewed By: arushikesarwani94

Differential Revision: D50195996

fbshipit-source-id: a64a27217a6fd885d2c188a6847565b3413bb232
2023-10-12 15:10:26 -07:00
David VaccaandFacebook GitHub Bot b9c50e268c Revert undeprecation of onCatalystInstanceDestroy (#40800)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40800

Revert undeprecation of onCatalystInstanceDestroy

revert of D50141027

changelog: [Android][Changed] Deprecated NativeModule.onCatalystInstanceDestroy

Reviewed By: christophpurrer

Differential Revision: D50195995

fbshipit-source-id: ccfa91e40db2c6b05e78d571ca94e609d1993fba
2023-10-12 15:10:26 -07:00
Sam ZhouandFacebook GitHub Bot a53b4a0a2b Make React.Element fully opaque (#40883)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40883

Changelog: [Internal]

Reviewed By: mvitousek

Differential Revision: D50198503

fbshipit-source-id: 47537aeefbc6cbdee8954ea1052ff3a4b4392744
2023-10-12 13:48:22 -07:00
Dmitry RykunandFacebook GitHub Bot 02957718d7 SVC Codegen: Handle TSAsExpression when looking for the codegen declaration (#40860)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40860

This diff adds support for the `AS` expression in TS sources. The following codegen declaration should work now:
```
export default codegenNativeComponent<NativeProps>(
  'MyComponentView',
) as HostComponent<NativeProps>;
```
Changelog: [General][Added] - Handle TSAsExpression when looking for the codegen declaration

Reviewed By: shwanton

Differential Revision: D50225241

fbshipit-source-id: 247a3d341d742b548e82318d0fa21dff9884d2bd
2023-10-12 11:24:16 -07:00
Eric RozellandFacebook GitHub Bot eef823b90c Adds isPressable native prop to TextAttributes (#40871)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40871

If we pass isPressable to the native props object (via TextAttributes), we can use this information to bypass hit testing on some spans. This is rather important on some platforms where pointerenter/pointerleave/ mousemove events force frequent hit testing.

## Changelog:

[General] [Internal]

Reviewed By: javache

Differential Revision: D50228473

fbshipit-source-id: 4fce85f4b18617fbe10d3c804e943484bf990664
2023-10-12 11:15:46 -07:00
fortmarekandFacebook GitHub Bot 14eb4c9cde Add changelog for 0.71.14 (#40863)
Summary:
Adds changelog for the 0.71.14 version.

## Changelog:

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

Pick one each for the category and type tags:

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

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

[INTERNAL] [CHANGED] - Add 0.71.14 changelog

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

Reviewed By: robhogan

Differential Revision: D50228147

Pulled By: huntie

fbshipit-source-id: cb6ad2abac53825a935205fb7646d8fa32ba8302
2023-10-12 10:31:56 -07:00
Alex HuntandFacebook GitHub Bot f41fb76920 Add changelog for 0.72.6 [skip ci] (#40868)
Summary:
Add changelog for 0.72.6.

Changelog: [Internal]

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

Reviewed By: robhogan

Differential Revision: D50228177

Pulled By: huntie

fbshipit-source-id: e16df90d2aae012593f2e845486baa3bf3ed34ab
2023-10-12 10:10:32 -07:00
Blake FriedmanandFacebook GitHub Bot 067c989b48 make runtime reference thread safe on tickleJs call
Summary:
The reference to runtime assumes the queue will ensure references to runtime are valid when invoked. This
isn't the case if you create a breakpoint, Hermes hit that breakpoint and your refresh the app. This consistently
will crash the app.

The fix is to not assument this, similar to ReactCommon/react/runtime/hermes/HermesInstance.cpp

Reviewed By: javache

Differential Revision: D50225678

fbshipit-source-id: b45cae1f5f687bc8c699fd74b187376a547012c5
2023-10-12 10:09:55 -07:00
Sam ZhouandFacebook GitHub Bot 11d9b9cef0 Prepare to make React.Element fully opaque (#40798)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40798

Changelog: [Internal]

Reviewed By: sullenor

Differential Revision: D50194982

fbshipit-source-id: 21d2f86dd787952ceed9a4f862a3fcaa2b063349
2023-10-12 08:43:32 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 02e53ebc42 Fix Nightlies
Summary:
## Changelog:
[Internal] - Fix Nighlties that were broken due to changes for double publishing

Reviewed By: cortinico

Differential Revision: D50225219

fbshipit-source-id: dd1b96a956bb282caa40bd6f99b9a82554958746
2023-10-12 07:22:23 -07:00
Nicola CortiandFacebook GitHub Bot 6f1b8edc7a normalize-colors should not impose node >= 18
Summary:
I'm removing the node >= 18 restriction on react-native/normalize-colors as that's unnecessary
as is currently breaking the ecosystem for users on Node 16 on previous versions of React Native.

Changelog:
[General] [Fixed] - normalize-colors should not impose node >= 18

Reviewed By: robhogan

Differential Revision: D50215144

fbshipit-source-id: cdfb90f4274754ad5b04fa2cad339419d45bbcba
2023-10-12 05:26:14 -07:00
Alex HuntandFacebook GitHub Bot 79ded77fcd Disable --experimental-debugger by default (#40795)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40795

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D50178494

fbshipit-source-id: b833b6accadd2902d97a45e030cd48d1b62ac438
2023-10-12 05:26:11 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 8f7ffc4d5e Run all the tests when not on a PR
Summary:
## Changelog:
[Internal] - Run all the tests in CI when not on a PR

Reviewed By: cortinico

Differential Revision: D50220596

fbshipit-source-id: be1a30d713e9d427858cf22bd3ca9549ad513057
2023-10-12 03:31:32 -07:00
Skander EllouzeandFacebook GitHub Bot 2be1c71cb7 refactor(image typing): use ImageRequireSource instead of number for defaultSource prop typing (#40801)
Summary:
This is just a type refactoring to make the typing of the `defaultSource` prop of the Image component more explicit and descriptive (using the `ImageRequireSource` type makes it more clear that we can use the require statement to set an image asset as default source) and this is also more consistent with the `source` prop typing.

Currently :
- The typing of default source is `ImageURISource | number | undefined`
- The typing of source is `ImageSourcePropType` which is equal to `ImageURISource  | ImageURISource[]  | ImageRequireSource` and `ImageRequireSource` is equal to `number`.

In this PR we change the typing of default source to `ImageURISource | ImageRequireSource | undefined` to make more clear that the number of the default source prop refers to the use of the require statement with an asset file.

## Changelog:
[GENERAL] [CHANGED] - use ImageRequireSource instead of number for the defaultSource prop typing of the Image component

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

Test Plan: No one required since it's a small typing refactoring.

Reviewed By: christophpurrer

Differential Revision: D50209922

Pulled By: NickGerleman

fbshipit-source-id: c25f3c6f145f357ff1cb0b1c7b54a19bf1dec824
2023-10-12 03:28:53 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 5217890df9 Back out "Make sure template is consuming the right buildToolsVersion" (#40854)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40854

This [commit](https://github.com/facebook/react-native/commit/a5d5ead1a474832a911c3a6e44b6d6450bca3fd6) seems to break all the Android template tests: [CircleCI](https://app.circleci.com/pipelines/github/facebook/react-native/34139/workflows/b203bbea-d3c4-45aa-9ce1-1ddde6d88bc0).

## Changelog:
[Android][Changed] - revert commit https://github.com/facebook/react-native/commit/a5d5ead1a474832a911c3a6e44b6d6450bca3fd6

## Facebook:
Original Phabricator Diff: D50019777

Reviewed By: sammy-SC

Differential Revision: D50217952

fbshipit-source-id: d9b93ad72f08cf9f04cacfc04ea9b418f8129079
2023-10-12 03:18:50 -07:00
Ramanpreet NaraandFacebook GitHub Bot de1fb8f7fd Sort object properties in interop test
Summary:
It looks like objects properties aren't guaranteed to have a stable order. Sort them, before we serializae and print them to the screen in the interop test. This should reduce interop test flakyness.

Changelog: [Internal]

Reviewed By: makovkastar

Differential Revision: D50148860

fbshipit-source-id: a6ed1433d4dd35cafa5c9f7d09c4cca194c31d81
2023-10-11 19:03:01 -07:00
Pieter De BaetsandFacebook GitHub Bot fb194788cb Use AsyncCallback in RCTTurboModule (#40792)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40792

Similarly to D49792717, simplify the careful logic we have with CallbackWrapper and RCTBlockGuard and instead rely on bridging's `AsyncCallback` so safely handle jsi::Function for us.

Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D49862756

fbshipit-source-id: 289f2d5ef622f47eb3fccf0cc7a52cc13a83b028
2023-10-11 11:22:28 -07:00
Pieter De BaetsandFacebook GitHub Bot 8dd89cee1b Replace RAIICallbackWrapperDestroyer with AsyncCallback (#39952)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39952

AsyncCallback and SyncCallbacks are better primitives for jsi::Function handling. The code is simpler and requires less manual argument passing. See in D49684248 how the API was extended to support more use-cases.

Changelog: [General] Deprecated RAIICallbackWrapperDestroyer. Use AsyncCallback instead for safe jsi::Function memory ownership.

Reviewed By: RSNara

Differential Revision: D49792717

fbshipit-source-id: 9f2f3b00c71ad1b86427dee3749c6d98ef0f5678
2023-10-11 11:22:28 -07:00
Fabrizio CucciandFacebook GitHub Bot ec3a137572 Fix UIManager Flow type (#40794)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40794

I accidentally stumbled upon the `UIManager` object on JS side and realised it was being exported as `any`. So I've extracted the interface `UIManagerJSInterface` and applied where it seems to make sense, although, after chatting with javache it could be useful to further narrow down the interface given what's currently implemented by the `BridgelessUIManager`.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D50137691

fbshipit-source-id: ccc746fa1dfbb3290e0b73dfa14c65833b238e07
2023-10-11 11:21:19 -07:00
Riccardo CipolleschiandFacebook GitHub Bot e91fef733b Configure CircleCI for double publishing (#40785)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40785

## Changelog:
[Internal] - Configure CircleCI for double publishing

Reviewed By: cortinico

Differential Revision: D49957950

fbshipit-source-id: 56b9be1b7be374af68d8340abaf06f1c58ab173e
2023-10-11 10:09:57 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 45285a513d Connect the flag removal script (#40782)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40782

## Changelog:
[Internal] - Connect the flag removal script

Reviewed By: cortinico

Differential Revision: D50083082

fbshipit-source-id: d7cc1e81debed7a8fa934c8010e5884ad29bd657
2023-10-11 10:09:57 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 89c9ca0f68 Generalize get-and-update-nightlies (#40786)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40786

## Changelog:
[Internal] -  Generalize get-and-update-nightlies

Reviewed By: cortinico

Differential Revision: D49956685

fbshipit-source-id: 506b812b93353526a941f3deb136f6bdc74cce35
2023-10-11 10:09:57 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 2d067568d7 Add double publishing support to set-rn-version (#40784)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40784

## Changelog
[Internal] Add double publishing support to set-rn-version

Reviewed By: cortinico

Differential Revision: D49955312

fbshipit-source-id: b154fe0c4cc53dbe3cc6319bbf43663307816ee4
2023-10-11 10:09:57 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 657aea0946 Update version-utils to accept new versions (#40783)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40783

ignore-github-export-checks
## Changelog:
[Internal] - Update version-utils to accept more versions for double publishing

Reviewed By: cortinico

Differential Revision: D49917128

fbshipit-source-id: 4556e5161986d8b041de464aa6939dfb2dd45e61
2023-10-11 10:09:57 -07:00
Riccardo CipolleschiandFacebook GitHub Bot d16793dbe0 Update publishing to Sonatype for double publishing (#40781)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40781

## Changelog:
[Internal] - Allow Sonatype to double publish SNAPSHOTS

Reviewed By: cortinico

Differential Revision: D49914824

fbshipit-source-id: 830e20eb51ffdf5b7c4452972c436ca0cb4da5a9
2023-10-11 10:09:57 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 7ebfe7046d Compute the right version (#40780)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40780

## Changelog:
[Internal] - Compute the right version when publishing

Reviewed By: cortinico

Differential Revision: D49914416

fbshipit-source-id: 9ab5a3323851eec943f759b8be11c3d7d48df83f
2023-10-11 10:09:57 -07:00
Nicola CortiandFacebook GitHub Bot a5d5ead1a4 Make sure template is consuming the right buildToolsVersion (#39956)
Summary:
Currently, the template has a `buildToolsVersion = '34.0.0'` specified in the top level .gradle file but it's not currently using it.

This is causing the build to fallback to the default version provided by AGP which is 33.x
This is also causing the CI to download buildtools 34.0.0 as they're not in the container (causing network flakyness).

I'm also bumping the docker container to v12 as we bumped NDK 26 which is missing in the v11 container.

## Changelog:

[INTERNAL] [FIXED] - Make sure template is consuming the right buildToolsVersion

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

Test Plan: CI should be green

Reviewed By: christophpurrer

Differential Revision: D50019777

Pulled By: cortinico

fbshipit-source-id: a2ab7a7bd7c55624d5c050b45e69086c5f25ba6a
2023-10-11 10:04:47 -07:00
Lulu WuandFacebook GitHub Bot 4d70337fb5 Add ExceptionsManagerModule for RNTester (#40767)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40767

Fix the following issue:
```Invariant Violation: TurboModuleRegistry.getEnforcing(...):
'ExceptionsManager' could not be found. Verify that a module by this name is registered in the native
binary.Bridgeless mode: true. TurboModule interop: true. Modules loaded: {"NativeModules":[],"TurboModules":
["PlatformConstants","AppState","SourceCode","BlobModule","WebSocketModule","DevSettings","DevToolsSettingsManager","LogBox","Networking","Appearance","DevLoadingView","DeviceInfo","DeviceEventManager",
"SoundManager","ImageLoader","DialogManagerAndroid","NativeAnimatedModule","I18nManager","AccessibilityInfo","StatusBarManager","StatusBarManager","IntentAndroid","ToastAndroid","ShareModule","Vibration"],
"NotFound":["NativePerformanceCxx","NativePerformanceObserverCxx","RedBox","BugReporting","HeadlessJsTaskSupport","FrameRateLogger","KeyboardObserver",
"AccessibilityManager","ModalManager","LinkingManager","ActionSheetManager","ExceptionsManager"]}
```

Changelog:
[Android][Changed] - Add Add ExceptionsManagerModule to CoreReactPackage

Reviewed By: cortinico

Differential Revision: D50017783

fbshipit-source-id: 8642bb23bdae50a1e702f5e0586b0ede80007bb1
2023-10-11 09:56:27 -07:00
Luis Miguel AlvaradoandFacebook GitHub Bot 0004888608 refactor: don't include DevtoolsOverlay & TraceUpdateOverlay in the production bundle (#40749)
Summary:
Currently, when we build the app in production mode the `DevtoolsOverlay` & `TraceUpdateOverlay` are bundle

## Changelog:

[GENERAL][REMOVED]: removed `DevtoolsOverlay` & `TraceUpdateOverlay` from production bundle

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

Pick one each for the category and type tags:

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

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

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

Test Plan:
1. Build the app in production mode
2. Check that both `DevtoolsOverlay` & `TraceUpdateOverlay` are included in the bundle

Reviewed By: robhogan, NickGerleman

Differential Revision: D50121208

Pulled By: hoxyq

fbshipit-source-id: 3e1fb506c679ec79b116dea9772d372cd2ea9ca9
2023-10-11 09:54:22 -07:00
Krystof WoldrichandFacebook GitHub Bot cd78e39e2b feat(tm-android): TM SyncVoidKind methods throws JSError (#40788)
Summary:
Other RM Sync method calls do return JSError with the throwable information.

## 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] [ADDED] - TM SyncVoidKind methods throws JSError

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

Test Plan:
Output of caught error `console.log(e, e.stack, e.cause);`

```js
 LOG  [Error: Exception in HostFunction: Intentional exception from JVM voidFuncThrows] Error: Exception in HostFunction: Intentional exception from JVM voidFuncThrows
    at voidFuncThrows (native)
    at voidFuncThrows (http://10.0.2.2:8081/js/examples/TurboModule/SampleTurboModuleExample.bundle//&platform=android&lazy=true&app=com.facebook.react.uiapp&modulesOnly=true&dev=true&minify=false&runModule=true&shallow=true:100:127)
    at onPress (http://10.0.2.2:8081/js/examples/TurboModule/SampleTurboModuleExample.bundle//&platform=android&lazy=true&app=com.facebook.react.uiapp&modulesOnly=true&dev=true&minify=false&runModule=true&shallow=true:235:71)
    at _performTransitionSideEffects (http://10.0.2.2:8081/js/RNTesterApp.android.bundle//&platform=android&dev=true&lazy=true&minify=false&app=com.facebook.react.uiapp&modulesOnly=false&runModule=true:67991:22)
    at _receiveSignal (http://10.0.2.2:8081/js/RNTesterApp.android.bundle//&platform=android&dev=true&lazy=true&minify=false&app=com.facebook.react.uiapp&modulesOnly=false&runModule=true:67941:45)
    at onResponderRelease (http://10.0.2.2:8081/js/RNTesterApp.android.bundle//&platform=android&dev=true&lazy=true&minify=false&app=com.facebook.react.uiapp&modulesOnly=false&runModule=true:67784:34)
    at apply (native)
    at invokeGuardedCallbackProd (http://10.0.2.2:8081/js/RNTesterApp.android.bundle//&platform=android&dev=true&lazy=true&minify=false&app=com.facebook.react.uiapp&modulesOnly=false&runModule=true:4727:21)
    at apply (native)
    at invokeGuardedCallback (http://10.0.2.2:8081/js/RNTesterApp.android.bundle//&platform=android&dev=true&lazy=true&minify=false&app=com.facebook.react.uiapp&modulesOnly=false&runModule=true:4903:42)
    at apply (native)
    at invokeGuardedCallbackAndCatchFirstError (http://10.0.2.2:8081/js/RNTesterApp.android.bundle//&platform=android&dev=true&lazy=true&minify=false&app=com.facebook.react.uiapp&modulesOnly=false&runModule=true:4917:36)
    at executeDispatch (http://10.0.2.2:8081/js/RNTesterApp.android.bundle//&platform=android&dev=true&lazy=true&minify=false&app=com.facebook.react.uiapp&modulesOnly=false&runModule=true:4994:48)
    at executeDispatchesInOrder (http://10.0.2.2:8081/js/RNTesterApp.android.bundle//&platform=android&dev=true&lazy=true&minify=false&app=com.facebook.react.uiapp&modulesOnly=false&runModule=true:5016:26)
    at executeDispatchesAndRelease (http://10.0.2.2:8081/js/RNTesterApp.android.bundle//&platform=android&dev=true&lazy=true&minify=false&app=com.facebook.react.uiapp&modulesOnly=false&runModule=true:7640:35)
    at executeDispatchesAndReleaseTopLevel (http://10.0.2.2:8081/js/RNTesterApp.android.bundle//&platform=android&dev=true&lazy=true&minify=false&app=com.facebook.react.uiapp&modulesOnly=false&runModule=true:7647:43)
    at forEach (native)
    at forEachAccumulated (http://10.0.2.2:8081/js/RNTesterApp.android.bundle//&platform=android&dev=true&lazy=true&minify=false&app=com.facebook.react.uiapp&modulesOnly=false&runModule=true:5610:22)
    at runEventsInBatch (http://10.0.2.2:8081/js/RNTesterApp.android.bundle//&platform=android&dev=true&lazy=true&minify=false&app=com.facebook.react.uiapp&modulesOnly=false&runModule=true:7660:27)
    at runExtractedPluginEventsInBatch (http://10.0.2.2:8081/js/RNTesterApp.android.bundle//&platform=android&dev=true&lazy=true&minify=false&app=com.facebook.react.uiapp&modulesOnly=false&runModule=true:7693:25)
    at anonymous (http://10.0.2.2:8081/js/RNTesterApp.android.bundle//&platform=android&dev=true&lazy=true&minify=false&app=com.facebook.react.uiapp&modulesOnly=false&runModule=true:7734:42)
    at batchedUpdates$1 (http://10.0.2.2:8081/js/RNTesterApp.android.bundle//&platform=android&dev=true&lazy=true&minify=false&app=com.facebook.react.uiapp&modulesOnly=false&runModule=true:20049:20)
    at batchedUpdates (http://10.0.2.2:8081/js/RNTesterApp.android.bundle//&platform=android&dev=true&lazy=true&minify=false&app=com.facebook.react.uiapp&modulesOnly=false&runModule=true:7616:36)
    at dispatchEvent (http://10.0.2.2:8081/js/RNTesterApp.android.bundle//&platform=android&dev=true&lazy=true&minify=false&app=com.facebook.react.uiapp&modulesOnly=false&runModule=true:7705:23)
{"message": "Intentional exception from JVM voidFuncThrows", "name": "java.lang.RuntimeException", "stackElements": [{"className": "com.facebook.fbreact.specs.SampleTurboModule", "fileName": "SampleTurboModule.java", "lineNumber": 186, "methodName": "voidFuncThrows"}, {"className": "com.facebook.jni.NativeRunnable", "fileName": "NativeRunnable.java", "lineNumber": -2, "methodName": "run"}, {"className": "android.os.Handler", "fileName": "Handler.java", "lineNumber": 958, "methodName": "handleCallback"}, {"className": "android.os.Handler", "fileName": "Handler.java", "lineNumber": 99, "methodName": "dispatchMessage"}, {"className": "com.facebook.react.bridge.queue.MessageQueueThreadHandler", "fileName": "MessageQueueThreadHandler.java", "lineNumber": 27, "methodName": "dispatchMessage"}, {"className": "android.os.Looper", "fileName": "Looper.java", "lineNumber": 205, "methodName": "loopOnce"}, {"className": "android.os.Looper", "fileName": "Looper.java", "lineNumber": 294, "methodName": "loop"}, {"className": "com.facebook.react.bridge.queue.MessageQueueThreadImpl$4", "fileName": "MessageQueueThreadImpl.java", "lineNumber": 234, "methodName": "run"}, {"className": "java.lang.Thread", "fileName": "Thread.java", "lineNumber": 1012, "methodName": "run"}]}
```

Reviewed By: cortinico

Differential Revision: D50169068

Pulled By: javache

fbshipit-source-id: 3a7b5e44fc69e3b8747b12c524c717904c4e808f
2023-10-11 09:12:53 -07:00
Ivan AlexandrovandFacebook GitHub Bot 265af222aa Fix android platform border color (#39893)
Summary:
If you try to apply PlatformColor to borders on Android app will crash with the next error:

"Error while updating property 'borderColor' of a view managed by: RCTView"

## Changelog:

[ANDROID] [FIXED] - Fix android crash when apply PlatformColor to borders

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

Test Plan:
In RNTester example, go to APIs -> PlatformColor
|    Before  | After |
| ----------- | ----------- |
|  <img src="https://github.com/facebook/react-native/assets/70860930/66ac2880-53da-4438-bd9a-332f8ea40645" alt="drawing" width="200"/>    | <img src="https://github.com/facebook/react-native/assets/70860930/151f58a1-d857-4b3d-9ec6-de74eb065127" alt="drawing" width="200"/>      |

Reviewed By: NickGerleman

Differential Revision: D50011758

Pulled By: javache

fbshipit-source-id: ea06c18c6aef4b6731e9b9b87422a1e0d13de208
2023-10-11 08:47:23 -07:00
Alex HuntandFacebook GitHub Bot f40bb9331c Bump package versions for next major (#39764)
Summary:
#publish-packages-to-npm

Bump all package versions to `0.74.0` (next major release) for `main`, following instructions at https://reactnative.dev/contributing/release-branch-cut-and-rc0#12-bump-minor-version-of-all-monorepo-packages-in-main.

```sh
yarn bump-all-updated-packages --release-branch-cutoff
```

Changelog: [Internal]

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

Test Plan: —

Reviewed By: robhogan

Differential Revision: D49871039

Pulled By: huntie

fbshipit-source-id: f4df6efeae4d8a9209e7aae7b9e6fea3d15793b5
2023-10-11 08:36:23 -07:00
Kacper KafaraandFacebook GitHub Bot bc63e44b23 Purge children from view registry when UIManager is invalidated (#38617)
Summary:
Talking about Paper & iOS here.

In standard RN applications when a native component is removed permanently from view hierarchy [it is invalidated (if it implements `RCTInvalidating`)](https://github.com/facebook/react-native/blob/e64756ae5bb5c0607a4d97a134620fafcb132b3b/packages/react-native/React/Modules/RCTUIManager.m#L483-L495). Components that implement `RCTInvalidating` such as [`RNSScreenView`](https://github.com/software-mansion/react-native-screens/blob/9fb3bd00850bcdf29b46daa57e56eabda3ae30ea/ios/RNSScreen.mm#L35) of [`react-native-screens`](https://github.com/software-mansion/react-native-screens) library rely on `RCTInvalidating#invalidate` method being called in adequate moment to release retained resources (in my case the `RNSScreenView` holds a strong reference to it's view controller preventing it from being garbage collected).

However in case of brownfield applications (React Native is used only for a particular view & loaded on demand, see: https://github.com/software-mansion/react-native-screens/issues/1754 for discussion & app example) when view controller holding `RCTRootView` is dismissed and whole `React Native` managed view / controller tree gets deallocated, `RCTInvalidating#invalidate` method is not called on the dismissed components, thus in my particular use case, leading to memory leak.

Right now I've added call to `RCTUIManager#_purgeChildren:fromRegistry:` (which internally invalidates all components which implement `RCTInvalidating`) in `RCTUIManager#invalidate`.

## 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
-->

[IOS][FIXED] - Purge children from view registry on `RCTUIManager` invalidation.

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

Test Plan:
You can run the [demo](https://github.com/mkondakov/RNSScreensMemoryLeak) provided in the [issue](https://github.com/software-mansion/react-native-screens/issues/1754).

Following screenshots show that memory leak in brownfield application is resolved.

Without the change (`invalidate` method is not being called on native components)

![image](https://github.com/facebook/react-native/assets/50801299/dac331c2-1e7c-4e66-a8c1-b88f7a007d9b)

With the change:

![image](https://github.com/facebook/react-native/assets/50801299/7a8afbe9-446c-47a2-a972-d7589b921677)

Reviewed By: NickGerleman

Differential Revision: D49952215

Pulled By: javache

fbshipit-source-id: 6336b86774615acc40279c97e6ae0bb777bda8ad
2023-10-11 07:31:57 -07:00
generatedunixname89002005325672andFacebook GitHub Bot 3859eee961 Daily arc lint --take KTFMT
Reviewed By: 0x1eaf

Differential Revision: D50164739

fbshipit-source-id: a3a03735eaea41d3e7e04a73b210c6347ebd078e
2023-10-11 06:05:17 -07:00
Riccardo CipolleschiandFacebook GitHub Bot c279db78c4 Bump RNTester Cocoapods cache keys after SocketRocket 6.1.0 bump (#40789)
Summary:
Commit 8b88883071 broke the Cache for RNTester because the cached version of the pods does not know about the exitence of SocketRocket 6.1.0
Bumping the keys should force a redownload of the cocoapods specs repo

## Changelog:
[Internal] - Bump RNTester cache keys

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

Test Plan: CircleCI is green

Reviewed By: GijsWeterings

Differential Revision: D50169281

Pulled By: cipolleschi

fbshipit-source-id: 83e251495bfa43d62384470efe97c5505d76684f
2023-10-11 05:02:08 -07:00
Gabriel DonadelandFacebook GitHub Bot 8b88883071 Bump SocketRocket to 0.6.1 (#40774)
Summary:
The SocketRocket version was upgraded to 0.6.1 on the 0.72-stable branch but for some reason it was not updated in main, causing a downgrade when running `pod install` with 0.73.0 RC1

Original commit bumping SocketRocket -> https://github.com/facebook/react-native/commit/8ce471e2fa802cc50ff2d6ab346627cb5f6d79b4

## Changelog:

[IOS] [CHANGED] - Bump SocketRocket to 0.6.1

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

Test Plan: Run rntester locally

Reviewed By: cipolleschi

Differential Revision: D50137261

Pulled By: arushikesarwani94

fbshipit-source-id: dfc2760f5d5611881126ad114d8f6ada23630a29
2023-10-11 02:18:19 -07:00
Phillip PanandFacebook GitHub Bot 9f51a0c59d hook up unstable_enableSyncVoidMethods to ReactFeatureFlags (#39988)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39988

Changelog: [Internal]

in this pr, we integrate the sync void configuration with our feature flag infra

Reviewed By: luluwu2032

Differential Revision: D50030743

fbshipit-source-id: 03505e5e1f74aa90dc16f33fa4e93f9de9660dae
2023-10-10 22:39:59 -07:00
Phillip PanandFacebook GitHub Bot 2e16785424 introduce unstable_enableSyncVoidMethods config (#39989)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39989

Changelog: [Internal]

we need some configuration path to turn on the sync void method execution behavior, doing that here

Reviewed By: luluwu2032

Differential Revision: D50028200

fbshipit-source-id: a2501b622685e4bafa5e2a5031275cc8bc5050b7
2023-10-10 22:39:59 -07:00
Phillip PanandFacebook GitHub Bot b41a2f92ae introduce logic to invoke sync void method (#39970)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39970

Changelog: [Internal]

in this diff, i add the logic that makes void return values run synchronously

Reviewed By: javache

Differential Revision: D49613770

fbshipit-source-id: ef840fb3ee130430505d000a7cf74e094f9d1405
2023-10-10 22:39:59 -07:00
Christoph PurrerandFacebook GitHub Bot 4e92f609af rntester Android > Don't call rncore_ModuleProvider(name, params) twice (#40758)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40758

This is a follow up to https://github.com/facebook/react-native/pull/39987?fbclid=IwAR3qXLYUtfGSg81CpfDZFAwlnOb2J0zcJb1Wpc9ikLtd_9w2FUDovD6Xwx8

As we already call
```
  return rncore_ModuleProvider(name, params);
```
in:
https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/jni/react/newarchdefaults/DefaultTurboModuleManagerDelegate.cpp#L55

we don't have to do it again in:
https://github.com/facebook/react-native/blob/main/packages/rn-tester/android/app/src/main/jni/OnLoad.cpp#L53

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D50109991

fbshipit-source-id: eeb5af739f4dbf4bf45a21a13eec44ae772db7c4
2023-10-10 17:43:37 -07:00
Christoph PurrerandFacebook GitHub Bot 9e3d466c48 Add rn-tester Android BUCK configuration (#39987)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39987

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D49983211

fbshipit-source-id: c362d5b93e159bfb5ca17bea0ec0484adcdb4dca
2023-10-10 17:03:55 -07:00
David VaccaandFacebook GitHub Bot b13ea1786f Remove deprecation of onCatalystInstanceDestroy (#40777)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40777

In this diff I'm removing the deprecation of NativeModule.onCatalystInstanceDestroy() method, changing it to DeprecatedInNewArchitecture

changelog: [Android][Breaking] Mark NativeModule.onCatalystInstanceDestroy() method as deprecated in new architecture

Reviewed By: christophpurrer

Differential Revision: D50141027

fbshipit-source-id: a4c4911bdadc27f981f3af0522317e6dd08d9344
2023-10-10 16:16:56 -07:00
David VaccaandFacebook GitHub Bot 7a31ecd665 Introduce BaseReactPackage class (#40775)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40775

In this diff I'm introducing the BaseReactPackage class to the public API of React Native Android. the goal is for this class to replace TurboReactPackage, which will be Deprecated in the New Architecture

changelog: [internal] internal

Reviewed By: christophpurrer

Differential Revision: D50128456

fbshipit-source-id: a65e1eb0d81b94e442799226784f73f489eabb73
2023-10-10 15:43:48 -07:00
Pieter De BaetsandFacebook GitHub Bot 7b7f128968 Support NativeState in JSC (#40746)
Summary:
X-link: https://github.com/facebook/hermes/pull/1151

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

This feature was missing in JSC's JSI implementation, which is preventing from rolling out NativeState-based features in React Native.

Changelog: [General][Added] JSC support for the NativeState API in JSI

Reviewed By: neildhar

Differential Revision: D49229022

fbshipit-source-id: 1787c1d1b4803212d84da8f55b7d5a460a9d33c2
2023-10-10 12:44:27 -07:00
Mauricio GuzmanandFacebook GitHub Bot 28b089ed3a Update PerspectiveTransform type (#40771)
Summary:
Very simple change, there's a typo in the word "perspective" whilst naming the possible transform property types.

## Changelog:

[INTERNAL] [FIXED] - Fix typo in PerspectiveTransform type

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

Test Plan: -

Reviewed By: javache

Differential Revision: D50133297

Pulled By: arushikesarwani94

fbshipit-source-id: bd742b1bccc5d015e5e8095b1d2b83765fee3d6b
2023-10-10 12:12:53 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 9c5ceeaf99 Make the Fabric Interop layer work in Bridgeless (#40732)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40732

This change allows the Fabric Interop Layer to work in bridgeless mode.

Given that the legacy components requires a Bridge to send events and use commands, this change simulates a bridge when it doesn't exists (i.e.: we are in bridgeless mode).

In order to make it work, we had to simulate a few elements from the Bridge and the UIManager.

## Changelog:
[iOS][Fixed] - Make the Fabric interop layer works in bridgeless mode.

## Facebook:
As an alternative approach, we could have created a `protocol RCTBridging`, have the `RCTBridge` conform to that protocol, and create a new type for it.
Practically this would have been much more cumbersome:
1. The [RCTBridge](https://www.internalfb.com/code/fbsource/[916531b9bf7a9943036807f7563c925b4c3e0101]/xplat/js/react-native-github/packages/react-native/React/Base/RCTBridge.h?lines=87-238) interface is quite big. All the props and method should be part of the protocol.
2. Extensions declared on RCTBridge would not have worked. For example, [`RCTBridge (RCTUIManager)`](https://www.internalfb.com/code/fbsource/[916531b9bf7a9943036807f7563c925b4c3e0101]/xplat/js/react-native-github/packages/react-native/React/Modules/RCTUIManager.h?lines=170-174).
3. It would require a major overhaul of the APIs, returning `id<RCTBridging>` in place of **every** function that takes/return an instance of `RCTBridge *`.

Clearly, not a feasible way to go.

Reviewed By: RSNara

Differential Revision: D50079929

fbshipit-source-id: 77d4370e9043c8e06b676bff3987511c042b0f9c
2023-10-10 11:45:38 -07:00
Nick GerlemanandFacebook GitHub Bot c40fc313ca Fix iOS Paper Scroll Event RTL check (#40751)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40751

In D48379915 I fixed inverted `contentOffset` in `onScroll` events on iOS. I thought I tested on Paper, but I think this was during a period where the Paper route in Catalyst was actually launching Fabric (oops).

In Paper, at least under `forceRTL` and English, `[UIApplication sharedApplication].userInterfaceLayoutDirection` is not set to RTL. We instead have a per-view `reactLayoutDirection` we should be reading.

This sort of thing isn't currently set on Fabric, which checks application-level RTL. This seems... not right with being able to set `direction` in a subtree context, but Android does the same thing, and that would take some greater changes.

Changelog:
[iOS][Fixed] - Fix iOS Paper Scroll Event RTL check

Reviewed By: luluwu2032

Differential Revision: D50098310

fbshipit-source-id: e321fca7b2f7983e903e23237bc2d604c72f98a3
2023-10-10 11:43:14 -07:00
Nick GerlemanandFacebook GitHub Bot 22a7b8dd37 Remove code to support bottom-up layout events in horizontal RTL (#39646)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39646

We can dramatically simplify this code and remove quirks/hacks, now that we can assume layout events are always fired top down.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D49628669

fbshipit-source-id: 7de5bbc4597eba1c59aaa7672c70e76d2786c7ef
2023-10-10 11:43:14 -07:00
Nick GerlemanandFacebook GitHub Bot 56ddace9c8 Deterministic onLayout event ordering for iOS Paper (#40748)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40748

The ordering of `onLayout` events is non-deterministic on iOS Paper, due to nodes being added to an `NSHashTable` before iteration, instead of an ordered collection.

We don't do any lookups on the collection, so I think this was chosen over `NSMutableArray` for the sake of `[NSHashTable weakObjectsHashTable]`, to avoid retain/release. Using a collection which does retain/release seems to cause a crash due to double release or similar, so those semantics seem intentional (though I'm not super familiar with the model here).

We can replicate the memory semantics with ordering by using `NSPointerArray` (which is unfortunately not parameterized). This change does that, so we get consistently top-down layout events (matching Fabric, and Android Paper as of D49627996). This lets us use multiple layout events to calculate right/bottom edge insets deterministically.

Changelog:
[iOS][Changed] -  Deterministic onLayout event ordering for iOS Paper

Reviewed By: luluwu2032

Differential Revision: D50093411

fbshipit-source-id: f6a9d5c973b97aede879baa8b952cc1be2447f28
2023-10-10 11:43:14 -07:00
Riccardo CipolleschiandFacebook GitHub Bot 5c2ec558c1 Fix functions that turn on the New Architecture (#40770)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40770

## Changelog:
[Internal] - Fix functions that turn on the New Architecture

Reviewed By: cortinico

Differential Revision: D50084427

fbshipit-source-id: aae0c77585929eacf8e890321e27e5049e53775e
2023-10-10 10:16:29 -07:00