Commit Graph
31644 Commits
Author SHA1 Message Date
Ruslan ShestopalyukandFacebook GitHub Bot 3bbc3f2a48 Move textAlignVertical into TextAttributes (#44516)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44516

# Changelog:
[Internal] -

This is a generally cross-platform attribute, which is supported not only on Android, and conceptually does arguably belong in TextAttributes.

Reviewed By: NickGerleman

Differential Revision: D57181633

fbshipit-source-id: 7251f0a90158f0466fbf13b9d855c7a449e6dd0f
2024-05-10 08:40:39 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot f8c1ad6f43 Flatten Text examples in RNTester to make them searchable (#44518)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44518

# Changelog:
[Internal] -

For some inexplicable reason, we had majority of `Text` test examples (42 out of 46) in RNTester stuffed into `<RNTesterBlock/>` components inside one huge "Basic" test case.

This was highly imbalanced, introduced extra nesting, cluttering the UI, but most importantly, none of those 42 out 46 test cases were searchable for.

This change flattens all of the corresponding nested test cases to the top level, making them into valid separate test cases, which are also searchable.

It also corresponds to the general structure we have in other test examples, such as `TextInput`.

Reviewed By: cipolleschi

Differential Revision: D57197676

fbshipit-source-id: 777eb2aa238a91bb3f52d2f0ab10edc6bfad5c85
2024-05-10 08:38:59 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 26fc40d0f7 Convert AccessibilityInfoModule (#44520)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44520

# Changelog:
[Internal] -

As in the title.

Reviewed By: javache

Differential Revision: D57203063

fbshipit-source-id: 3a19b29f6ed2291fa9464d1e8341d38c8824a069
2024-05-10 08:24:54 -07:00
Samuel SuslaandFacebook GitHub Bot 00b251b8ee delete 'decouple commit from mount on Android' (#44504)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44504

changelog: [internal]

Reviewed By: rubennorte

Differential Revision: D57154279

fbshipit-source-id: 5902a81fe892ae1d4cf85f63c2b81a16c31baa34
2024-05-10 04:54:47 -07:00
Pieter De BaetsandFacebook GitHub Bot 34a50ae8ef Stop emitting deprecated onTextInput events (#44479)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44479

TextInputs' onTextInput callback was removed way back in React Native 0.62 with https://github.com/facebook/react-native/commit/3f7e0a2c9601fc186f25bfd794cd0008ac3983ab , but remnants of the implementation exists.

We first have to remove the event emitting in native code, and can land the full removal separately in D57092733, once there's no older client references remaining to this event.

Changelog: [General][Removed] Remove deprecated onTextInput callback

Reviewed By: cipolleschi

Differential Revision: D57092734

fbshipit-source-id: 5b0beee3d55b70717216fe8ceaf52444540f5adc
2024-05-10 03:48:43 -07:00
Rui YingandFacebook GitHub Bot 4ad65ac59a Handle the case where the file reference doesn't have a path (#44410)
Summary:
The new cocoapod post install script includes aggregation and generation of privacy manifests for iOS, which is great. However, the script doesn't consider the case where the file reference doesn't have a path.

Example, for a project setup like the screenshot:
<img width="249" alt="image" src="https://github.com/facebook/react-native/assets/22592111/45dd1cf4-c2f6-4abb-940f-136a4d502966">

The code
https://github.com/facebook/react-native/blob/05a4232dd591e2d43f192d69ca14a04f4a3fb6a1/packages/react-native/scripts/cocoapods/privacy_manifest_utils.rb#L80-L81

prints `file_refs`:
```
[
<PBXFileReference name=`LaunchScreen.storyboard` path=`learnX/LaunchScreen.storyboard` UUID=`81AB9BB72411601600AC10FF`>,
<PBXVariantGroup name=`InfoPlist.strings` UUID=`D40B9F832B248EF5004BC08C`>,
<PBXFileReference path=`AppCenter-Config.plist` UUID=`D40B9F802B248EC2004BC08C`>,
<PBXFileReference name=`PrivacyInfo.xcprivacy` path=`learnX/PrivacyInfo.xcprivacy` UUID=`D403DD362BCA2BCF00E5295C`>,
<PBXFileReference name=`Assets.xcassets` path=`learnX/Assets.xcassets` UUID=`D40B9F652B248AEB004BC08C`>
]
```

where a `PBXVariantGroup` exists and it doesn't have `path`. The error `undefined method 'end_with?' for nil` occurs as a result.

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

[IOS] [FIXED] - In privacy manifest post install script, handle the case where the file reference doesn't have a path

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

Test Plan:
1. Add a new "Strings File (Legacy)" in Xcode to the project.
2. Run `pod install` for iOS.
3. See the error `undefined method 'end_with?' for nil`.
4. Apply the fix and rerun `pod install`.
5. The script runs successfully.

Reviewed By: javache

Differential Revision: D57056159

Pulled By: cipolleschi

fbshipit-source-id: 42caaf1a98efb9111f6ff1014a5c8b7703b042f2
2024-05-10 02:51:11 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 8c3260f2a4 Make relevant TextInput examples not depend on top window size (#44517)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44517

# Changelog:
[Internal] -

A follow-up to https://github.com/facebook/react-native/pull/44505, turns out this is also an issue for TextInput examples, which work of assumption of some of the text input fields being of limited width, but in practice growing to occupy the parent window width, which can be quite large on platforms different from the classic mobile ones.

This diff makes the corresponding tests more practical, not expanding to the parent window anymore.

Reviewed By: christophpurrer

Differential Revision: D57196308

fbshipit-source-id: 7018e8c51adb70fe6a03e50d71eff9ba997fd07a
2024-05-10 00:14:33 -07:00
Panos VekrisandFacebook GitHub Bot 0142f82ea7 remove default option experimental.global_find_ref=true (#44515)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44515

this has been the default for a while

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D57195561

fbshipit-source-id: b441d972134dba754d714ae5694d94537707ded3
2024-05-09 23:14:37 -07:00
huzhanbo.lucandFacebook GitHub Bot c647950e5e fix fetch memory leak (#44336)
Summary:
Root cause of the fetch memory leak:

The fetch requests store its result inside Blob which memory is managed by BlobCollector. On the JS engine side,
the Blob is represented by an ID as JS string, and the GC don't know the size of the blob. So GC won't have interests to release the Blob.

Fix:

On iOS and Android, use `setExternalMemoryPressure` to acknowledge JS engine the size of Blob it holds.

## Changelog:

[GENERAL] [FIXED] - fix fetch memory leak

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

Test Plan: `RepeatedlyFetch` inside `XHR` example

Reviewed By: javache

Differential Revision: D57145270

Pulled By: NickGerleman

fbshipit-source-id: afa53540e8563db4f9c6657f2dbbdff7bdfa66c0
2024-05-09 19:55:43 -07:00
Pieter VanderwerffandFacebook GitHub Bot 007ca0c376 Deploy 0.236.0 to xplat (#44510)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44510

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D57186863

fbshipit-source-id: 389dcb039c7d4c461b3be28f4eba32d5d9781e61
2024-05-09 19:33:12 -07:00
Nick GerlemanandFacebook GitHub Bot 54f582f651 Fix duplicate rotation operations (#44429)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44429

`Transform::Rotation(x, y, z)` creates an empty transform with the associated operation, then [multiplies by xyz rotation vectors](https://en.wikipedia.org/wiki/Rotation_matrix#General_3D_rotations).

Multiplication chains each transform operation, so afterward, we end up with correct transform matrix, but duplicate operations.

This removes the first transform operation, and lets the per-axis multiplications set them.

Changelog:
[General][Fixed] - Fix duplicate rotation operations

Reviewed By: rshest

Differential Revision: D57025602

fbshipit-source-id: 5eb47dbf9a72eab89a351fd5ae02261566b35ffb
2024-05-09 18:30:56 -07:00
Nick GerlemanandFacebook GitHub Bot cea5309839 Split "renderer/css" headers (#44471)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44471

Need to make the current headers a bit more granular to avoid cyclical dependencies, and a lot of bloat.

This code isn't wired up more broadly, so this isn't breaking yet.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D57089140

fbshipit-source-id: f6e0312c207664b0a59f682c673cd00e263915bc
2024-05-09 17:12:17 -07:00
Nick GerlemanandFacebook GitHub Bot 7003e3544c Teach CSSTokenizer about function-token, parens, comma (#44450)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44450

Adding some of the tokenization needed for things like `transform` and `filter`. Parsing will be a bit trickier with the model currently built up.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D57047886

fbshipit-source-id: 260a681ab60944c8f127d937589fc4c8589a53e2
2024-05-09 17:12:17 -07:00
Nick GerlemanandFacebook GitHub Bot c300310c38 String setters for CSSDeclaredStyle (#44435)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44435

Every CSS prop at this sparse stage is represented as an enum, and each enum can be specialized to different types, according to the global CSS property table.

With this change, we add a string name to each property table entry that we use to generate a function to be able to set CSS value strings, against property name strings. Like `declaredStyle.set("aspectRatio", "4 / 3")`.

I was considering specializing this a bit, to allow DeclaredStyles which only support a subset of CSS props. E.g. so `ParagraphShadowNode` has a more derived declared style than `LayoutableShadowNode` does. But, I am not sure the best way yet to make that compose nicely.

Changelog: [internal]

Reviewed By: sammy-SC, rshest

Differential Revision: D57039255

fbshipit-source-id: c5289254bb97fa355af5f416b79952e426720934
2024-05-09 17:12:17 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot f4996e0b63 Make text wrap examples not rely on the RNTester window width (#44505)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44505

# Changelog:
[Internal] -

The RNTester/Text tests, that are related to text wrapping (such as "wrap mode", "hyphenation", "ellipsize", "numberOfLines" ones) were written with the mobile form factor in mind, whereas the RNTester window is generally expected to be narrow and tall.

Now, that we are running on other platforms as well, there is no guarantee about the RNTester window width, in general, so these tests relying on particular window width is not practical anymore.

This makes the corresponding tests work in a useful way without making assumptions about the RNTester's window width.

Differential Revision: D57166025

fbshipit-source-id: 3305a31f7ca254d82c85d67c975c1140050adc28
2024-05-09 13:04:43 -07:00
Joe VilchesandFacebook GitHub Bot 5f0361a704 e2e tests for FilterExample on RN-Tester (#44500)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44500

tsia really, added tests for blur, brightness, and chained brightness + blur. I don't really think I need to add them all, as e2e tests can be flaky and I doubt someone changes specific color matrix values ever.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D57127765

fbshipit-source-id: 7644c9493eee176e24922f7c06656360340e00d4
2024-05-09 12:29:39 -07:00
Jorge Cabiedes AcostaandFacebook GitHub Bot 311afc1801 Add E2E tests for border-radius percentages (#44460)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44460

Added missing e2e tests for border-radiusf

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D57062098

fbshipit-source-id: ef84b2f05af5e1139a7af5c67192b23172e2a735
2024-05-09 11:18:27 -07:00
Jorge Cabiedes AcostaandFacebook GitHub Bot 181ed33ab0 Add percentages for border-radius props (#44408)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44408

Why?
Previously we didn't support using percentages like:
```
style={{
  width=100,
  height=100,
  borderRadius='100%',
}}
```

These percentages refer to the corresponding dimension of the border box.

What?
- Added LengthPercentage class and LengthPercentageType enum. To track when we are dealing with percentage vs points
- Now radius properties start as Dynamic which then get transformed into LengthPercentage.
- Modified certain function parameters so we can consider height and width when resolving BorderRadius values

With this we conditionally calculate the corresponding point (dp) value for a given percentage (considering size). Ex:

```
result = {raw_percentage_value} / 100 * (max(height, width))
```

We know the maximum border radius for our current implementation is half the dp of the shorter side of our view, hence why we consider half our maximum view side as equivalent to 100%.

Note: We still don't support vertical/horizontal border radii

## Changelog:

[Android][Added] - Added support for using percentages when defining border radius related properties.

Reviewed By: NickGerleman

Differential Revision: D56943825

fbshipit-source-id: 3e5a9933ca90e499aff9c7d2561f5f6bb55157da
2024-05-09 11:18:27 -07:00
yungsters (Meta Employee)andFacebook GitHub Bot a45c5895f9 Setup Wave 2 of Feature Flags for React Native (#28990)
Summary:
## Summary

Sets up dynamic feature flags for `disableStringRefs`, `enableFastJSX`,
and `enableRefAsProp` in React Native (at Meta).

## How did you test this change?

```
$ yarn test
$ yarn flow fabric
```

DiffTrain build for commit https://github.com/facebook/react/commit/9b1300209eb00a2d6c645fddf6d2729d67d7b10a.

Reviewed By: kassens

Differential Revision: D57026752

Pulled By: yungsters

fbshipit-source-id: 18b2112fce1671bb83f281b1e036991fa7d6d4ee
2024-05-09 09:27:39 -07:00
Edmond ChuiandFacebook GitHub Bot cc99e924ca add prefersFuseboxFrontend field to debugger_command (#44499)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44499

Changelog: [internal]

As [discussed](https://fb.workplace.com/groups/react.devx.team/permalink/930483712103526/), we'll begin segmenting Telemetry signals by Fusebox/non-Fusebox.

* Add new flag in event reporter for `debugger_command` (other events in subsequent diffs)
* Add new column to the Scuba destination

Reviewed By: blakef

Differential Revision: D57140479

fbshipit-source-id: 7ea813b1b4d53a282873fa95c8ee82e5d6f3d1d3
2024-05-09 03:43:38 -07:00
Edmond ChuiandFacebook GitHub Bot 75dc42f4df extract param type (#44498)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44498

Changelog: [internal]

Quick refactor to reduce commit noise in the following diff in the stack

Reviewed By: blakef

Differential Revision: D57140480

fbshipit-source-id: aa1fef83d5347b8a11651d3d5c4112b4adf7a7d5
2024-05-09 03:43:38 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 7835aa4341 Complete conversion of modules.debug module (#44476)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44476

# Changelog:
[Internal] -

This is the last step to converting the whole `modules.debug` module to Kotlin.

Reviewed By: christophpurrer

Differential Revision: D57095966

fbshipit-source-id: 3fcb52528674565a4a2b5c306262e0af11a19e6e
2024-05-09 03:21:30 -07:00
Ruslan ShestopalyukandFacebook GitHub Bot 7ec70a94dd Convert FpsDebugFrameCallback/AnimationsDebugModule to Kotlin (#44475)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44475

# Changelog:
[Internal] -

As the title says, this is preparing to complete the conversion of the whole corresponding module to Kotlin.

Reviewed By: christophpurrer

Differential Revision: D57095896

fbshipit-source-id: 87fe08aec974f5f1327189d0e74c3782c4391e85
2024-05-09 03:21:30 -07:00
Robin ShinandFacebook GitHub Bot 2bde626a9f fix: TextInput selectionColor props on iOS (#44420)
Summary:
This pull request fixes an issue where the `selectionColor` prop was not applied to the `TextInput` component on iOS, starting from React Native version 0.74.x.

This issue was introduced in PR [1e68e485](https://github.com/facebook/react-native/commit/1e68e48534aedf1533327bf65f26e5cf5b80127b#diff-b6634353ea5b10a91de24605dc51bdfb50e8ddb652ccd5b9dab194168a69d4b1) which relocated `selectionColor` along with `selectionHandleColor` and `cursorColor` out of `otherProps`. This modification inadvertently prevented `selectionColor` from being passed to the iOS native component.

This change ensures that the `selectionColor` prop is explicitly included in the `RCTTextInputView` component's properties, fixing the regression.

Note: `selectionHandleColor` and `cursorColor` are Android-specific and do not require explicit passing on iOS.

## 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] - Fixed an issue where the `selectionColor` prop was not being applied on the `TextInput` component.

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

Test Plan:
**Environment:** iOS Simulator, React Native 0.74.0.

**Steps to reproduce:**

- Implement a `TextInput` component with the `selectionColor` prop set.
- Run the application on an iOS device or simulator.
- Focus on the TextInput component, write some text and select it.

**Expected Result:** the selection color should match the color provided to the `selectionColor` prop.

**Actual result before fix:** the selection color did not reflect the specified `selectionColor` prop and fell back to the default iOS selection color (blue).

**Screenshots:**
- Before fix:
<img width="1710" alt="before_fix" src="https://github.com/facebook/react-native/assets/17989553/8660068c-55c9-4f55-a788-f96eb681fb70">

- After fix:
<img width="1710" alt="after_fix" src="https://github.com/facebook/react-native/assets/17989553/93c9eb26-7da0-4957-b54f-8444aff7e374">

Reviewed By: javache

Differential Revision: D57017836

Pulled By: NickGerleman

fbshipit-source-id: 263ce22168e09c15cdfdb4eb4300a2605d8af032
2024-05-08 20:10:54 -07:00
Liron YahdavandFacebook GitHub Bot 17164280f4 Remove duplicate SystraceSection.h file (#44319)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44319

The files were identical so no need for both. Having both is error-prone as one may be modified without modifying the other.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D56659179

fbshipit-source-id: e5f414f0c4a00c126d301a7fcd26eeb17d74a56c
2024-05-08 15:09:08 -07:00
Thomas NardoneandFacebook GitHub Bot 2ac8dc1e78 Coordinate Synchronous Events with Choreographer (#44491)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44491

Changelog: [internal]

Ensure only one scroll event is fired per frame by tracking the events in FabricUIManager

Reviewed By: sammy-SC

Differential Revision: D57018741

fbshipit-source-id: c1ad59f934e359edfeb8f3e084106eebd467a0b1
2024-05-08 14:32:24 -07:00
Thomas NardoneandFacebook GitHub Bot 52ca6f6569 Enable synchronous scroll events (#44490)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44490

Changelog: [internal]

Enable the experimental syncOnScroll flag in JS.

Reviewed By: sammy-SC

Differential Revision: D56886404

fbshipit-source-id: 6d5081cdcd319b73f0dc4329adc4e2cd7ba17139
2024-05-08 14:32:24 -07:00
Thomas NardoneandFacebook GitHub Bot dbc0334159 Fling][Android] Add synchronous event support (#44489)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44489

Changelog: [internal]
Integrate a synchronous event API to trigger synchronous scroll events in Android. The API will be changed in the future, this is exposed only for experimentation.

Reviewed By: sammy-SC

Differential Revision: D56886403

fbshipit-source-id: 337277c735c0943ce4ba29bb2d646a72fe101ede
2024-05-08 14:32:24 -07:00
Thomas NardoneandFacebook GitHub Bot c913196cc0 Add native synchronous event support (#44451)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44451

Changelog: [internal]

Exposing the experimental API EventEmitter::experimental_flushSync to trigger synchronous events from Android. The API will be changed in the future, this is exposed only for experimentation.

Reviewed By: NickGerleman

Differential Revision: D56886402

fbshipit-source-id: 7b71cd489e3bb65dffcfb53fef2ea7cafbb973f2
2024-05-08 14:32:24 -07:00
Joe VilchesandFacebook GitHub Bot 88ab1ceeae RN tester example for filters (#44459)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44459

tsia

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D56857709

fbshipit-source-id: 4bbeeed89ec40ca5c9a3472578388699e47f9c9c
2024-05-08 13:39:09 -07:00
Joe VilchesandFacebook GitHub Bot 0dceac9f02 JS plumbing to get filters into native (#44458)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44458

This is the JS plumbing to get it so that views can now use filters. The typing looks like

`filter: [{brightness: 1.5}, {hueRotate: '90deg'}]`

which is different than web which would look like `filter: brightness(1.5) hue-rotate(90deg)`. I feel like the web version is overly complicated and not very *react native-y*. Transform uses the array based approach (albeit they also accept a string). Open to changing this but really feel like the web format is silly and bad since it would just involve parsing some arbitrary string.

The diff includes:

* Style sheet changes so typing is valid
* Process function to turn filter format into {name: string, amount: string}
* Test for process function
* View config changes on Android, iOS and ReactNativeStyleAttributes

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D56845572

fbshipit-source-id: 5029b5adac29bb863c89f6c699d5693c58cad711
2024-05-08 13:39:09 -07:00
Joe VilchesandFacebook GitHub Bot c27f2ab747 Implement brightness and opacity using blend modes (#44457)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44457

Most filters are not going to work on iOS. It is a long story but essentially there is not a good way to continuously get a snapshot of the view and its descendants to filter.

We can, however, implement `brightness` using `compositingFilter` and blend mode. This is really not documented at all, but if you assign a string representing the blend mode to the [`compositingFilter`](https://developer.apple.com/documentation/quartzcore/calayer/1410748-compositingfilter?language=objc) property on CALayer, it will actually work. The filter we use is [`multiplyBlendMode`](https://developer.apple.com/library/archive/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/filter/ci/CIMultiplyBlendMode). As the title suggests this just multiplies the two layers. We can apply this to a `_filterLayer` and set its background color to the brightness amount to get the desired results. Most other color filters either operate on the color components dependently (e.g. new red component depends the value in blue and green), or they have addition operations. We can do addition with `linearDodgeBlendMode`, but the order of operations does not work (we multiply, clamp, then add vs. multiply, add, then clamp).

`opacity` is just a multiplier on the CALayer `opacity` property.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D56447175

fbshipit-source-id: 6705673dd9dec9fc3ec89e49b583523eec1028b7
2024-05-08 13:39:09 -07:00
Joe VilchesandFacebook GitHub Bot d776d8c8a4 Make it so that a view with a filter forms a stacking context and containing block (#44456)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44456

Self explanatory: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_positioned_layout/Understanding_z-index/Stacking_context#description and https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D55044674

fbshipit-source-id: fcc3b04f5b1d5dd11b8e9e15b3c5bdbf9b609f7c
2024-05-08 13:39:09 -07:00
Joe VilchesandFacebook GitHub Bot f340e6e575 Parse raw filter props (#44455)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44455

Title says it all. Right now this ignores drop-shadow as that will be implemented later. Some of this code will need to be adjusted as it is the one filter that takes multiple amounts. But I feel that can be amended later when we get there - after all the `amount` parsing code is just casting to a float at the moment, so we are not locking ourselves into anything.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D54640629

fbshipit-source-id: c8e1206ab46accab3c99614241b8bd9aa252e12c
2024-05-08 13:39:09 -07:00
Joe VilchesandFacebook GitHub Bot 00f3867ac3 Opacity filter on Android (#44454)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44454

tsia

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D56847475

fbshipit-source-id: bbd51e8c744914f1d2caf392996d20ab03b3fb6f
2024-05-08 13:39:09 -07:00
Joe VilchesandFacebook GitHub Bot b0e746e4bb Plumbing to set filters on Android views (#44453)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44453

This works similar to how `transform` is parsed in that it sets tags on the View to actually update the prop when all the prop setters are done being called since the parsing of the array is not very trivial. Besides that it is pretty simple and just calls into `FilterHelper` and uses `setRenderEffect`: https://developer.android.com/reference/android/view/View#setRenderEffect(android.graphics.RenderEffect).

That API is only exposed in version 31 of the SDK so it is gated accordingly.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D54640600

fbshipit-source-id: ad4cde2bed9611f476f4ecb2550c2269965d7917
2024-05-08 13:39:09 -07:00
kaganeceandFacebook GitHub Bot 6213b2a62a fix: deprecated babel plugins issue fixed (#44416)
Summary:
In this pr, I updated the deprecated babel-plugins with their new library. When you enter the npm page of the relevant plugins, it is recommended to implement new packages instead of the deprecated package.
For example :

<img width="1305" alt="Screenshot 2024-05-05 at 17 50 16" src="https://github.com/facebook/react-native/assets/113903710/a58fdac3-79db-4b53-98bd-4c5325a1e560">

## Motivation:

We use the react-native package in our project and aim to upgrade pnpm to the latest version. First, we wanted to clear deprecated warnings. Babel plugin deprecated warnings were caused by the react-native package, so I created this pull request.
Deprecation Warnings from package installing :

<img width="581" alt="Screenshot 2024-05-05 at 17 53 05" src="https://github.com/facebook/react-native/assets/113903710/9c5859a5-f194-43ab-ae35-417dfaacebab">

## Changelog:

[GENERAL][FIXED] - Replace deprecated babel-plugin libraries to fix deprecation warnings on installation

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

Test Plan: CI should pass

Reviewed By: huntie

Differential Revision: D57056843

Pulled By: robhogan

fbshipit-source-id: b75b329bbc2105c31da85e861ef71ffdcbbb0623
2024-05-08 12:51:00 -07:00
Rubén NorteandFacebook GitHub Bot fd299509df Implement potential fix for mounting errors during synchronous state updates (v2)
Summary:
Changelog: [internal]

This is a new attempt at fixing mounting errors during synchronous state updates after what we tried in https://github.com/facebook/react-native/pull/44015.

That fix didn't work because `dispatchMountItems` actually makes a copy of the mount items that it's going to process, so when we added the mount items to the list they were actually not being picked up by the current processing.

This changes the fix to call `dispatchMountItems` as many times as needed, while there are mount items to process in the list.

Reviewed By: sammy-SC

Differential Revision: D57107212

fbshipit-source-id: 46988a71daae15d70399258f850653046d0790ff
2024-05-08 12:36:06 -07:00
Arushi KesarwaniandFacebook GitHub Bot 958f8e2bb5 Remove deprecated measureLayoutRelativeToParent of UIManagerModule (#44452)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44452

`measureLayoutRelativeToParent` was deprecated 5 years ago in D16471845 and doesn't have [JS usages](https://fburl.com/code/tgwon7nb)

For the JS exposed UIManager API for measureLayoutRelativeToParent is through [UIImplementation.measureLayoutRelativeToParent()](https://www.internalfb.com/code/fbsource/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java?lines=804-815)

Hence deleting this for 0.75 Release. This will simplify the backwards compatibility of UIManagerModule

Changelog:
[Android][Removed] Delete UIManagerModule.measureLayoutRelativeToParent()

Reviewed By: javache

Differential Revision: D57069921

fbshipit-source-id: 9f871424a39caf3cbeaa5570c7e101a714c11aa6
2024-05-08 10:23:24 -07:00
Tim YungandFacebook GitHub Bot 4290ef5d0d RN: Cleanup ReactNativeInternalFeatureFlagsMock (#44445)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44445

The `ReactNativeInternalFeatureFlagsMock` module is not references in the open source repository, so there's no reason it should exist there. This cleans that up.

Changelog:
[Internal]

Reviewed By: kassens

Differential Revision: D57052284

fbshipit-source-id: d220eae2ba76f20ed48742779fbffd5de1f77529
2024-05-08 07:14:05 -07:00
Moti ZilbermanandFacebook GitHub Bot 64739066dd Request bundles with excludeSource=true and sourcePaths=url-server in Fusebox experiment (#44444)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44444

Changelog: [Internal] - Request bundles with `excludeSource=true` and `sourcePaths=url-server`.

Changes RN's bundle client to request more efficient source maps from Metro by relying on lazy-fetching of source contents.

NOTE: Requires a Metro version with D56952064 and D56952063 (not yet released on npm) to work properly.

Reviewed By: robhogan

Differential Revision: D56952065

fbshipit-source-id: 0ed083ecc64adbd7acf209bb9abd40db24ffc86b
2024-05-08 07:00:31 -07:00
Moti ZilbermanandFacebook GitHub Bot de1d605253 Add Flow to @react-native/polyfills entry point (#44477)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44477

Changelog: [Internal]

TSIA

Reviewed By: huntie

Differential Revision: D57091620

fbshipit-source-id: 54fd105069ba0a34b9ab5bd12295e4e9641492a3
2024-05-08 06:46:15 -07:00
Blake FriedmanandFacebook GitHub Bot 01cbb173aa Allow apple to configure Hermes as option (#44461)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44461

Users would have to do this by manipulating the environment before.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D57067036

fbshipit-source-id: 6df16c884412578c3b5cae50e26ca37636a7dc5b
2024-05-08 06:43:52 -07:00
Moti ZilbermanandFacebook GitHub Bot 8d0046a5e1 Make INTERNAL_CALLSITES_REGEX work with Windows paths (#44469)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44469

Changelog: [General][Fixed] LogBox and Chrome DevTools stack frame collapsing patterns are now compatible with Windows file paths.

Reviewed By: GijsWeterings

Differential Revision: D57091214

fbshipit-source-id: f62d9fe7f3d4f91ed8ea07521b174989c2dd1c81
2024-05-08 03:52:44 -07:00
monholmandFacebook GitHub Bot 2d8c6f591c docs(react-native): fix app build.gradle react config default paths (#44472)
Summary:
Minor inconvenience I noticed while doing some testing in a mono-repo.

The current paths points to the android folder, but should point to the project root. Currently the android build fails if one uncomments the folder paths as they are.

## Changelog:

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

Pick one each for the category and type tags:

[ANDROID] [FIXED] - Fix incorrect paths in app build.gradle react config block

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

[ANDROID] [FIXED] - Fix incorrect paths in app build.gradle react config block

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

Test Plan:
Uncomment the paths are they are and notice the android build error:
```
FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Failed to notify project evaluation listener.
   > /xyz/xyz/xyz/xyz/RNPathTester/android/node_modules/react-native/ReactAndroid/gradle.properties (No such file or directory)
```

Use the updated paths and notice the build succeeds 🥳

Reviewed By: GijsWeterings

Differential Revision: D57093768

Pulled By: cipolleschi

fbshipit-source-id: 8472151c74c7aa5c51dc75f9adda6116387bdf99
2024-05-08 02:27:23 -07:00
Ramanpreet NaraandFacebook GitHub Bot deee037c62 Back out "chore: Remove deprecated onTextInput callback"
Summary:
Original commit changeset: 89101fa53cdc

Original Phabricator Diff: D56804590

Changelog: [IOS] [Added] - Un-removed deprecated onTextInput callback

Reviewed By: realsoelynn

Differential Revision: D57082228

fbshipit-source-id: 30d62164788b94a9f3193bf78a7bee0c7ce464f6
2024-05-07 20:29:10 -07:00
Nick GerlemanandFacebook GitHub Bot 9da6546967 Avoid ByteBuffer copies when reading nested MapBuffers (#44436)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44436

The backing buffer behind `ReadableMapBuffer` is effectively immutable, so we can make reads of nested MapBuffers work on an inline view of the same buffer. This book-keeping is kept within ReadableMapBuffer (we can not user `ByteBuffer.wrap()` because the fbjni produces ByteBuffer is not array backed).

The main downside I can think of is that the whole buffer is kept in memory until all children buffers leave, but current use-cases don't involve long-term storage of MapBuffer children, so this is probably a better tradeoff.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D57020759

fbshipit-source-id: d2f5a76561fa4a4219fe5022ba62cc96f56ce022
2024-05-07 15:40:37 -07:00
Pieter De BaetsandFacebook GitHub Bot 29c3bc0444 Simplify timer deletion code (#44443)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44443

Call `erase` directly instead of doing `find` + `erase`.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D57049086

fbshipit-source-id: b8a30b66f080897fef31677b2c9e1cdff99a71d2
2024-05-07 15:27:45 -07:00
Alan LeeandFacebook GitHub Bot be09d12667 TextInput - selection prop is not set on component creation (#44398)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44398

**Problem:**
`selection` prop is not being set on component creation.
Not quite sure which RN version this issue was introduced but fixing it on latest code.

Use playground for testing (refer to following diff)

**Proposed Solution:**

Added notes in comments but `viewCommands.setTextAndSelection()` is called only on text or selection update which relies on comparing data with `lastNativeSelection`. Problem is that `lastNativeSelection` is initially set to the props value that is passed in so does not send the command on component creation.

So assign a default selection value of `{start: -1, end: -1}` so it can be set on component creation.

**Changelog:**
[General][Fixed] - `selection` prop in `TextInput` was not being applied at component creation

Reviewed By: cipolleschi

Differential Revision: D56911712

fbshipit-source-id: 7774b246383f85216536040688b0a8ea85b3478a
2024-05-07 13:15:55 -07:00
Nick GerlemanandFacebook GitHub Bot 9b77506309 Fix CSSTokenizer handling of decimals without leading zeroes (#44432)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44432

Implements a bit more of the tokenizer algorithm, to correctly support dimensions like `.25turn` instead of just `0.25turn`.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D57033796

fbshipit-source-id: 6d73de22e3a0f0ca0de432be56bca97f0069ad96
2024-05-07 12:43:59 -07:00