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