Summary:
The margin/padding props were introduced in this diff: D41267765
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D56846578
fbshipit-source-id: 396cab3fdd63d9c630690157a385f1ae53208bb7
Summary:
The insets props were introduced in this diff: D42193661
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D56849870
fbshipit-source-id: 7be2a5825086ac954fdb8bc3bb86b57a2fa6d326
Summary:
ViewManagers are all BaseJavaModule, and thus have access to methods like `getReactApplicationContext`. We don't expose the appropriate constructors though to pass this context down from the base class.
Not a breaking change, as the no-arg constructor is still used implicitly.
Changelog: [Android][Fixed] ViewManagers can pass context to their base class.
Reviewed By: fabriziocucci
Differential Revision: D56804318
fbshipit-source-id: b0e6b15dfd7786073da058beccfaba2ff30daf5a
Summary:
This removes the bulk of code added in https://github.com/facebook/react-native/pull/39630.
We're not shipping it, as it caused performance regressions.
Changelog:
[Internal]
Reviewed By: christophpurrer
Differential Revision: D56796936
fbshipit-source-id: 82f3a51cf145bc1695d70393e1f050685a1e6174
Summary:
On the new architecture on Android on the new arch, `textAlign` style was ignored (`Layout.Alignment.ALIGN_NORMAL` was always used) during the measurement of text. During this phase, the positions of attachments are also calculated, which results in inline views being always positioned as if alignment to the left was set. This PR updates the measurement logic to also take `textAlign` into account during measurement.
Fixes https://github.com/facebook/react-native/issues/41008
## Changelog:
[ANDROID] [FIXED] - Fixed `textAlign` not being taken into account when positioning views inlined in text
Pull Request resolved: https://github.com/facebook/react-native/pull/44146
Test Plan:
<details>
<summary>I've been testing on the following code</summary>
```jsx
import { SafeAreaView, Text, View } from "react-native";
function InlineView(props) {
return (<View style={{margin: 10}} >
<Text style={{ textAlign: props.textAlign, backgroundColor: 'cyan' }}>
Parent Text
<Text style={{ fontWeight: 'bold' }}>Child Text</Text>
<View style={{width: 50, height: 50, backgroundColor: 'red'}} />
<Text style={{ fontWeight: 'bold' }}>Child Text</Text>
{props.long && <Text style={{ fontWeight: 'bold' }}>aaaa a aaaa aaaaaa aaa a a a aaaaa sdsds dsdSAD asd ASDasd ASDas</Text>}
</Text>
</View>)
}
export default function Test() {
return (
<SafeAreaView style={{ flex: 1 }}>
<Text style={{textAlign: 'center', fontSize: 20}}>BoringLayout</Text>
<InlineView textAlign="left" />
<InlineView textAlign="center" />
<InlineView textAlign="right" />
<InlineView textAlign="justify" />
<Text style={{textAlign: 'center', fontSize: 20}}>StaticLayout</Text>
<InlineView textAlign="left" long />
<InlineView textAlign="center" long />
<InlineView textAlign="right" long />
<InlineView textAlign="justify" long/>
</SafeAreaView>
);
}
```
</details>
| Old architecture | New architecture |
|------------------|------------------|
| <img width="447" alt="Screenshot 2024-04-18 at 17 08 59" src="https://github.com/facebook/react-native/assets/21055725/b21848ff-3939-4dde-9f78-03ce50c9429a"> | <img width="447" alt="Screenshot 2024-04-18 at 17 04 46" src="https://github.com/facebook/react-native/assets/21055725/fb57a3c4-09e8-4db7-abc3-79747314529b"> |
Reviewed By: NickGerleman, cipolleschi
Differential Revision: D56361169
Pulled By: cortinico
fbshipit-source-id: c3002f65541774e376e315c3076a6157aa330f8d
Summary:
One way we register cxx turbo modules with React Native is via cxxreactpackages.
This diff allows the application to pass in cxxreactpackages into the default react host, which allows the application to, in turn, register cxx modules with react native!
Changelog: [Android][Added] - Allow bridgeless apps to register cxx modules via cxxreactpackages
Reviewed By: cortinico
Differential Revision: D56547493
fbshipit-source-id: 4e8f02f0546c4b647a915fc65ea9687aa1592190
Summary:
There are a couple scenarios where flattening the child of a ScrollView can cause problems.
1. `maintainVisibleContentPosition` on both Android and iOS rely on reading live positions in the view tree
2. `snapToAlignment` on Android uses live view tree, for items to snap to. iOS seems to have very different behavior, and aligns assuming that children are scroll view height, or that a snap interval has been set.
This change adds a prop `collapsableChildren` which can be used to disable children of scroll content view from being collapsed.
Differentiator is... complicated... but we can mostly just adapt the code dealing with existing traits at the surface level.
Changelog:
[General][Fixed] - Automatically disable flattening of scroll content view children when needed
[General][Added] - Add `collapsableChildren` prop
Reviewed By: javache
Differential Revision: D56226241
fbshipit-source-id: ed81f7fff5a15eac424708f763afc9b844aefa9c
Summary:
This change is a preliminary change to add support to `Long` and `long` React props that are required for supporting WideGamut color space.
## Changelog
[Android][Added] - Extend Property Processor to support long props
Reviewed By: cortinico
Differential Revision: D56461183
fbshipit-source-id: 0f70388abe2b414a09df640f04e767f1164d63ce
Summary:
This adds support for enabling wide color gamut mode for ReactActivity per the wide gamut color [RFC](https://github.com/react-native-community/discussions-and-proposals/pull/738).
## Changelog:
[ANDROID] [ADDED] - Add isWideColorGamutEnabled to ReactActivityDelegate
Pull Request resolved: https://github.com/facebook/react-native/pull/43036
Test Plan:
Update RNTesterActivity.kt to enable wide color gamut:
```diff
class RNTesterActivity : ReactActivity() {
class RNTesterActivityDelegate(val activity: ReactActivity, mainComponentName: String) :
// ...
override fun getLaunchOptions() =
if (this::initialProps.isInitialized) initialProps else Bundle()
+ override fun isWideColorGamutEnabled() = true
}
```
Reviewed By: cortinico
Differential Revision: D55749124
Pulled By: cipolleschi
fbshipit-source-id: 44dd5631e1a2e429c86c01ed8747bbebbc8bdb3b
Summary:
This adds support for color function values to ColorPropConverter per the wide gamut color [RFC](https://github.com/react-native-community/discussions-and-proposals/pull/738). It updates the color conversion code so that it returns a Color instance before ultimately being converted to an Integer in preparation for returning long values as needed.
bypass-github-export-checks
## Changelog:
[ANDROID] [ADDED] - Update ColorPropConverter to support color function values
Pull Request resolved: https://github.com/facebook/react-native/pull/43031
Test Plan:
Colors should work exactly the same as before.
Follow test steps from https://github.com/facebook/react-native/pull/42831 to test support for color() function syntax.
While colors specified with color() function syntax will not yet render in DisplayP3 color space they will not be misrecognized as resource path colors but will instead fallback to their sRGB color space values.
Reviewed By: cortinico
Differential Revision: D55749058
Pulled By: cipolleschi
fbshipit-source-id: 37659d22c1db4b1a27a9a4f88c9beb703517b01f
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42115
React Native Android had a concept called JSIModules, which iOS doesn't have. The JSIModule concept was introduced in the early stages of the Fabric project to represent modules that interact with JS through JSI and they are not NativeModules.
In the new architecture this concept is not really necessary and these interfaces were only used to initialize and destroy the Fabric renderer and TurboModule Manager in react native core. Bridgeless mode doesn’t use JSIModule anymore. Also, it has an explicit list of supported JSI module types, so is not open for extension.
In order to simplify RN concepts and reduce confusion with TurboModules, which also "use JSI", deleting everything related to JSIModule. This was already deprecated in 0.74.0.
Please use ReactInstanceEventListener to subscribe for react instance events instead of getJSIModule() and we recommend using TurboModules instead of JSIModules.
Changelog:
[General][Breaking] Delete JSIModule
Reviewed By: javache, cortinico
Differential Revision: D49597702
fbshipit-source-id: bc2bc190aafaf559336b341b50ffabf413474105
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44096
These Android only APIs have been deprecated and are being removed for 0.75 release.
Changelog:
[Android][Removed] - UIManager.showPopupMenu() and UIManager.dismissPopupMenu() have been removed
Reviewed By: RSNara
Differential Revision: D56041827
fbshipit-source-id: e2afebf55860f33d2c8d1887e865adb4dd555e6c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44132
Changelog: [Breaking][Android] `DevSupportManagerFactory.create()` changed to take an additional parameter of type `PausedInDebuggerOverlayManager` (nullable)
Enables integrators of React Native Android to supply their own implementation of the Fusebox "paused in debugger" overlay. This is primarily intended for legacy Meta-internal integrations that can't use the built-in implementation based on `Dialog`. **The API will likely go away once those integrations have been migrated.**
Reviewed By: javache
Differential Revision: D56215119
fbshipit-source-id: 9cd79a6948c268a952ac28e5563ae57c90756da7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44082
Changelog: [Internal]
Adds the ability to interactively resume/step from the Fusebox "paused in debugger" overlay on Android. This uses HostCommands (D56098083) and extends the AlertDialog-based overlay (D56068445). In an upcoming diff on this stack, we'll update the design of the overlay to match Chrome's.
Reviewed By: hoxyq
Differential Revision: D56098084
fbshipit-source-id: 587b8bac7b0dd636363fc28ea7d0577b1a52d5c7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44079
Changelog: [Internal]
Implements an unstyled, non-interactive version of the "paused in debugger" in-app overlay in Fusebox on Android, based on the event introduced in D56068444. The implementation in `DevSupportManagerBase` is shared across Bridge and Bridgeless.
In upcoming diffs in this stack, we'll add interactive features (namely "resume" and "step over" buttons, like in Chrome) and improve the visual styling of this overlay.
Reviewed By: hoxyq
Differential Revision: D56068445
fbshipit-source-id: a9ac2765d29d64615751b5cdf03939e0b84d2545
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44105
Previously, we skipped calling the ReactDelegate callback functions when the ReavtNavigationFragment was destroyed because it set the current activity to null when we need to actually keep the reference to the activity. However, skipping this entirely also skips core clean up logic, such as running the return() function for useEffect().
Instead of skipping the callback function entirely, we just need to make sure we don't set mCurrentActivity to null. I followed D30504616 to configure an option to not set mCurrentActivity to null if mKeepActivity flag is set on the ReactInstanceManager.
Changelog: [Internal]
Reviewed By: keoskate
Differential Revision: D56167533
fbshipit-source-id: cb3620e21599683e0c6bbc5a6a9c4f384fdbcc51
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44104
We previously added the option to skip calling the delegate lifecycle events in D55646221 to support fragment-based navigation. However, we don't actually want to skip calling these events as they run some core clean up logic, such as calling the return value of useEffect(). There's a better way to get this working with fragment-based nav (see next diff).
Changelog:
[Internal] [Changed] - Remove option to skip calling delegate on ReactFragment lifecycle events
Reviewed By: keoskate, cortinico
Differential Revision: D56167614
fbshipit-source-id: 3a4b91a303a27c0e19644a4e6611229211a1e530
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44116
This is just the bridgeless analogue to .hasCatalystInstance()
Changelog: [Android][Added] - Introduced ReactContext.hasReactInstance() to replace .hasCatalystInstance()
Reviewed By: fabriziocucci
Differential Revision: D56164488
fbshipit-source-id: 8be4676e18dc7df4765746f46cf36e62405b4ffa
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44078
Changelog: [Internal]
Adds stub support for the [`Overlay.setPausedInDebuggerMessage`](https://cdpstatus.reactnative.dev/devtools-protocol/tot/Overlay#method-setPausedInDebuggerMessage) CDP method to `HostAgent` in the Fusebox backend, and propagates it into the Android and iOS integrations through `HostTargetDelegate`.
We take care to call `HostTargetDelegate::onSetPausedInDebuggerMessage()` a final time with a null `message` parameter, regardless of whether the client has actually sent the corresponding CDP message. Since multiple clients might be connected concurrently, we only send the `null` message when the *last* client which has requested a non-null message has disconnected.
Reviewed By: robhogan
Differential Revision: D56068444
fbshipit-source-id: c26e1cf17dec8d7dbb7edd5ab7fa3133642628ff
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43983
We duplicate some pretty hairy code related to conversion between logical and physical edges, along with the grafting between uniform and non uniform radii. This encapsulates border radius resolution/assignment logic.
Changelog: [Internal]
Reviewed By: alanleedev
Differential Revision: D55635743
fbshipit-source-id: 906c35af2bf18f0586d71d05f9cf61d4248ede1e
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43720
This lets us use BG drawing code in rules which view depends on. I also removed some lib usage.
The original class is still present, subclassing the class in its new location, but is marked deprecated.
Next diffs in stack clean up some of our own now deprecated usage.
Changelog:
[Android][Breaking] - Deprecate `ReactViewBackgroundDrawable` in favor of `CSSBackgroundDrawable`
Reviewed By: javache
Differential Revision: D55565035
fbshipit-source-id: 501b3e2f674c09a88b1825657ba6349823054e8c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44022
changelog: [internal]
move the new state reconciliation algorithm to the unified feature flag system.
Reviewed By: rubennorte
Differential Revision: D55965530
fbshipit-source-id: 3edde0858a670e86dc2d1cb561f03f584ff21896
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44026
Changelog: [Android][Removed] Delete ReactContext.initializeWithInstance(). ReactContext now no longer contains legacy react instance methods. Please use BridgeReactInstance instead.
Yet another attempt to land this (last one was D55505416).
Copy-pasting below the amazing summary from RSNara.
## Context
Prior, ReactContext used to implement bridge logic.
For bridgeless mode, we created BridgelessReactContext < ReactContext
## Problem
This could lead to failures: we could call bridge methods in bridgeless mode.
## Changes
Primary change:
- Make all the react instance methods inside ReactContext abstract.
Secondary changes: Implement react instance methods in concrete subclasses:
- **New:** BridgeReactContext: By delegating to CatalystInstance
- **New:** ThemedReactContext: By delegating to inner ReactContext
- **Unchanged:** BridgelessReactContext: By delegating to ReactHost
## Auxiliary changes
This fixes ThemedReactContext in bridgeless mode.
**Problem:** Prior, ThemedReactContext's react instance methods did not work in bridgeless mode: ThemedReactContext wasn't initialized in bridgeless mode, so all those methods had undefined behaviour.
**Solution:** ThemedReactContext now implements all react instance methods, by just forwarding to the initialized ReactContext it decorates (which has an instance).
NOTE: Intentionally not converting `BridgeReactContext` to Kotlin to minimize the risk of these changes.
Reviewed By: RSNara
Differential Revision: D55964787
fbshipit-source-id: b404efe0c7095894fa815165cc8682f78dccfa17
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43861
Changelog: [Internal]
_____
## Why?
We recommend to use Kotlin for any new code and are actively migrating Java code to Kotlin. This codemod service attempts to migrate existing Java code to Kotlin.
## How was this diff generated?
This codemod service scans through qualified paths and looks for Java modules. Then it runs `kotlinator.sh` on each module, which generated this diff.
## What if I see problems in this diff?
We recommend commandeering and fixing the diff. If you reject or abandon the diff, the codemod service will regenerate it in a few days
- Script for easily commandeer & open diff: In fbandroid, `scripts/commandeer_and_checkout.sh <DIFF>`. It not only commandeer the diff, but also rebase & open diff in Android Studio.
- Report repeating issues in [Kotlinator Papercut](https://fburl.com/papercuts/1g4f4qas)
See more useful tips & scripts in [Kotlin Auto-Conversion Codemod Wiki](https://fburl.com/wiki/c68ka0pu)
_____
## Questions / Comments / Feedback?
**Your feedback is important to us! Give feedback about this diff by clicking the "Provide Feedback" button below.**
* Returning back to author or abandoning this diff will only cause the diff to be regenerated in the future.
* Do **NOT** post in the CodemodService Feedback group about this specific diff.
_____
## Codemod Metadata
NOTE: You won't need to read this section to review this diff.
https://www.internalfb.com/intern/sandcastle/job/22517999373069959/
|Oncall|[kotlin_in_fb4a](https://our.intern.facebook.com/intern/oncall3/?shortname=kotlin_in_fb4a)|
|CodemodConfig|[fbsource/kotlinator.json](https://www.internalfb.com/codemod_service/fbsource%2Fkotlinator.json)|
|ConfigType|configerator|
Rules run:
- CodemodTransformerFBSourceScript
This diff was created with [CodemodService](https://fburl.com/CodemodService).
Reviewed By: cortinico
Differential Revision: D55725451
fbshipit-source-id: fea231c0f11f41013bcf7a8a9b5cf65badf82503
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43981
Changelog: [Internal]
_____
## Why?
We recommend to use Kotlin for any new code and are actively migrating Java code to Kotlin. This codemod service attempts to migrate existing Java code to Kotlin.
## How was this diff generated?
This codemod service scans through qualified paths and looks for Java modules. Then it runs `kotlinator.sh` on each module, which generated this diff.
## What if I see problems in this diff?
We recommend commandeering and fixing the diff. If you reject or abandon the diff, the codemod service will regenerate it in a few days
- Script for easily commandeer & open diff: In fbandroid, `scripts/commandeer_and_checkout.sh <DIFF>`. It not only commandeer the diff, but also rebase & open diff in Android Studio.
- Report repeating issues in [Kotlinator Papercut](https://fburl.com/papercuts/1g4f4qas)
See more useful tips & scripts in [Kotlin Auto-Conversion Codemod Wiki](https://fburl.com/wiki/c68ka0pu)
_____
## Questions / Comments / Feedback?
**Your feedback is important to us! Give feedback about this diff by clicking the "Provide Feedback" button below.**
* Returning back to author or abandoning this diff will only cause the diff to be regenerated in the future.
* Do **NOT** post in the CodemodService Feedback group about this specific diff.
_____
## Codemod Metadata
NOTE: You won't need to read this section to review this diff.
https://www.internalfb.com/intern/sandcastle/job/27021599000417439/
|Oncall|[kotlin_in_fb4a](https://our.intern.facebook.com/intern/oncall3/?shortname=kotlin_in_fb4a)|
|CodemodConfig|[fbsource/kotlinator.json](https://www.internalfb.com/codemod_service/fbsource%2Fkotlinator.json)|
|ConfigType|configerator|
Rules run:
- CodemodTransformerFBSourceScript
This diff was created with [CodemodService](https://fburl.com/CodemodService).
Reviewed By: cortinico
Differential Revision: D55725602
fbshipit-source-id: b8b77bf97de5a0eda5b077d6c5441b9af36fc26b