Commit Graph

38536 Commits

Author SHA1 Message Date
David Vacca 5f7538cfdd Add default value for newArchitectureEnabled param (#46140)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46140

Add default value for newArchitectureEnabled param

changelog: [internal] internal

Reviewed By: shwanton

Differential Revision: D61621224

fbshipit-source-id: 728c91f9ce10ad5872f86cd223ea30c8f9bde413
2024-08-21 15:38:23 -07:00
Andrei Marchenko 954e294183 perf(virtualized-lists) removing rerender cells for every change of Virtualized list (#46103)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46103

Reducing the boundary of rerender of virtual lists. Previously with prop: "strictMode={true}" the VirtualizedList still re rendered each CellRenderer component. Because method getDerivedStateFromProps generated every time a new uniq state and the cells didn’t have a PureComponent. It helps to improve react performance for lists which have 5+ elements.

I reused recomended approach from react doc https://legacy.reactjs.org/blog/2018/06/07/you-probably-dont-need-derived-state.html#what-about-memoization

changelog: [internal]
Optimizing CellRenderer of VirtualizedList

Reviewed By: NickGerleman, sammy-SC

Differential Revision: D61493434

fbshipit-source-id: 917a33e48bd2f18e8ac150e5701d2e7c45dbe879
2024-08-21 14:23:07 -07:00
zhongwuzw 9239ad1c6b Clean up RCTParagraphComponentView & RCTParagraphTextView (#46125)
Summary:
Clean up some dead code after some refactoring of RCTParagraphComponentView.  cc cipolleschi

## Changelog:

[IOS] [FIXED] - Clean up RCTParagraphComponentView & RCTParagraphTextView

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

Test Plan: CI green.

Reviewed By: christophpurrer

Differential Revision: D61603193

Pulled By: cipolleschi

fbshipit-source-id: a357e8c5355707b2296462de513010acda4ee6ea
2024-08-21 12:19:33 -07:00
Soe Lynn b93c2b2412 Bump React Native CI to min iOS 15.1 (#46135)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46135

Changelog:
[iOS] - Bump iOS min version for CI

Reviewed By: cipolleschi

Differential Revision: D61604034

fbshipit-source-id: 5d2b0001b6437e62c64d821e36a4183096e8ef74
2024-08-21 12:11:58 -07:00
Soe Lynn d11c99922c Bump React Native OSS build infra to min iOS 15.1 (#46137)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46137

Changelog:
[iOS] - Bump OSS Build infra to min iOS 15.1

Reference: https://github.com/react-native-community/discussions-and-proposals/discussions/812

Reviewed By: christophpurrer

Differential Revision: D61577939

fbshipit-source-id: 8f2929af266f61aedd55358b13d08544fd79e434
2024-08-21 12:11:58 -07:00
Soe Lynn e1a1cdacf2 Update RNTester and HelloWorld to min iOS 15.1 (#46136)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46136

Changelog:
[iOS] - Update RNTester and HelloWorld template app to `min iOS 15.1`

Reviewed By: philIip, blakef

Differential Revision: D61604036

fbshipit-source-id: 9260b9b51a9c976792fd9d705b9b6a35a88a7f86
2024-08-21 12:11:58 -07:00
Krystof Woldrich 774fe0cf6f fix(react-native-xcode): Use CONFIG_CMD if set (#46112)
Summary:
In the recent 0.75 release I've noticed new `CONFIG_CMD` option in `react-native-xcode.sh`. But this option was not used. Insted when set `CONFIG_APP` was used.

This seems like a bug. As the usage before this PR would be as follow:

```bash
export CONFIG_CMD=true
export CONFIG_APP="/path/to/node /path/to/node_modules/react-native/cli.js config"
```

After this PR

```
export CONFIG_CMD="/path/to/node /path/to/node_modules/react-native/cli.js config"
```

This PR also removed unused explicite `--config-cmd "$CONFIG"` flag, as this is always overwriten by the code above, by default to `--config-cmd" "$NODE_BINARY $NODE_ARGS $REACT_NATIVE_DIR/cli.js config`.

## Changelog:

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

Pick one each for the category and type tags:

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

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

[iOS][Fixed] - Use CONFIG_CMD if set

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

Test Plan: I've set `CONFIG_CMD` and run Xcode Release build to check that the set command is executed.

Reviewed By: christophpurrer

Differential Revision: D61545010

Pulled By: blakef

fbshipit-source-id: ebbf8ebc08404bc6816277518a3b86c6f7e41e6e
2024-08-21 08:16:37 -07:00
Riccardo Cipolleschi 9c16fb3394 Fetch Github tags in the publish-release job (#46131)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46131

React native 0.75.0, 0.75.1 and 0.75.2 has been published to NPM without the latest tag, despite the tag being on the commit.

When debugging why that's happened, I realized that we were not downloading the tags when checking out the repo.

This change fixes that.

{F1816667285}

## Changelog:
[Internal] - Publish React native as latest when the latest tag is specified on git

Reviewed By: cortinico

Differential Revision: D61593398

fbshipit-source-id: 96bf8346207f0bd0b01f60ee09879210d12d30af
2024-08-21 07:46:13 -07:00
Alex Hunt 516428771d Disable native source code fetching in jsinspector-modern targets (#46132)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46132

Temporaily disable the `nativeSourceCodeFetching` capability — which reverts this to the legacy handling in the Inspector Proxy.

This is because we've noticed performance issues when loading large bundle source maps, particularly on Android, with a nontrivial path to optimising this ([raising the frontend `IO.read` size](https://github.com/facebookexperimental/rn-chrome-devtools-frontend/pull/97) further is leading to WebSocket disconnections on Android 😐).

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D61543480

fbshipit-source-id: ee66b4cebd40f8cc6466270c5875df744d2b588a
2024-08-21 07:02:42 -07:00
Samuel Susla a462dfd6ce delete change_order_of_mounting_instructions optimisation (#46113)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46113

changelog: [internal]

This showed promised in local tracing but that failed to translate to real perf improvement. Unshipping.

Reviewed By: christophpurrer

Differential Revision: D61537744

fbshipit-source-id: 03a2a69a6fed32a6b493bc17372e3783b9db2d1e
2024-08-21 06:04:57 -07:00
Tim Yung 8f0f50f7a1 Appearance: Cache colorScheme in JavaScript (#46122)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46122

Implements a JavaScript cache for `colorScheme` in the `Appearance` module, so that we avoid potentially expensive and unnecessary native property accesses.

Changelog:
[General][Changed] - Improved `Appearance.getColorScheme` performance

Reviewed By: rickhanlonii

Differential Revision: D61567880

fbshipit-source-id: ca316946d68114b05239daa17105c85e637efe07
2024-08-21 01:48:58 -07:00
Tim Yung ed3ca0730c Appearance: Dedupe colorScheme Validation Logic (#46120)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46120

Currently, the implementation of `Appearance` duplicates the validation logic of string `colorScheme` values multiple times.

This leads to more complicated code and also unnecessary work in certain edge cases (e.g. when `NativeAppearance` is not registered).

This refactors `Appearance` to be simpler and to do less work. I've also configured `NativeAppearance.setColorScheme` to be non-nullable because it has existed since 2023.

Changelog:
[Internal]

Reviewed By: TheSavior

Differential Revision: D61567881

fbshipit-source-id: 61cb51709dc716ad97ae1397105414e74fe57a28
2024-08-21 01:48:58 -07:00
Tim Yung 693a575143 Appearance: Manage Native Listener Count (Android) (#46121)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46121

Updates `Appearance` on Android to supply the native module to `NativeEventEmitter` so that the native listener count can be managed like it is on iOS.

This was previously required by macOS and iOS. Android and Windows also already implement:

```
interface NativeModule {
  addListener(eventType: string): void;
  removeListeners(count: number): void;
}
```

So we should start passing `NativeAppearance` into the `NativeEventEmitter` constructor across all platforms.

Changelog:
[Internal]

Reviewed By: TheSavior

Differential Revision: D61567883

fbshipit-source-id: 1b3b76de9be3f35cacba1acbc43f6dcc0b41fde5
2024-08-21 01:48:58 -07:00
Tim Yung a7fbe8117f Appearance: Migrate to ESM Named Exports (#46119)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46119

Straightforward migration of the `Appearance` module to use ESM named exports.

Changelog:
[Internal]

Reviewed By: TheSavior

Differential Revision: D61567882

fbshipit-source-id: a4a5a9771de001bd41cb0e23ba066f150267a55d
2024-08-21 01:48:58 -07:00
Nick Gerleman 387560a9af Make StaticViewConfigValidator permissive of extra attributes on SVC compared to native viewconfig (#45859)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45859

"Fabric without SVCs" configuration is nearly gone, and so it doesn't make sense to need to add no-op methods, on normally Paper only code, etc to satisfy native viewconfig. These particular warnings are then more often noise, than things we need to action on.

Checking for native code to be present can also break development where users are using distributed native app, slightly older than JS.

This keeps the warning, only if static viewconfigs are missing native view config attributes (i.e. new prop would only be exposed to Paper, instead of only exposed to Fabric)

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D60575253

fbshipit-source-id: 1c118274b92eb7922c0dd92df060b24e44fceb3d
2024-08-20 18:58:07 -07:00
Ramanpreet Nara a949e0d751 Report early js exceptions on the js thread (#46116)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46116

If your app raises an early js exception, and you cold start it, often you'll see this error:

```
SurfaceRegistryBinding::startSurface failed. Global was not installed.
```

{F1807125099}

The reason why is because two different threads race to redbox:
* The nativemodule thread: the early js error (reported [here](https://fburl.com/code/vcrqzsdp))
* The javascript thread: the SurfaceRegistryBinding error (a subsequent native -> js call)

After this diff, the early js error will **not jump onto the nativemodule thread** to report this error.

This ensures that we "always" (to the best of my knowledge) see the early js error first.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D61339213

fbshipit-source-id: f1b9ab30150b87377817c2fd93ca349c406db48b
2024-08-20 17:50:55 -07:00
Nick Gerleman ee597bfe2b Breaking: Always use AttributedStringBox instead of AttributedString in TextLayoutManager (#46104)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46104

We want to use `PrecomputedText` to store glyph-level measurements on underlying Android Spannable. This means we need to consistently reuse the same Spannable, instead of recreating them on measurement.

We have an opaque cache ID used by Android, for spannables originating from uncontrolled TextInput on UI-thread side. We also have `AttributedStringBox`, for a kind of similar purpose on iOS, which allows passing opaque pointer to the `TextLayoutManager`. This is only used for the `measure` function.

This change makes us consistently use `AttributedStringBox` at the TextLayoutManager boundary, to let us migrate calls across TextLayoutManager to all pass opaque handle to underlying Spannable we will store, instead of passing the AttributedString each time. For now, every place previously passing an AttributedString value still passes one.

There were also some egregious cases of accepting very large structures by value, causing unneeded copies. I changed the APIs to accept anything potentially larger than two pointers to pass by reference instead.

This change is technically breaking, to any 3p code calling into TextLayoutManager (IIRC live-markdown exposed prefabs for this, but should be able to adapt fairly easily).

Changelog:
[General][Breaking] - Always use AttributedStringBox instead of AttributedString in TextLayoutManager

Reviewed By: joevilches

Differential Revision: D61484999

fbshipit-source-id: 07c5600cd917f2dab3d24559a25f27e0872ebddc
2024-08-20 17:27:51 -07:00
Nick Gerleman 3cd6d18aa8 Increase Example List Density (#46080)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46080

1. Force the examples to be alphabetized, where the hand-maintained list has some examples that are not
2. Remove reundant/not useful UI

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D61430910

fbshipit-source-id: 1f3e116fe81502faa7a72f2720912e26c9f04bb2
2024-08-20 16:48:38 -07:00
Nick Gerleman d713349b0c Replace "elevation" in RNTester rows with box-shadow (#46076)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46076

This will add the shadows to iOS as well. let's see if anyone notices 🙂. I also removed dead styles, and removed some of the extra (excessive) padding specific to Android where the previous shadows would overlap.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D61421903

fbshipit-source-id: 887fa5aa96e3b0b4f81114ee814897c218db2b76
2024-08-20 16:48:38 -07:00
generatedunixname89002005232357 2bbe8f44c6 Revert D61298649 (#46118)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46118

Changelog: [Internal]

Reviewed By: cyan33

Differential Revision: D61550740

fbshipit-source-id: 8c201b8f79416dec13ece9c671405af7b2de9c8c
2024-08-20 15:10:29 -07:00
Benoit Girard 5561457c98 Limit HermesPerfetto tracing to the top 25 and bottom 25 frames, allowing you to see both sides (#46117)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46117

Currently in large cursive blocks like layout effect we can't tell what the slow leaf function is. With this fixed I'm able to root cause more complex issues in layout effects.

Reviewed By: NickGerleman

Differential Revision: D61486415

fbshipit-source-id: 5a4043b35eedcabcbea86953aac2173f66d7257b
2024-08-20 13:25:45 -07:00
Alan Lee 67b4a5a2d1 Introduce extension function for PixelUtil (#46072)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46072

Introducing extension fuctions in PixelUtils to replace Java static methods so Kotlin code can be more readable.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D61372704

fbshipit-source-id: 489a74d60cd1463f0b1fad6f7c33925cec4000d2
2024-08-20 12:18:38 -07:00
shubhamguptadream11 f6b6d001a0 fix(android): status bar black strip fixed (#46086)
Summary:
Fixes these issues:
- https://github.com/facebook/react-native/issues/46070
- https://github.com/facebook/react-native/issues/39362

## Changelog:

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

Pick one each for the category and type tags:

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

[ANDROID] [FIXED] - Fixed black strip coming when hiding status bar

`setHidden` function is responsible for hiding status bar

https://github.com/facebook/react-native/blob/25d6a152cc720e0d5f860dab228ac2e43321d9e4/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/statusbar/StatusBarModule.kt#L122

**What real issue is?** **_For android devices with camera area on top a black strip is coming after hidding status bar._**

Previous Implementation:
```
  override fun setHidden(hidden: Boolean) {
    val activity = currentActivity
    if (activity == null) {
      Log.w(
          ReactConstants.TAG,
          "StatusBarModule: Ignored status bar change, current activity is null.")
      return
    }
    UiThreadUtil.runOnUiThread(
        Runnable {
          val window = activity.window ?: return@Runnable
          if (hidden) {
            window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN)
            window.clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN)
          } else {
            window.addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN)
            window.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN)
          }
        })
  }
```
It seems that FLAG_FULLSCREEN flag are not enough to draw content in camera area.

**Solution:**
In order to tackle this, android exposes 2 flags:
- [layoutInDisplayCutOutMode](https://developer.android.com/reference/android/view/WindowManager.LayoutParams#layoutInDisplayCutoutMode):  The window is always allowed to extend into the [DisplayCutout](https://developer.android.com/reference/android/view/DisplayCutout) areas on the short edges of the screen. [Android 9.0 and above]
- [setDecorFitsSystemWindows](https://developer.android.com/reference/android/view/Window#setDecorFitsSystemWindows(boolean)):  allows content to be able to extend into the cutout area. [Android 10.0 and above]

By adding this flag we are now able to hide status bar properly.
```
  override fun setHidden(hidden: Boolean) {
    val activity = currentActivity
    if (activity == null) {
      FLog.w(
          ReactConstants.TAG,
          "StatusBarModule: Ignored status bar change, current activity is null.")
      return
    }
    UiThreadUtil.runOnUiThread(
        Runnable {
          val window = activity.window ?: return@Runnable
          if (hidden) {
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
              // Ensure the content extends into the cutout area
              window.attributes.layoutInDisplayCutoutMode =
                WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
              window.setDecorFitsSystemWindows(false)
            }
            window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN)
            window.clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN)
          } else {
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
              window.attributes.layoutInDisplayCutoutMode =
                WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_DEFAULT
              window.setDecorFitsSystemWindows(true)
            }
            window.addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN)
            window.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN)
          }
        })
  }
```

**_Note: This will work above Android 11 and above_**

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

Test Plan:
- Tested by author of this issue
- Sharing here the videos of before and after fix

Device Detail:
Oneplus9 5G OS 11
**Before fix:**
https://github.com/user-attachments/assets/589098ff-a3fa-4962-a15b-ceacbfd03d2d

**After fix:**
https://github.com/user-attachments/assets/a87dd8e4-3624-4e09-99da-a14f9e19fcc6

Reviewed By: cipolleschi

Differential Revision: D61509889

Pulled By: alanleedev

fbshipit-source-id: 733962a3bed2efba71588a4d2fdf7c9c386bc3b4
2024-08-20 11:38:23 -07:00
David Vacca ed1410136f Remove overriding thread priority for RN Main Thread (#46101)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46101

Remove overriding thread priority for RN Main Thread as it is not possible to update main thread.

changelog: [internal] internal

Reviewed By: javache

Differential Revision: D61448536

fbshipit-source-id: 44ec28a875e3208df042ac11bdd17a7287836ebb
2024-08-20 11:22:45 -07:00
David Vacca dee503812a Fix MessageQueueThreadImpl warnings (#46108)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46108

Fix MessageQueueThreadImpl warnings

changelog: [internal] internal

Reviewed By: NickGerleman

Differential Revision: D60855886

fbshipit-source-id: d26a994ea7c4a100ba001862a4947417c1e0479d
2024-08-20 11:22:45 -07:00
zhongwuzw efa9711e35 Fixes Appearance user interface style when app run from background (#46021)
Summary:
Fixes https://github.com/facebook/react-native/issues/46015.

## Changelog:

[IOS] [FIXED] - Fixes Appearance user interface style when app run from background

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

Test Plan: Demo in https://github.com/facebook/react-native/issues/46015.

Reviewed By: christophpurrer

Differential Revision: D61536857

Pulled By: cipolleschi

fbshipit-source-id: ee06cb25b5fc4fa72d646efe212738e54b9ef858
2024-08-20 10:44:41 -07:00
Zhi Zhou 52888c0c1e fix: iOS crash occurring when navigating to a new app screen with a displaying modal (#45313)
Summary:
Our app is using the react-native v0.74.2 with the `react-navigation` lib for screen navigation, we're facing an issue in the built iOS app that when we try to navigate to a new app screen with the `react-navigation`'s `reset` or `replace` method and meanwhile there's a react native modal displaying, then the iOS app always crashes.

I saw there is already a relevant [PR](https://github.com/facebook/react-native/pull/38491) and discussion targeting this issue, but I still think it would be better if this kind of crash can be suppressed in the framework level, currently I guess it's common in the iOS apps based on react native.

## Changelog:

[IOS] [FIXED] - app crash happening when navigate to a new app screen with a displaying modal

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

Test Plan: More issue details and the reproduction steps can be found in this [PR](https://github.com/facebook/react-native/pull/38491) :)

Reviewed By: christophpurrer

Differential Revision: D61537167

Pulled By: cipolleschi

fbshipit-source-id: 3c0474d794b4216ebc073dd6558d2b6ae27492d2
2024-08-20 10:04:47 -07:00
Ingrid Wang 4fb518bbe9 Migrate off of iOS 13 deprecated API statusBarFrame (#46105)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46105

Changelog:

[iOS][Internal] Migrate from UIApplication.statusBarFrame to UIStatusBarManager.statusBarFrame

Reviewed By: cipolleschi

Differential Revision: D61499532

fbshipit-source-id: 1fe10600fcbaf54280b6d630cb92383b9cf091a3
2024-08-20 09:59:51 -07:00
Nicola Corti f4a979580d Set REACTNATIVE_MERGED_SO for React Native 0.76 (#46114)
Summary:
Setting a variable called `REACTNATIVE_MERGED_SO` so libraries/apps can selectively decide to depend on either libreactnative.so or link against a old prefab target (this is needed for React Native 0.76 on).

## Changelog:

[INTERNAL] - Set REACTNATIVE_MERGED_SO for React Native 0.76

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

Test Plan: CI

Reviewed By: hezi

Differential Revision: D61541372

Pulled By: cortinico

fbshipit-source-id: b16fa29ce6dd1670b452848e37cfcd7be15861e6
2024-08-20 08:49:54 -07:00
Blake Friedman 0bb085c7b6 Summary: Add changelog for 0.75.2 (#46111)
Summary:
## Summary:
Add changelog for 0.75.2

## Changelog:
[Internal] - Add changelog

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

Reviewed By: cipolleschi

Differential Revision: D61538106

Pulled By: blakef

fbshipit-source-id: 45c4ee97d294a11f04852936e44f25d05030182e
2024-08-20 06:51:37 -07:00
Riccardo Cipolleschi 31cbc77f52 Add internal end to end tests for text and background color with border width (#46068)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46068

This change adds some internal E2E tests to verify that the text is rendered properly on top of a solid background color when borderWidth is set

## Changelog
[Internal] - Add E2E tests

Reviewed By: cortinico

Differential Revision: D61392253

fbshipit-source-id: 76e11821eba96ac75b055c5fe94365197c0f9be2
2024-08-20 04:38:45 -07:00
Riccardo Cipolleschi f4609dbb5f Move RCTParagraphTextView drawing to contentView (#46081)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46081

This change fixes an issue that has been reported by OSS where a Text with both background color and borderWidth is not rendered properly.

The reason is that `RCTParagraphComponentView` uses the `drawRect` method which draws the text in the main view layer, while the parent `RCTViewComponentView` can apply an extraLayer on top of the base layer, drawing on top of the text.

This change moves the drawing of the text to an auxiliary view, `RCTParagraphTextView`, that is set as contentView of the `RCTParagraphView`. In this way, the text is drawn in a different view and can't be covered by the `_borderLayer`

## Changelog:
[Internal] - Introduce a RCTParagraphTextView to draw the text

Reviewed By: joevilches

Differential Revision: D61431369

fbshipit-source-id: 05467167186411fe42312f2ed956f5b5336de019
2024-08-20 04:38:45 -07:00
Riccardo Cipolleschi 0f4a405f28 Add Text example with BG and borderWidth
Summary:
This diff adds an example in RNTester to verify that we can draw text on top of a colored background and non uniform border radius.

As you can see from the test plan, the current code works well when:
* There is only the background color
* There is a background color and uniform cornerRadius
* There are non uniform border radius but the background is transparent.

The current code **does not** work when:
* there is a background and non-uniform border radius
* there is a background, uniform border radius and borderwidth

The reason why this happens is because:
* `RCTParagraphComponentView` draws the text in the View's main layer in the `drawRect` method
* `RCTViewComponentView` has a method `invalidateLayer` that, when there are non-uniform border radii o there is a borderWidth, it creates an extra `CALayer` with an image as content and that layer is put on top of the base layer, covering the text.

## Changelog
[Internal] - Add example to RNTester

Reviewed By: cortinico

Differential Revision: D61389317

fbshipit-source-id: 3e0a9e6c611190f90198a1b0b5855431b9f6ed12
2024-08-20 04:38:45 -07:00
Moti Zilberman 457f8f08fc Add test for resolving a breakpoint without a reload
Summary:
bypass-github-export-checks

Covers the case of an immediately-resolved breakpoint in `JsiIntegrationTest`, complementing the existing `ResolveBreakpointAfterReload` case.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D61468055

fbshipit-source-id: 0f68656a2558166f1302163d14722c17c590044b
2024-08-20 02:04:28 -07:00
Raman Gupta 143437a837 Update React-RCTAppDelegate.podspec syntax error for USE_HERMES=1 (#46075)
Summary:
The `USE_HERMES` flag is set not escaped correctly by `React-RCTAppDelegate.podspec`, and it does not apply.

The flag needs to be defined as `USE_HERMES\=1`, but is currently set as `USE_HERMES`.

Hopefully this will fix https://github.com/facebook/react-native/issues/38193.

See https://github.com/facebook/react-native/issues/38193#issuecomment-2072243996.

## Changelog:

Pick one each for the category and type tags:

[IOS] [FIXED] - Fix imports from RCTAppSetupUtils when Hermes is active

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

Test Plan: I made the change in my local project and it fixed issues I was having with building my React Native project. See https://github.com/facebook/react-native/issues/38193#issuecomment-2072243996.

Reviewed By: cipolleschi

Differential Revision: D61422872

Pulled By: realsoelynn

fbshipit-source-id: ddaa88ab01bd1186b33d1d7c73d5865182271c81
2024-08-19 22:19:32 -07:00
Phillip Pan e8fd7a0f78 update comment to use BaseReactPackage instead of TurboReactPackage (#46102)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46102

Changelog: [Internal]

TurboReactPackage is deprecated, use BaseReactPackage instead

Reviewed By: NickGerleman

Differential Revision: D61487902

fbshipit-source-id: a47436148b83b3dbdd985c8c480f78307e080a2c
2024-08-19 21:28:38 -07:00
Nishan 1a49892d57 fix: linear gradient color stop fix up spec (#45969)
Summary:
- Color stops needs to follow [fix up spec](https://drafts.csswg.org/css-images-4/#color-stop-fixup)
- Adds multiple stops syntax support. e.g. linear-gradient(red 30% 50%, green).
- Rename `position` to `positions` in object style API. Optional string array here makes more sense. We'll add number array support once `px` support is added. Will do it as a follow up to this PR.

TODOs: transition hint syntax support `linear-gradient(red, 50%, green)` (Done locally, dependent on this PR). `px` support.

## Changelog:
[GENERAL] [FIXED] - Linear gradient color stop spec.

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

Pick one each for the category and type tags:

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

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

Test Plan: - Added testcases in processBackgroundImage-test.js

Reviewed By: javache

Differential Revision: D61309203

Pulled By: NickGerleman

fbshipit-source-id: 884052c6841320048933361f38e6478ff4192736
2024-08-19 18:23:13 -07:00
Joe Vilches 7027eac09a Extra log for case where availableHeight is undefined and sizing mode != max content (#45965)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45965

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

We are seeing some crashes that are hard to wrap our head around. Lets add more logs. I chose these values based on what could make the height/width undefined from looking at the code. We might need more but this should give us some more direction.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D61054392

fbshipit-source-id: 654ff96f94aa89605a603e2e36335bb48b61f4a2
2024-08-19 16:13:44 -07:00
Jorge Cabiedes Acosta 0f3ed90455 Add mix-blend-mode examples to rn-tester (#46006)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46006

Adding some extra examples for mix-blend-mode

And added E2E tests for each mix-blend-mode example

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D60605636

fbshipit-source-id: 553f3a2c3b971c918530bdee5a73108c22bd936e
2024-08-19 11:07:46 -07:00
Nicola Corti 55d35411ae Finalize AssertJ migration (#46097)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46097

I've noticed we still have some tests here and there that were not migrated to AssertJ. This finishes them all.

Changelog:
[Internal] [Changed] - Finalize AssertJ migration

Reviewed By: javache

Differential Revision: D61473682

fbshipit-source-id: 3d51bfeb0e5ba3fd8cd4f3667dc88de3d88a3dbc
2024-08-19 10:51:24 -07:00
Blake Friedman 2ac997abcc Remove references to old template (#46082)
Summary:
## Summary
There are old references to the react-native/template. This code has
moved to react-native-community/template.

Changelog: [Internal]

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

Test Plan:
CI

closes facebook/metro#1324

Reviewed By: cipolleschi

Differential Revision: D61472439

Pulled By: blakef

fbshipit-source-id: fc40145c03002a7c3117b72d07981a96aa3d8760
2024-08-19 09:19:35 -07:00
zhongwuzw 9cfd9dd1c7 Fixes Italic text not work (#46094)
Summary:
Fixes https://github.com/facebook/react-native/issues/46090. cc cipolleschi

## Changelog:

[IOS] [FIXED] - Fixes Italic text not work

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

Test Plan: Demo in https://github.com/facebook/react-native/issues/46090

Reviewed By: NickGerleman

Differential Revision: D61472362

Pulled By: cipolleschi

fbshipit-source-id: 8cee04c4a3bdc842a765d13e997af5063ea03a32
2024-08-19 08:38:59 -07:00
Riccardo Cipolleschi 7f3717eb78 Add changelog for 0.72.17 (#46100)
Summary:
Add changelogfor 0.72.17

## Changelog:
[Internal] - Add changelog for 0.72.17

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

Test Plan: N/A

Reviewed By: christophpurrer

Differential Revision: D61476630

Pulled By: cipolleschi

fbshipit-source-id: e6a5115a1dd5d6745d5234cbffebb0fc8294cf67
2024-08-19 08:29:10 -07:00
Christoph Purrer 6340662d4f Add C++ Turbo Module enum Event Emitter example (#46049)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46049

## Changelog:

[General] [Added] - Add C++ Turbo Module enum Event Emitter example

Reviewed By: kentwilliam

Differential Revision: D61336742

fbshipit-source-id: 81ac54020f4d88dc3c1235541d613a59235069a3
2024-08-19 08:26:20 -07:00
Nicola Corti 0e805a953d Make Imagesource open for inheritance (#46092)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46092

Fixes https://github.com/facebook/react-native/issues/46077

Changelog:
[Android] [Fixed] - Make Imagesource `open` for inheritance

Reviewed By: rshest, cipolleschi

Differential Revision: D61469357

fbshipit-source-id: ee122b46346c47c7665c60ceb5ea7e91f12a965c
2024-08-19 04:34:22 -07:00
David Vacca d4d5ab0bba Fix lint warnings (#46083)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46083

Fix lint warnings

changelog: [internal] internal

Reviewed By: tdn120

Differential Revision: D61376258

fbshipit-source-id: e4e047e478a4e5a95d5e6b3dea426189f29bb641
2024-08-18 16:45:02 -07:00
Sam Zhou 25d6a152cc Deploy 0.244.0 to xplat
Summary: Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D61435279

fbshipit-source-id: 05212fe00d352c32d2be9d93ad0fcd6d414ef828
2024-08-17 17:51:37 -07:00
Nick Gerleman d9f684b1cf Revamp InsetBoxShadowDrawable (#46074)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46074

This brings over the changes made to OutsetBoxShadowDrawable. Namely

1. Removing reliance on CSSBackgroundDrawable for drawing paths
2. Using BlurMaskFilter instead of RenderEffect
3. Removing RenderNode usage

This should make the implementation, more reliable less memory intensive for large boxes, and compatible down to Android API 29. I changed previous gating to allow outset shadows for 28+, and inset for 29+.

Changelog:
[Android][Changed] - Revamp InsetBoxShadowDrawable

Reviewed By: joevilches

Differential Revision: D61348615

fbshipit-source-id: 97b63b5dce65224ca54b76c5318c219973fc09fa
2024-08-17 09:21:06 -07:00
Nick Gerleman f905f90468 Support OutsetBoxShadowDrawable on Android 9+ (#46037)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46037

We no longer need to use a RenderNode, since we aren't using a RenderEffect, and when I looked at our usage, and RenderNode internals, it is definitely adding more overhead instead of less.

This lets us simplify the code further, and to support down to Android API 28, allowing us to support 90% of Android devices out there, instead of 80%.

API 28 [switches to Skia](https://cs.android.com/android/_/android/platform/frameworks/base/+/04f1f011397e10ded08ac14b7e62c85e6a521f27:libs/hwui/Properties.cpp;dlc=ac1d112c4bef3fef85b4de3ce0d2bc2d3006f4b5) as the default rendering backend. We see many [related drawing APIs](https://developer.android.com/topic/performance/hardware-accel#drawing-support) show as first officially supported in hardware accelerated canvases in this version, including `setShadowLayer()`, which uses [`SKMaskFilter`](https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/libs/hwui/jni/Paint.cpp;l=1104;drc=7ad774120c090227ba12b9e9e8d724db01b854f4) internally.

We are still waiting on InsetBoxShadowDrawable to be changed though, before the prop setter stops gating to API 31+.

Changelog:
[Android][Changed] - Support OutsetBoxShadowDrawable on Android 9+

Reviewed By: joevilches

Differential Revision: D61331711

fbshipit-source-id: 170f6d4e5bfebbce5005445a3c32c4b17910eb05
2024-08-17 09:21:06 -07:00
Jorge Cabiedes Acosta 3e6b4fa230 Fix processFilter incorrectly splitting function args (#46073)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46073

Before we had issues with drop-shadow definitions like `drop-shadow(10 10 10 rgba(255, 255, 255, 1))`

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D61413945

fbshipit-source-id: 478c437336d3e7d5066ed62f6aa5bec106b8b061
2024-08-16 17:55:30 -07:00