Commit Graph

12270 Commits

Author SHA1 Message Date
Nick Gerleman 2ad51e53f0 Move showSoftInputOnFocus example to TextInputSharedExamples (#44558)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44558

Right now this is only exposed to RNTester on iOS, but the prop exists on both platforms.

Changelog: [Internal]

Reviewed By: javache

Differential Revision: D57281892

fbshipit-source-id: 9effc2b9c6421f8c74a2f4b933ab0fa0f15e7d70
2024-05-14 05:26:35 -07:00
huzhanbo.luc 62cbdbbcc6 fix: android native rejections should be instanceof Error (#44487)
Summary:
fix https://github.com/facebook/react-native/issues/44050

## Changelog:

[ANDROID] [FIXED] - fix: android native rejections should be instanceof Error

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

Test Plan: reject returns Error.

Reviewed By: NickGerleman

Differential Revision: D57205131

Pulled By: javache

fbshipit-source-id: a5950481d0c4909be4dbea0b430e75222258ae68
2024-05-14 04:57:01 -07:00
Sunbreak 7dd91d3437 fix: use local scheduler for thread-safe (#44565)
Summary:
`getScheduler()` is intended for thread-safe

## Changelog:

[Android][FIXED] - local scheduler for thread-safe

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

Test Plan: none

Reviewed By: fabriziocucci

Differential Revision: D57326255

Pulled By: javache

fbshipit-source-id: fa3a1df0f2653d5c286fdb537e0d44ab6fd1ed54
2024-05-14 04:05:36 -07:00
Nick Gerleman 2cc3ba1f19 Mark IntBufferBatchMountItem as nullsafe (#44540)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44540

Noticed when running `arc nn`

> Advice xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/mountitems/IntBufferBatchMountItem.java:39
> [Class has 0 issues and can be marked Nullsafe] Congrats! `IntBufferBatchMountItem` is free of nullability issues. Mark it `Nullsafe(Nullsafe.Mode.LOCAL)` to prevent regressions.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D57249958

fbshipit-source-id: d38559a3fafae0ad778c19dd85c5da610a650d7c
2024-05-14 00:08:56 -07:00
Ruslan Shestopalyuk 61887338ea Kotlinify DeviceInfoModule (#44536)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44536

# Changelog:
[Internal] -

As in the title.

Reviewed By: alanleedev

Differential Revision: D57248069

fbshipit-source-id: 4187b620483d439da5fc4c81012c1124fa19fc09
2024-05-14 00:05:23 -07:00
Ruslan Shestopalyuk 8593eee9fe Kotlinify I18nManagerModule (#44537)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44537

# Changelog:
[Internal] -

As in the title.

Reviewed By: NickGerleman

Differential Revision: D57248159

fbshipit-source-id: 800de0454e4ac1bbb95679eaad6c24dc4d48ad22
2024-05-13 22:45:04 -07:00
Nick Gerleman 44f9371f24 Sanitize measure function results (#44557)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44557

We've started seeing assertion failures in Yoga where a `NaN` value makes its way to an `availableHeight` constraint when measuring Litho tree.

Because it's only happening on Litho, I have some suspicion this might be originating from a Litho-specific measure function. This adds sanitization in Yoga to measure function results, where we will log an error, and set size to zero, if either dimension ends up being negative of `NaN`.

This doesn't really help track down where the error was happening, but Yoga doesn't have great context to show this to begin with. If we see this is issue, next steps would be Litho internal intrumentation to find culprit.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D57285584

fbshipit-source-id: 935fcdd28c05bbac0d73e1c7654ae11a74898537
2024-05-13 17:12:49 -07:00
Nick Gerleman 5a100ae3fe Fix CircleCI Android GTest Build (#44562)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44562

D56963463 deleted some tests for code it also deleted. This broke the Android GTest OSS build, which is a centralized list of these test files. Remove from there as well.

Changelog: [Internal]

Reviewed By: joevilches, realsoelynn

Differential Revision: D57299969

fbshipit-source-id: 1bf0b718ca5fcee03272dd0142f80ea2f8257902
2024-05-13 15:42:56 -07:00
Sam Zhou 062205ba50 Update hermes-parser and related packages to 0.21.1 (#44560)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44560

Changelog: [Internal]

Reviewed By: alexmckenley

Differential Revision: D57289099

fbshipit-source-id: c1525c8e9606a05f479a3964f450c71b131f01f1
2024-05-13 14:16:09 -07:00
Blake Friedman 2fd7733137 Add support for building using Metro (#44464)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44464

Adds `app` to allow building and serving your React Native app in a similar structure to the boostrap and build tasks.  This is the more comprehensive followup to D57067040.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D57067039

fbshipit-source-id: fdbe891657d826535cb779a4d1b71cfd13921684
2024-05-13 14:06:33 -07:00
Blake Friedman 6b56fb0d0b iOS autolinking.rb needs to export react_native_pods.rb (#44462)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44462

Users using the new `react-native/scripts/cocoapods/autolinking.rb` script will expect all of the helper methods previously exposed throug `react_native_pods.rb`.

This was an oversight.

Changelog: [iOS][Fixed] exposes react_native_pods methods through autolinking.rb

Reviewed By: cipolleschi

Differential Revision: D57066094

fbshipit-source-id: d65dc79430101c9c43cbd90d1456630e338a22bb
2024-05-13 14:06:33 -07:00
Blake Friedman fedb1452a2 cli helper methods (#44463)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44463

Helper methods to help the cli grab system state, devices and run react-native/core-cli-utils tasks using Listr.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D57067037

fbshipit-source-id: 28cb4239f3a93558b88417f366a2146f696cc411
2024-05-13 14:06:33 -07:00
Blake Friedman 9b0072ad71 Add metro app building support (#44466)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44466

Contains a *light* wrapper to help launch Metro and build bundles or wait for localhost requests against Metro's dev-server.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D57067040

fbshipit-source-id: 8ab7ecb5d9b98d1abddd5d4f04c7eb25129cd0a1
2024-05-13 14:06:33 -07:00
Nick Gerleman fd8f1f5274 Remove folly::dynamic AttributedString storage (#44512)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44512

We only ever go through MapBuffer now, so we can remove the code related to storing text fragments in folly::dynamic.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D56963463

fbshipit-source-id: 98bce8aa4ccad134ce18bf35028e1b7b5082c3ca
2024-05-13 13:40:53 -07:00
Jorge Cabiedes Acosta 082e29ed4e Fix border-radius percentage formula typo (#44529)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44529

The percentage formula was incorrect. We actually want to consider the shorter side as 100%. If we set a radius > minimum side there are no changes reflected. This is correct on iOS.

D56943825's summary also highlights the reasoning.

Changelog:
[Android][Fixed] Border-Radius percentages are now correctly resolved.

Reviewed By: NickGerleman

Differential Revision: D57214561

fbshipit-source-id: 45125b80289506a6dd51d24451e2b0222cd227c0
2024-05-13 11:10:40 -07:00
Tim Yung 651c1d2cf5 RN: Cleanup Comment Reference to Navigator (#44542)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44542

React Native no longer has a `Navigator` component, so let's clean up this reference in a comment in the `StatusBar` component definition.

Changelog:
[General][Changed] - Obsolete comments referencing Navigator

Reviewed By: GijsWeterings

Differential Revision: D57251899

fbshipit-source-id: bf2923bcaf22daf525381efbc3577c3610afaec4
2024-05-13 08:46:23 -07:00
Tim Yung cdc3b9cdfc RN: Disable Babel Plugin for Arrow Functions for Hermes (#44534)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44534

Reapplies {D50818568} (reverted by D50885400).

Changelog:
[General][Changed] - Disable Babel plugin for arrow functions for Hermes

Reviewed By: robhogan

Differential Revision: D57242622

fbshipit-source-id: 63ec2aeb7562dbb1a049dedd6a35b10aa822193c
2024-05-13 08:45:14 -07:00
Ruslan Shestopalyuk 02d2f8c984 Migrate MathMatrixHelper to Kotlin (#44547)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44547

# Changelog:
[Internal] -

As in the title.

Reviewed By: javache

Differential Revision: D57254265

fbshipit-source-id: 532fd8fe4b120d16b3ec3fa173233a0290c93aff
2024-05-13 07:18:03 -07:00
Fabrizio Cucci f44476dd9d Fix experimental_filter validation error in bridgeless (#44524)
Summary:
Changelog: [Internal]

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

After D56845572, I've started seeing the following redbox when running apps in bridgless mode:

 {F1633641432}

Note sure this is the correct/complete fix but, after this, the error seems to go away.

Reviewed By: RSNara

Differential Revision: D57207925

fbshipit-source-id: c02b9b268c135aabaaa1dc8329abc80ca5c8a500
2024-05-13 04:23:19 -07:00
Kudo Chien c70d791036 Fix dangling surfaces in ReactHostImpl (#44393)
Summary:
Though the `ReactHost.destroy()` is not being used from OSS code, we use it at Expo for expo-dev-client to change loading apps from different dev servers. Without cleanup the `mAttachedSurfaces`, it will have dangling or duplicated attached surfaces that cause duplicated react trees.

<img src="https://github.com/facebook/react-native/assets/46429/f84d274e-aaad-4352-9e3c-6262571a5625">

This PR tries to cleanup the `mAttachedSurfaces` from destroying.

## Changelog:

[ANDROID] [FIXED] - Fixed dangling `mAttachedSurfaces` after `ReactHost.destroy()`

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

Test Plan: have to manually call `ReactHost.destroy()` and recreate the MainActivity without killing the process. then reload the app will startSurface for the same attached surfaces.

Reviewed By: RSNara

Differential Revision: D56901863

Pulled By: javache

fbshipit-source-id: c7f822501d971810ac6aa7262b15da69ec41355e
2024-05-13 04:04:07 -07:00
Pieter De Baets 596e14e423 Fix missing systrace marker end (#44527)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44527

Marker was never closed.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D57204350

fbshipit-source-id: 271d285fa55d72e9d3b2f74575ebff5a3fc01045
2024-05-13 03:58:13 -07:00
Dmitry Rykun 6a75662c9c Back out "Fix race condition in native module invalidation" (#44523)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44523

This is a revert of https://github.com/facebook/react-native/pull/44048
The original change has introduced some regression in native module invalidation stability.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D57207598

fbshipit-source-id: eb967102351434c652cb9d6f9935cbf9952d7328
2024-05-13 02:47:18 -07:00
Nick Gerleman a37111a4dd CSS function component values (#44470)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44470

CSS component values, as defined in the syntax spec, are either "preserved tokens", CSS functions, or simple blocks. This is distinct from the higher-level "component value type" specified in the [values and units](https://www.w3.org/TR/css-values-3/#component-types) spec.

I was previously short-circuiting a bit, from preserved tokens, to a higher level data structure. This separates them out, adding a layer exposing the preserved token as `CSSSyntaxParser::Token`, and now a `CSSSyntaxParser::Function`, which can represent a named function and its nested component values.

This does not yet wire functions beyond CSSParser returned component values.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D57089275

fbshipit-source-id: 97eeb1a7b3363c79d99f9419ba6e022c4c3c31d0
2024-05-11 16:37:39 -07:00
Samuel Susla 3f17c8b5f0 isolate mapbuffer only to components that use it (#44521)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44521

changelog: [internal]

mapbuffer leaks into every component even though it is only used by 2: Paragraph and TextInput. Let's isolate it only to those two.

To do that, I added a new template prop: usesMapBufferForStateData. It is false by default and only Paragraph and TextInput set it to true.

Reviewed By: christophpurrer

Differential Revision: D56636011

fbshipit-source-id: 4a99e6e68caaf40111b6b7b205854a71f33c5864
2024-05-11 03:11:21 -07:00
Nicola Corti 5c798fa2df Bump AGP to 8.4.0 (#44493)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44493

Just keeping our version of AGP up to date.

Changelog:
[Internal] [Changed] - Bump AGP to 8.4.0

Reviewed By: arushikesarwani94

Differential Revision: D57104079

fbshipit-source-id: 4d5c0dec95bf73696a0274f61e0536e53c11adaf
2024-05-10 17:32:23 -07:00
Alex Hunt 88526e9d34 Update Fusebox welcome notice, fix dark mode styling (#44530)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44530

- Update notice when debugger is connected, removing internal Fusebox codename.
- Explicitly set black foreground for highlighted text, to fix dark mode styling in DevTools console.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D57215418

fbshipit-source-id: a82a12744e029e573000733f7842c1e082b0a620
2024-05-10 14:21:43 -07:00
Rubén Norte 1db50a37d6 Guard against null rootShadowNode in IntersectionObserverManager for initial notifications (#44528)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44528

Changelog: [internal]

In the `IntersectionObserver` API we dispatch the initial notification in the `observe` method, but it might be possible that the surface has been removed from the registry by the time we execute that code.

This guards against that case to possibly fix a crash we're seeing in on the `IntersectionObserver` experiments.

Reviewed By: sammy-SC

Differential Revision: D57213994

fbshipit-source-id: 5cd1f16958949cc1ff64153e8012e6a59819d68a
2024-05-10 11:26:57 -07:00
Eric Rozell 36dc7b4523 Clean up dead code in LogBoxStateSubscription (#44513)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44513

The removed code was moved to LogBoxInspectorContainer, and is not referenced inside the LogBoxStateSubscription component.

## Changelog

[Internal]

Reviewed By: GijsWeterings

Differential Revision: D57168569

fbshipit-source-id: 07f843b2df126cc05f65937dd44781525d6afeb4
2024-05-10 10:01:41 -07:00
Gijs Weterings 143e31058c Fix xplat/endtoend/jest-e2e/apps/facebook_xplat/ReactNativeCoreE2E/__tests__/Border-corner-radii-elevation-percentages-e2e.js to actually use the right example (#44525)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44525

These examples were added, but their names were duplicated. This caused our internal e2e tests to accidentally target the wrong examples.

Changelog:
[General][Fixed] RNTester examples for border percentages are now properly covered by E2E screenshot tests.

Reviewed By: NickGerleman

Differential Revision: D57207306

fbshipit-source-id: 32ed5cc6b136a8928b11afe8b824c752edcdd9e5
2024-05-10 09:38:34 -07:00
Alex Hunt 01afb08165 Tweak paused overlay design, widen tap area
Summary:
Tweaks the Paused Debugger Overlay design on iOS. The tap area to resume the application is now the entire "Paused in debugger" item.

|Before|After|
| {F1578785144} | {F1578734918} |

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D57161216

fbshipit-source-id: 581ebe44e45a57cdfe3e617e8f97f78619f84e73
2024-05-10 09:10:53 -07:00
Ruslan Shestopalyuk 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 Shestopalyuk 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 Shestopalyuk 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 Susla 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 Baets 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 Ying 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 Shestopalyuk 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
huzhanbo.luc 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 Vanderwerff 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 Gerleman 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 Gerleman 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 Gerleman 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 Gerleman 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 Shestopalyuk 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 Vilches 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 Acosta 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 Acosta 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) 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 Chui 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 Chui 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