Commit Graph

12270 Commits

Author SHA1 Message Date
David Vacca 0e91400857 Deprecate ReactFeatureFlags.useTurboModules (#45920)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45920

In this diff we are deprecating ReactFeatureFlags.useTurboModules, this flag will be deleted in the next version of ReactNative (0.77)
Please use DefaultNewArchitectureEntryPoint.load() to enable TurboModules.

changelog: [Android][Deprecated] deprecate ReactFeatureFlags.useTurboModules

Reviewed By: philIip

Differential Revision: D60853315

fbshipit-source-id: 084ef8073daae16b288d82ececf770fd4b68e80c
2024-08-06 19:50:55 -07:00
David Vacca 3f35217856 Deprecate ReactFeatureFlags.enableFabricRenderer (#45921)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45921

In this diff we are deprecating ReactFeatureFlags.enableFabricRenderer, this flag will be deleted in the next version of ReactNative (0.77)
Please use DefaultNewArchitectureEntryPoint.load() to enable fabric instead.

changelog: [Android][Deprecated] deprecate ReactFeatureFlags.enableFabricRenderer

Reviewed By: philIip

Differential Revision: D60853316

fbshipit-source-id: f9883a68771c8db8f24269630b0950e96741cf9d
2024-08-06 19:50:55 -07:00
Nick Gerleman 35d9a18b81 Fix "setTranslucentBackgroundDrawable()" deprecation version (#45856)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45856

No time traveling allowed.

Changelog:
[Android][Fixed] - Fix "setTranslucentBackgroundDrawable()" deprecation version

Reviewed By: joevilches

Differential Revision: D60569284

fbshipit-source-id: 364b0cde6f5117523289a2720128f44fd0e9e7db
2024-08-06 19:07:17 -07:00
Alan Lee 60c38c37aa Update helloworld tempate to minSdk 24 (#45905)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45905

- Updating minSdk to 24 before we do the update for the RN

Changelog: [Internal]

Reviewed By: blakef

Differential Revision: D60788291

fbshipit-source-id: d21d766159a04d79547e64fca802600279d08255
2024-08-06 17:13:48 -07:00
Omar Manjarrez Osornio fb67612e0b Revert D60453404: feat(iOS): implement automicallyAdjustsKeyboardInsets for new arch
Differential Revision:
D60453404

Original commit changeset: bd7ce5bac8fa

Original Phabricator Diff: D60453404

fbshipit-source-id: cda549be11288fa6cda03a4e6798125bac3c95e2
2024-08-06 15:36:52 -07:00
Jorge Cabiedes Acosta c3e2390be2 Fix missing empty check on isOnlyColorMatrixFilters() (#45916)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45916

When a Filter was removed by state update we missed this check which led to setting the layer type to HARDWARE incorrectly

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D60840169

fbshipit-source-id: e375e7d25c85e9d031c1e1a0795c49687e0018e7
2024-08-06 15:07:39 -07:00
Nishan b99675d78a feat: linear gradient ios (#45434)
Summary:
- Adds `background` prop that supports CSS's linear gradient. Later this can be extended to support various other gradients and possibly CSS's background image (less motivation as better solutions exists for image)
- Uses `CAGradientlayer` to draw Linear Gradient layers. So it is GPU optimised under the hood.
- Style supports JS object to specify `LinearGradient`, so it can support Animated libraries.

## Changelog:
[IOS] [ADDED] - linear gradient

<!-- 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/45434

Test Plan:
- Check out `processBackground-test.js` for supported syntax testcases.
- Checkout example added in ViewExample.js

Although the PR is tested well but open to any changes/feedback on the approach taken.

Android PR - https://github.com/facebook/react-native/pull/45433. Separated the PRs to keep it easier to review. Both PRs can be reviewed individually.

Reviewed By: NickGerleman

Differential Revision: D60791581

Pulled By: joevilches

fbshipit-source-id: 051088fdf68d9fe20c0c306f1f1c591cbd77f3d5
2024-08-06 13:59:33 -07:00
Fred Liu 09fd7528b6 Revert D60648823: ship use of passive effects in Animated
Differential Revision:
D60648823

Original commit changeset: 8efa1dac2a42

Original Phabricator Diff: D60648823

fbshipit-source-id: 6deb00df29f8e2ba8cb58d252c40144d2bed229e
2024-08-06 13:48:30 -07:00
Nick Gerleman 05e8b1061a Recreate Shadow RenderNode Display List If Needed (#45915)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45915

We avoid recomputing the RenderNode display list for shadow shape when the inputs have not changed, but Android may clear the display list itself, in which case we need to recreate it.

Changelog: [Internal]

Reviewed By: rozele

Differential Revision: D60833553

fbshipit-source-id: fe1ea04b13f85dda6af2761693e7c664794235e1
2024-08-06 11:46:04 -07:00
Thomas Nardone d023e0aae5 Stop recycling before calling onViewStateDeleted v2 (#45913)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45913

Changelog: [Internal] - Call ViewManagers' onSurfaceStopped() before onDropViewInstance()

This allows `ViewManager` to call `mRecyclableViews.remove(surfaceId)` before it wastes time on `prepareToRecycleView()` for views in a stopped surface.

Reviewed By: sammy-SC

Differential Revision: D60806242

fbshipit-source-id: d5eaaa5443fcb1d9390d8b84e0b5069618bb175e
2024-08-06 11:11:55 -07:00
Samuel Susla 8bf5a12ea2 fix crash in RefreshControl (#45914)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45914

changelog: [internal]

Fix a crash when SwipeRefreshLayout uses a custom child.

According to the docs, [SwipeRefreshLayout must override canChildScrollUp](https://developer.android.com/reference/androidx/swiperefreshlayout/widget/SwipeRefreshLayout#canChildScrollUp()) method if a custom view is used.

On Android, we do use a custom view: https://fburl.com/code/kfaj8q9z

Reviewed By: Abbondanzo

Differential Revision: D60829986

fbshipit-source-id: 09e6bc690bb66131d614b1eedfbede615f42d2e1
2024-08-06 10:42:07 -07:00
Nick Gerleman 9035008427 Add Screenshot Tests for Image border, background, shadows (#45885)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45885

There are some gaps here right now, but Android API 31+ is looking good.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D60731848

fbshipit-source-id: f515270a61a00c362b584f0d1549d14098c2e385
2024-08-06 09:25:34 -07:00
Oskar Kwaśniewski 21bdce7286 feat(iOS): implement automicallyAdjustsKeyboardInsets for new arch (#45819)
Summary:
This PR implements the missing `automicallyAdjustsKeyboardInsets` for new architecture.

After fixing this I've noticed there is an open issue (https://github.com/facebook/react-native/issues/45647) with somebody assigned (sorry shubhamguptadream11 for taking your task)

Here is the app running on new arch:

https://github.com/user-attachments/assets/673f0587-6a67-47e3-8050-d6ee33a45724

## Changelog:

[IOS] [FIXED] - implement automicallyAdjustsKeyboardInsets for new arch

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

Test Plan:
1. Test out ScrollViewKeyboardInsets example
2. See if it works the same with old and new arch

Reviewed By: sammy-SC

Differential Revision: D60453404

Pulled By: cipolleschi

fbshipit-source-id: bd7ce5bac8facffc527106b50c54112acf687bc3
2024-08-06 04:15:49 -07:00
Pavel Gurkovskii 3572ef3f1b T183626616 - [KP][WP iOS v] App crashes after rotation in landscape view during playing a video. (#45846)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45846

In general this diff fixes all crashes related to RTCImageUtills happened because of uncovered cases in switch.

In this current bug the problem was in this part of code
RCTTargetSize(imageSize, imageScale, frame.size, RCTScreenScale(), (RCTResizeMode)self.contentMode, YES);

when we cast UIViewContentMode to RCTResizeMode. RCTResizeMode doesnt cover all of UIViewContentMode values.

So just added default cases to swithces in places where it was lost.

Changelog:
[iOS][Fixed] - fixed crash in RCTImageUtils

Reviewed By: philIip

Differential Revision: D60523540

fbshipit-source-id: b8027537c600a7ca226e62238d16a6b05301d4de
2024-08-06 02:07:47 -07:00
Zeya Peng 67367a0bba Make normalizeEventType public (#45900)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45900

Changelog: [internal]

make `normalizeEventType` public, it looks like a nice util when we want to write code to intercept event, e.g. "scroll" event could be named as "onScroll" or "topScroll", this function contains the source of truth of how RN parses it

Reviewed By: christophpurrer

Differential Revision: D60767388

fbshipit-source-id: b3880fda57e2d92d9d199db5f5d39b8a8435820c
2024-08-05 22:12:26 -07:00
Zeya Peng b0b898b460 ScrollEvent 2/n - use ScrollEvent over ScrollViewEventEmitter::Metrics (#45899)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45899

Changelog: [internal]

replace ScrollViewEventEmitter::Metrics for ScrollEvent payload type created earlier
make ScrollViewEventEmitter::Metrics an alias of ScrollEvent as well

Reviewed By: christophpurrer

Differential Revision: D60767390

fbshipit-source-id: 8db88c0e1fa837b5dbad92d7bcce825882feaaf6
2024-08-05 22:12:26 -07:00
Zeya Peng e7caad2ee4 ScrollEvent 1/n - Create ScrollEvent payload (#45851)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45851

Create ScrollEvent payload type, so we can unwrap the scroll event metrics if intercept it in C++

Changelog: [internal]

Reviewed By: christophpurrer

Differential Revision: D60526048

fbshipit-source-id: 219a690ccf67d0b1c90e3496b8e5970ab7e2a79b
2024-08-05 22:12:26 -07:00
Sam Zhou ae73fe462e Replace React$Element that will cause an error in the future
Summary:
For the ones where `React.MixedElement` would suffice, I change them to `React.MixedElement`. For everything else, I changed it to be `React.Element`

Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D60798229

fbshipit-source-id: 40176b44769aade2c6b63a680d03c10056b2ddfa
2024-08-05 18:42:05 -07:00
Sam Zhou 4f47b385fa Cleanup all uses of internal flow type React$ElementRef in react-native (#45904)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45904

Flow will error on these dollar types soon. For all the ones changed here, they can all be further simplified.

Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D60786768

fbshipit-source-id: e26bf0be1c4a933fc0bd8b59827e10cbd7242a83
2024-08-05 14:51:30 -07:00
zhongwuzw 4e12c2e37c Fixes typo of function callFunctionOnBufferedRumtimeExecutor (#45902)
Summary:
I introduced a typo in https://github.com/facebook/react-native/issues/45486 . Thanks migueldaipre
 for the catch-up. cc cipolleschi

## Changelog:

[IOS] [FIXED] - Fixes typo of  function callFunctionOnBufferedRumtimeExecutor

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

Test Plan: Just a typo.

Reviewed By: cipolleschi

Differential Revision: D60775511

Pulled By: arushikesarwani94

fbshipit-source-id: da781ea5ecf2e0a15e5419430240e10194043b1b
2024-08-05 13:02:04 -07:00
Samuel Susla 9ee50e5db9 ship use of passive effects in Animated (#45893)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45893

changelog: [internal]

This is mainly impact for the Event Loop where setting up of animation graph will no longer block paint.

Reviewed By: rubennorte

Differential Revision: D60648823

fbshipit-source-id: 8efa1dac2a42b14a609adae05e9266f78a181d43
2024-08-05 08:30:49 -07:00
Alex Hunt 7b34870564 Replace usage of Java OptionalInt (#45862)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45862

Fixes compatibility with Android API < 24, and removes our `JOptionalInt` wrapper implementation for now.

Changelog: [Internal]

Reviewed By: robhogan, motiz88

Differential Revision: D60581676

fbshipit-source-id: 7e79fc59a4199a967e62ac3aeafc5d5681c60077
2024-08-05 08:15:45 -07:00
Jordan Brown fa3f769979 Deploy 0.242.0 to xplat (#45886)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45886

Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D60688497

fbshipit-source-id: 09c6daeef56e87317cbdb5c9ee0a8bc0828fa4ce
2024-08-05 07:04:16 -07:00
Blake Friedman 8689aa48bb AdditionalAnimatedNode → Kotlin
Summary: Changelog: [Android][Changed] AdditionalAnimatedNode.java → Kotlin

Reviewed By: rshest

Differential Revision: D60523059

fbshipit-source-id: de4e60854a03b5a6f061882c03cf191998888015
2024-08-05 05:21:36 -07:00
generatedunixname89002005232357 a4cd5994a7 Revert D57327835 (#45884)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45884

Pull Request resolved: https://github.com/facebook/react-native/pull/44569
Changelog:
[Internal] -
Reverting this diff due to internal build crashes:

This converts the vertical of NativeArray/ReadableNativeArray/WritableNativeArray classes to Kotlin.

Reviewed By: bvanderhoof

Differential Revision: D60707170

fbshipit-source-id: 95e66ebe725d0ff625b50f4711872b9f70ec2f7c
2024-08-03 00:36:01 -07:00
Thomas Nardone 8d4fd07469 Fix up UIManagerModuleConstantsHelper + test (#45877)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45877

A couple fixes:
- Test was mixing up event names - refactored to make the code [hopefully] clearer
- Code potentially recreates `events` if it's a singleton map, but that was lost due to it not being returned

Changelog: [Internal] Minor fix to UIManagerModuleConstantsHelper

Reviewed By: cortinico

Differential Revision: D60609294

fbshipit-source-id: 3c82ba30b9401674e678585b1612324f885c9ae1
2024-08-02 13:58:32 -07:00
Thomas Nardone a696d2ed6b Deprecate MapBuilder and remove Kotlin usages (#45743)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45743

This is a Java-centric class that can be replaced by Kotlin's map extensions.

Changelog:
[Android][Deprecated] Deprecate MapBuilder

Reviewed By: cortinico

Differential Revision: D60309106

fbshipit-source-id: 4a764fa1d59993dc735b2181a2270dc79a0e0396
2024-08-02 13:58:32 -07:00
zhongwuzw a778979ed6 Fixes main thread stuck when reload in bridgeless mode (#45486)
Summary:
In fabric bridgeless mode, when we reload, main thread may block because of dead lock. the backtrace example as below:

```
(lldb) bt
* thread https://github.com/facebook/react-native/issues/1, stop reason = signal SIGSTOP
  * frame #0: 0x000000010a5c76f2 libsystem_kernel.dylib`__psynch_mutexwait + 10
    frame https://github.com/facebook/react-native/issues/1: 0x00000001099e0a70 libsystem_pthread.dylib`_pthread_mutex_firstfit_lock_wait + 78
    frame https://github.com/facebook/react-native/issues/2: 0x00000001099de82b libsystem_pthread.dylib`_pthread_mutex_firstfit_lock_slow + 217
    frame https://github.com/facebook/react-native/issues/3: 0x00007ff80030c6b9 libc++.1.dylib`std::__1::mutex::lock() + 9
    frame https://github.com/facebook/react-native/issues/4: 0x0000000106968b13 RNTester`std::__1::lock_guard<std::__1::mutex>::lock_guard[abi:ue170006](this=0x00007ff7b95e2478, __m=0x000060000377c958) at lock_guard.h:35:10
    frame https://github.com/facebook/react-native/issues/5: 0x00000001069689ed RNTester`std::__1::lock_guard<std::__1::mutex>::lock_guard[abi:ue170006](this=0x00007ff7b95e2478, __m=0x000060000377c958) at lock_guard.h:34:19
    frame https://github.com/facebook/react-native/issues/6: 0x00000001070691c1 RNTester`-[RCTInstance invalidate](self=0x000060000377c900, _cmd="invalidate") at RCTInstance.mm:146:31
    frame https://github.com/facebook/react-native/issues/7: 0x0000000107060fd2 RNTester`-[RCTHost didReceiveReloadCommand](self=0x0000600003d100f0, _cmd="didReceiveReloadCommand") at RCTHost.mm:317:3
    frame https://github.com/facebook/react-native/issues/8: 0x0000000106b005a5 RNTester`RCTTriggerReloadCommandListeners(reason=@"Global hotkey") at RCTReloadCommand.m:57:5
    frame https://github.com/facebook/react-native/issues/9: 0x0000000106b86da5 RNTester`__28-[RCTDevSettings initialize]_block_invoke.157(.block_descriptor=0x0000000107496170, params=0x00007ff84002f610) at RCTDevSettings.mm:201:11
    frame https://github.com/facebook/react-native/issues/10: 0x0000000106ae658e RNTester`__65-[RCTPackagerConnection reconnectingWebSocket:didReceiveMessage:]_block_invoke.68(.block_descriptor=0x0000600000c82df0) at RCTPackagerConnection.mm:293:9
    frame https://github.com/facebook/react-native/issues/11: 0x0000000109a4529d libdispatch.dylib`_dispatch_call_block_and_release + 12
    frame https://github.com/facebook/react-native/issues/12: 0x0000000109a4658f libdispatch.dylib`_dispatch_client_callout + 8
    frame https://github.com/facebook/react-native/issues/13: 0x0000000109a563ee libdispatch.dylib`_dispatch_main_queue_drain + 1362
    frame https://github.com/facebook/react-native/issues/14: 0x0000000109a55e8e libdispatch.dylib`_dispatch_main_queue_callback_4CF + 31
    frame https://github.com/facebook/react-native/issues/15: 0x00007ff800429af4 CoreFoundation`__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
    frame https://github.com/facebook/react-native/issues/16: 0x00007ff80042442f CoreFoundation`__CFRunLoopRun + 2463
    frame https://github.com/facebook/react-native/issues/17: 0x00007ff8004236ad CoreFoundation`CFRunLoopRunSpecific + 557
    frame https://github.com/facebook/react-native/issues/18: 0x00007ff8103da08f GraphicsServices`GSEventRunModal + 137
    frame https://github.com/facebook/react-native/issues/19: 0x00007ff805cc0ad1 UIKitCore`-[UIApplication _run] + 972
    frame https://github.com/facebook/react-native/issues/20: 0x00007ff805cc5551 UIKitCore`UIApplicationMain + 123
    frame https://github.com/facebook/react-native/issues/21: 0x00000001069205a0 RNTester`main(argc=1, argv=0x00007ff7b95e3b60) at main.m:15:12
    frame https://github.com/facebook/react-native/issues/22: 0x00000001099023e0 dyld_sim`start_sim + 10
    frame https://github.com/facebook/react-native/issues/23: 0x0000000116b92366 dyld`start + 1942

(lldb) bt
* thread https://github.com/facebook/react-native/issues/3
    frame #0: 0x000000010a5c6b86 libsystem_kernel.dylib`__ulock_wait + 10
    frame https://github.com/facebook/react-native/issues/1: 0x0000000109a46eb1 libdispatch.dylib`_dlock_wait + 46
    frame https://github.com/facebook/react-native/issues/2: 0x0000000109a46d08 libdispatch.dylib`_dispatch_thread_event_wait_slow + 40
    frame https://github.com/facebook/react-native/issues/3: 0x0000000109a5774a libdispatch.dylib`__DISPATCH_WAIT_FOR_QUEUE__ + 371
    frame https://github.com/facebook/react-native/issues/4: 0x0000000109a57161 libdispatch.dylib`_dispatch_sync_f_slow + 240
    frame https://github.com/facebook/react-native/issues/5: 0x0000000106b3b33b RNTester`RCTUnsafeExecuteOnMainQueueSync(block=0x0000000106f116c0) at RCTUtils.m:291:5
  * frame https://github.com/facebook/react-native/issues/6: 0x0000000106f115ad RNTester`-[RCTFabricSurface start](self=0x000000010af0df40, _cmd="start") at RCTFabricSurface.mm:102:3
    frame https://github.com/facebook/react-native/issues/7: 0x00000001070601ce RNTester`__108-[RCTHost initWithBundleURLProvider:hostDelegate:turboModuleManagerDelegate:jsEngineProvider:launchOptions:]_block_invoke_2(.block_descriptor=0x0000600000c75590) at RCTHost.mm:211:9
    frame https://github.com/facebook/react-native/issues/8: 0x000000010706cdc8 RNTester`-[RCTInstance _loadScriptFromSource:](self=0x000060000377c900, _cmd="_loadScriptFromSource:", source=0x0000600000cd57d0) at RCTInstance.mm:472:5
    frame https://github.com/facebook/react-native/issues/9: 0x000000010706ca81 RNTester`__29-[RCTInstance _loadJSBundle:]_block_invoke.120(.block_descriptor=0x0000600000c96d00, error=0x0000000000000000, source=0x0000600000cd57d0) at RCTInstance.mm:452:9
    frame https://github.com/facebook/react-native/issues/10: 0x0000000106ab1919 RNTester`invocation function for block in attemptAsynchronousLoadOfBundleAtURL(.block_descriptor=0x00006000017b0fc0, statusCode=200, headers=6 key/value pairs, data=0x00006000002a4760, error=0x0000000000000000, done=YES) block_pointer, void (NSError*, RCTSource*) block_pointer) at RCTJavaScriptLoader.mm:318:9
    frame https://github.com/facebook/react-native/issues/11: 0x0000000106ad92a6 RNTester`__80-[RCTMultipartDataTask URLSession:streamTask:didBecomeInputStream:outputStream:]_block_invoke(.block_descriptor=0x000070000035c7a0, headers=6 key/value pairs, content=0x00006000002a4760, done=YES) at RCTMultipartDataTask.m:121:9
    frame https://github.com/facebook/react-native/issues/12: 0x0000000106ad9b4f RNTester`-[RCTMultipartStreamReader emitChunk:headers:callback:done:](self=0x00006000002b4220, _cmd="emitChunk:headers:callback:done:", data=0x00006000002a4020, headers=6 key/value pairs, callback=0x0000000106ad9230, done=YES) at RCTMultipartStreamReader.m:57:5
    frame https://github.com/facebook/react-native/issues/13: 0x0000000106ada800 RNTester`-[RCTMultipartStreamReader readAllPartsWithCompletionCallback:progressCallback:](self=0x00006000002b4220, _cmd="readAllPartsWithCompletionCallback:progressCallback:", callback=0x0000000106ad9230, progressCallback=0x0000000106ab2a60) at RCTMultipartStreamReader.m:154:7
    frame https://github.com/facebook/react-native/issues/14: 0x0000000106ad9130 RNTester`-[RCTMultipartDataTask URLSession:streamTask:didBecomeInputStream:outputStream:](self=0x00006000017b0d40, _cmd="URLSession:streamTask:didBecomeInputStream:outputStream:", session=0x000000010e02a0a0, streamTask=0x000000010c83ba00, inputStream=0x000060000300d4d0, outputStream=0x000060000300c990) at RCTMultipartDataTask.m:119:20
    frame https://github.com/facebook/react-native/issues/15: 0x00007ff80479fdf9 CFNetwork`___lldb_unnamed_symbol2876 + 42
    frame https://github.com/facebook/react-native/issues/16: 0x0000000109a4529d libdispatch.dylib`_dispatch_call_block_and_release + 12
    frame https://github.com/facebook/react-native/issues/17: 0x0000000109a4658f libdispatch.dylib`_dispatch_client_callout + 8
    frame https://github.com/facebook/react-native/issues/18: 0x0000000109a4e4ba libdispatch.dylib`_dispatch_lane_serial_drain + 1127
    frame https://github.com/facebook/react-native/issues/19: 0x0000000109a4f255 libdispatch.dylib`_dispatch_lane_invoke + 441
    frame https://github.com/facebook/react-native/issues/20: 0x0000000109a5c356 libdispatch.dylib`_dispatch_root_queue_drain_deferred_wlh + 318
    frame https://github.com/facebook/react-native/issues/21: 0x0000000109a5b751 libdispatch.dylib`_dispatch_workloop_worker_thread + 590
    frame https://github.com/facebook/react-native/issues/22: 0x00000001099dfb84 libsystem_pthread.dylib`_pthread_wqthread + 327
    frame https://github.com/facebook/react-native/issues/23: 0x00000001099deacf libsystem_pthread.dylib`start_wqthread + 15
```

## Changelog:

[IOS] [FIXED] - Fixes main thread stuck when reload in bridgeless mode

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

Test Plan: RNTester, enables fabric, which is very easy to repro by tapping `r`  command multiple times quickly to trigger reload.

Reviewed By: philIip

Differential Revision: D59911929

Pulled By: cipolleschi

fbshipit-source-id: e7e431a11d26c399fa767b6cbf45e16bce24b9a0
2024-08-02 13:48:31 -07:00
Ruslan Shestopalyuk 878e1f3d93 Migrate NativeArray classes to Kotlin (#44569)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44569

# Changelog:
[Internal] -

This converts the vertical of NativeArray/ReadableNativeArray/WritableNativeArray classes to Kotlin.

NOTE: the `getArray`, `getMap` and `getString` being annotated as `NonNull` in the Java code is a scam - there is no guarantee that native side will send non-null to the Java side, and in practice, indeed, in certain cases it doesn't. So I opted to make it nullable instead - this way it's at least explicit and is not a ticking bomb hidden to explode behind the false sense of security.

Reviewed By: javache

Differential Revision: D57327835

fbshipit-source-id: 1b546b2ff22af2be903fe6ab91f0148b645595fb
2024-08-02 10:56:27 -07:00
Rubén Norte 631d4dea25 Migrate Web Performance API tests to Flow (#45875)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45875

Changelog: [internal]

Just adopting Flow in all tests in `react-native/src/private` :)

Reviewed By: rshest

Differential Revision: D60654714

fbshipit-source-id: 34a9ae618fbd254044e2faf801adccc12fc0e244
2024-08-02 10:19:49 -07:00
Rubén Norte ed63646fc2 Move ErrorHandlers to react-native/src/private (#45876)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45876

Changelog: [internal]

Reviewed By: dmytrorykun

Differential Revision: D60597776

fbshipit-source-id: 1093aee0f2b84312b55a2b0c22e2b1576c60e26e
2024-08-02 10:19:49 -07:00
Rubén Norte e14b5f1d6f Move default export of PerformanceObserver to named export (#45874)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45874

Changelog: [internal]

Move default export of `PerformanceObserver` to named export.

Reviewed By: sammy-SC

Differential Revision: D60597779

fbshipit-source-id: 39f82c1903aa32a5318b112cbb03b63e4e6d2fc0
2024-08-02 10:19:49 -07:00
Nicola Corti 52fc64c602 Unbreak build_android by not depending on PreferenceManager from androidx (#45872)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45872

build_android is currently broken, this should fix it.

Changelog:
[Internal] [Changed] - Unbreak build_android by not depending on PreferenceManager from androidx

Reviewed By: cipolleschi, hezi

Differential Revision: D60652912

fbshipit-source-id: a089609c6643c40c95919fdc882a89406f6ce871
2024-08-02 09:14:01 -07:00
Ruslan Shestopalyuk 51278d3f30 Migrate UIManager interface to Kotlin (#44589)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44589

## Changelog:
[Internal] -

As in the title.

Reviewed By: tdn120

Differential Revision: D57434432

fbshipit-source-id: ce2504d5a27a9e8dd8d8d02b052b6cf9414491ab
2024-08-02 07:10:36 -07:00
Ruslan Shestopalyuk de73e44569 Migrate Promise interface to Kotlin (#44587)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44587

# Changelog:
[Internal] -

As in the title, moving towards migrating all the interfaces in react.bridge.

Reviewed By: tdn120

Differential Revision: D57433401

fbshipit-source-id: 35581d27d6d093edb1cc59b245e6468758825f68
2024-08-02 06:38:55 -07:00
Antony M. Kithinzi 491c3e9d76 chore: migrate GenerateCodegenArtifactsTaskTest to assertj (#45845)
Summary:
Issue: https://github.com/facebook/react-native/issues/45596

## 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] - Migrated `packages/gradle-plugin/react-native-gradle-plugin/src/test/kotlin/com/facebook/react/tasks/GenerateCodegenArtifactsTaskTest.kt` to assertj.

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

Test Plan: Run `./gradlew -p packages/gradle-plugin test`

Reviewed By: hezi

Differential Revision: D60597025

Pulled By: cortinico

fbshipit-source-id: 4228b958c7b9e1506640b9ff217f098e2626ea81
2024-08-02 04:08:08 -07:00
Omar Bafagih ea78d68906 Migrate PackagerConnectionSettings.java to Kotlin (#45800)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45800

convert PackagerConnectionSettings.java to PackagerConnectionSettings.kt

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D60296462

fbshipit-source-id: 77a4ef164cd3405c3b7c85ecb301ae6e1d965e57
2024-08-01 14:28:57 -07:00
Ruslan Shestopalyuk c8a1da4c9e Migrate JavaTimerManager to Kotlin (#45820)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45820

# Changelog:
[Internal] -

As in the title.

Reviewed By: mdvacca

Differential Revision: D60449157

fbshipit-source-id: c3c8ae9bcc270d421ee71deef0159477206c6ca3
2024-08-01 14:03:13 -07:00
Nicola Corti 9679756682 Re-apply Use BackgroundStyleApplicator in View setters on ReactImageView.kt
Summary:
This re-applies D60495100 after I've fixed the history for `ReactImageView`.

bypass-github-export-checks

Changelog:
[Internal] [Changed] - Re-apply Use BackgroundStyleApplicator in View setters on ReactImageView.kt

Reviewed By: NickGerleman

Differential Revision: D60578453

fbshipit-source-id: 995f5e54ea6ca3161935e8b7814df390d827a463
2024-08-01 13:31:06 -07:00
Nicola Corti fd231c5eaf Convert com.facebook.react.views.image to Kotlin
Summary:
This converts the 3 remaining files inside `com.facebook.react.views.image` to Kotlin

bypass-github-export-checks

Changelog:
[Internal] [Changed] - Convert com.facebook.react.views.image to Kotlin

Reviewed By: NickGerleman

Differential Revision: D60578452

fbshipit-source-id: 6a5951f1f74561c1c45fe697e7cfc68fcec92412
2024-08-01 13:31:06 -07:00
Nicola Corti 6393a3cd78 Back out "Convert com.facebook.react.views.image to Kotlin"
Summary:
bypass-github-export-checks

Changelog:
[Internal] [Changed] - Back out "[RN][Android] Convert com.facebook.react.views.image to Kotlin"

Original commit changeset: 72450d37969b

Original Phabricator Diff: D60170084

Reviewed By: sammy-SC, rshest

Differential Revision: D60578451

fbshipit-source-id: b6c57eaf1e3cceff43b10680f6b9abf53cbf8605
2024-08-01 13:31:06 -07:00
Nick Gerleman 5f14963da0 Breaking: Set "enableBackgroundStyleApplicator" by default (#45866)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45866

This turns on enableBackgroundStyleApplicator() by default, which will get us more screenshot tests over existing apps, and let us add new screenshot tests for box-shadow against stock RNTester.

This is a breaking change, for the small number of libraries which use CSSBackgroundDrawable/ReactViewBackgroundDrawable off of a view directly, for setting or accessing styles (this was already unreliably), along with libraries which read `mBorderRadius` from views using reflection. This is more or less confined to Reanimated, react-native-navigation, and one internal library.

Users who want to access or mutate background styles should use the public `BackgroundStyleApplicator` instead.

Changelog:
[Android][Breaking] - Set "enableBackgroundStyleApplicator" by default

Reviewed By: joevilches

Differential Revision: D60365677

fbshipit-source-id: aab8588b27c1125920adb257406c53dadb356767
2024-08-01 12:06:40 -07:00
Abdelhafidh Belalia 48669af562 Android: Fix uploading GIF URI (#45826)
Summary:
In Android, when constructing a multipart body for a file and that file source is a uri (base64-encoded) we do the following:
1. Decode the base64 string into bytes
2. Create a bitmap object
3. Compress the bitmap object as PNG into new bytes

The process does an unnecessary work (bytes -> bitmap -> bytes) and creates unexpected results e.g. a GIF file will be converted into PNG when uploaded. This PR removes the unnecessary steps (2 and 3).

## Changelog:

[ANDROID] [FIXED] - Fix uploading GIF URI

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

Test Plan:
1. Upload a GIF; use URI (base64-encoded)
2. Verify that the uploaded file is a GIF

```js
const formData = new FormData();
formData.append('photo', {
  uri: GIFURI,
  type: 'image/gif',
  name: 'photo.gif',
});

fetch(UPLOAD_URL,
{
    body: formData,
    method: "POST",
}):
```

| Before | After |
|:------:|:-----:|
|   <video src="https://github.com/user-attachments/assets/6ce4769a-8fa5-4d00-8066-9a1911608632" />     |  <video src="https://github.com/user-attachments/assets/76a29d14-ce9d-48cd-94d0-7591064a5b1b" />      |

Reviewed By: cortinico

Differential Revision: D60515478

Pulled By: tdn120

fbshipit-source-id: d6ad1c42631c184c3dcdf3a956641e25d0c1b926
2024-08-01 12:04:42 -07:00
Jorge Cabiedes Acosta 54a6438eaa Fix default imageSource on Filters example (#45799)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45799

No idea how I missed this but I don't think `defaultProps` is a thing in React Native? So the images were not showing

Changelog: [internal]

Reviewed By: joevilches

Differential Revision: D60392853

fbshipit-source-id: 27280033fb719340a809053d6ca98ac3f178c8c3
2024-08-01 10:38:53 -07:00
Nishan bd0aedc8c3 feat: linear gradient android (#45433)
Summary:
- Adds `background` prop that supports CSS's linear gradient. Later this can be extended to support various other gradients and possibly CSS's background image (less motivation as better solutions exists for image)
- Extended `CSSBackgroundDrawable` to draw Linear Gradient shader while preserving the border style support.
- Style supports JS object to specify `LinearGradient`, so it can support Animated libraries.

## Changelog:
[ANDROID] [ADDED] - linear gradient

<!-- 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/45433

Test Plan:
- Check out `processBackground-test.js` for supported syntax testcases.
- Checkout examples added in `LinearGradientExample.js`

Although the PR is tested well but open to any changes/feedback on the approach taken.

iOS PR - https://github.com/facebook/react-native/pull/45433. Separated the PRs to keep it easier to review. Both PRs can be reviewed individually.

Reviewed By: joevilches

Differential Revision: D60493360

Pulled By: NickGerleman

fbshipit-source-id: 762929c4fe16d87cbbd9ebe83ecce96a9e13192c
2024-08-01 09:38:51 -07:00
Ruslan Shestopalyuk 6483a28b3a Convert modules/core/ReactChoreographer to Kotlin (#45811)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45811

# Changelog:
[Internal] -

Converts both ReactChoreographer.java and ChoreographerCompat.java to Kotlin.

Reviewed By: mdvacca

Differential Revision: D60445731

fbshipit-source-id: 597c9f2ea1a89ee13a210a4b3e172ea239297ae7
2024-08-01 06:59:40 -07:00
Ruslan Shestopalyuk c30ee464eb Kotlinify AnimationDriver (#45836)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45836

# Changelog:
[Internal] -

As in the title.

Reviewed By: cortinico

Differential Revision: D60502487

fbshipit-source-id: 003f2eade8f8425636b2023397ec29545175b487
2024-08-01 03:52:44 -07:00
Nick Gerleman fdfa0b17bb Enable BackgroundStyleApplicator and boxShadow for View (#45832)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45832

The main one! This allows box-shadow to be used in View, and uses BackgroundStyleApplicator (if flag is enabled) for background management.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D60491176

fbshipit-source-id: c068b1dc971253f1303de5bae62e42a9eceb0de6
2024-07-31 23:49:48 -07:00
Nick Gerleman 087193c98e Add missing invalidate() to setOverflow() (#45835)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45835

`ReactViewBackgroundManager` will do this for us (and otherwise doesn't do anything draw related), but this will be removed when BackgroundStyleApplicator is rolled out, and not all callers use `ReactViewBackgroundManager`.

Changelog:
[Android][Fixed]

Reviewed By: philIip

Differential Revision: D60489756

fbshipit-source-id: 37cfc2b90af057bc142ad95b93e32941edb17ca5
2024-07-31 23:49:48 -07:00
Nick Gerleman 7047b7eaeb BackgroundStyleApplicator and boxShadow in TextInput (#45831)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45831

Like the previous diffs, but for TextInput!

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D60489444

fbshipit-source-id: 13edc2fada0ef55a84916e6bdff151e4f8a16d34
2024-07-31 23:49:48 -07:00