Commit Graph

33305 Commits

Author SHA1 Message Date
Gabriel Donadel b7bcdcd8ee chore: Add changelog for 0.75.4 (#46792)
Summary:
Adds changelog for the 0.75.4 patch.

## Changelog:

[Internal] [Changed] - Add 0.75.4 changelog

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

Reviewed By: blakef

Differential Revision: D63766181

Pulled By: cipolleschi

fbshipit-source-id: f1b4e9e0676bc7dd32fe9d86386552f273fdcc75
2024-10-03 04:10:05 -07:00
Nicola Corti df396d5361 Unbreak build_android (#46806)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46806

This fixes the CI which is currently red due to wrong C++ imports.

Changelog:
[Internal] [Changed] - Unbreak build_android

Reviewed By: javache, cipolleschi

Differential Revision: D63826953

fbshipit-source-id: 4d9e407331af666a420cf56178420df40e598ef4
2024-10-03 03:40:53 -07:00
Alex Hunt 19b971ff94 Remove run on iOS/Android key handlers (#46781)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46781

Implements https://github.com/react-native-community/discussions-and-proposals/discussions/821.

Changelog:
[General][Removed] - Remove "run on iOS" and "run on Android" from the dev server key commands

Reviewed By: cortinico

Differential Revision: D63534248

fbshipit-source-id: 003d4c639bbf9128f921936508a62de2caadac5e
2024-10-03 03:39:04 -07:00
Joe Vilches 5e47ef991e Back out "Plumbing to get boxSizing prop to Yoga" (#46794)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46794

Original commit changeset: f57e9a51236c

Original Phabricator Diff: D63430964

Seeing some issues with this so gonna turn it off for the meantime.

Changelog: [Internal]

Differential Revision: D63777437

fbshipit-source-id: fe8abd0110b2cf7296911c5b1e95ada40d30994c
2024-10-02 15:56:38 -07:00
Joe Vilches 32dd52e027 Back out "Add RNTester box sizing example and e2e test" (#46795)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46795

Original commit changeset: d7bb6f115bca

Original Phabricator Diff: D63471840

See previous diff, there were some problems

Changelog: [Internal]

Differential Revision: D63777438

fbshipit-source-id: ea9f370eade10282fcee84d07d709b549dde1b6d
2024-10-02 15:56:38 -07:00
Nick Gerleman 62b7396bf4 Fix onEndReached not being called when getItemLayout is present and we scroll past render window (#46736)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46736

Copying the comment in code:

> We only call `onEndReached` after we render the last cell, but when getItemLayout is present, we can scroll past the last rendered cell, and never trigger a new layout or bounds change, so we need to check again after rendering more cells.

Changelog:
[General][Fixed] - Fix onEndReached not being called when getItemLayout is present and we scroll past render window

Reviewed By: yungsters

Differential Revision: D63643856

fbshipit-source-id: 9c53789cb15b225ceac353c37cbb67f7beeaf4fb
2024-10-02 15:53:55 -07:00
Benoit Girard b3bc6ea69c Create ReactPerfLogger to log to Perfetto and Fusebox (#46793)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46793

Currently performance logging has several problems:
- We have widly different APIs. It's hard to know which to use for what.
- Most of these APIs don't allow retroactive timestamp which is important for hero logging and react flame graphs
- These APIs aren't accessible from JS/C++/Java/Koltin (this part will be fixed in another diff)
- Logging doesn't go to the right place. It either only goes to Systrace, or Perfetto but with broken async timeline etc...

This diff start addressing the problem by refactoring. Currently performance.measure/performance.mark are the best APIs. Let's start with refactoring them so that we can call them directly without the otherwise PerformanceEntry side effects.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D63560473

fbshipit-source-id: 86755b3e8491a7cf6919173a07ba9421cd30e663
2024-10-02 12:35:05 -07:00
Rubén Norte 4b82922ac5 Fix reported properties for native modules (#46788)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46788

Changelog: [internal]

This fixes the reported keys for C++ TurboModules:
```
import MyNativeCppModule from 'MyNativeCppModule';

Object.keys(MyNativeCppModule); // [] - expected
Object.keys(Object.getPrototypeOf(MyNativeCppModule)); // [] - NOT expected
```

Before, we were trying to read the properties from the method map in the public `TurboModule`, but in this implementation all the logic is actually in its delegate (also a `TurboModule` instance, yeah, confusing).

This fixes the issue by forwarding the call to the delegate that has the right information.

Reviewed By: javache

Differential Revision: D63761381

fbshipit-source-id: 90bd216efa0f60352c5ca341d210d83239c80dba
2024-10-02 12:25:06 -07:00
Samuel Susla 7b577065a6 make sure logs reflect new class name (#46785)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46785

changelog: [internal]

Make sure logs match the class name

Reviewed By: rubennorte

Differential Revision: D63757693

fbshipit-source-id: 815e70e8ae38d99b1908d3aa2a9cfffdd9dc9851
2024-10-02 12:00:07 -07:00
Alex Hunt c430083fa0 Update modern inspector targets to directly send CDP title and description (#46780)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46780

This is primarily a debugger server change to better-align the `title` and `description` fields (visible in via the CDP `/json/list` endpoint), reporting them directly from the device.

For React Native users, the net effect of this change is to improve/align the display name for each debugger target in the CLI multi-select menu (`j` to debug). This change may also be useful for discovery in non-Fusebox frontends such as VS Code (`vscode-expo` extension).

Changes:
- Rename `title` prop on `InspectorPageDescription`/`IInspector::addPage` to `description` (no call site changes).
- Add `deviceName` param to `InspectorPackagerConnection`.
- Move the page `description` to the `description` JSON field.
- Update `InspectorPackagerConnection::Impl::pages()` to return new `title` and `description` fields.
- Align `OpenDebuggerKeyboardHandler` to display `title` field.
- Deprecate the nonstandard `deviceName` field.

**Before**

```
[
    {
        "id": "3c9f24bedab0e73fca6a1b295030e7af9346a8c0-1",
        "title": "React Native Bridgeless [C++ connection]",
        "description": "com.facebook.RNTester",
         ...
    }
```

The `description` field was previously the closest thing we had to a target identifier. Today, this is not needed, since we have the stable `reactNative.logicalDeviceId` field.

**After**

```
[
    {
        "id": "3c9f24bedab0e73fca6a1b295030e7af9346a8c0-1",
        "title": "com.facebook.RNTester (iPhone 16 Pro)",
        "description": "React Native Bridgeless [C++ connection]",
         ...
    }
```

The `title` field is now more human readable and aligned with what we render in the window title of React Native DevTools. The `description` field describes the type of debugger target (the specific React Native implementation).

Changelog: [Internal]

Reviewed By: vzaidman

Differential Revision: D63329456

fbshipit-source-id: cfe98f77e31c729431005925cfc66e2780ef8c72
2024-10-02 07:30:31 -07:00
Samuel Susla 07c02d4427 prevent C++ state update in RCTScrollViewComponentView if value is the same (#46782)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46782

changelog: [internal]

Avoid setting C++ state for the same contentOffset. This is redundant work and can be safely avoided.

Reviewed By: NickGerleman

Differential Revision: D63700308

fbshipit-source-id: d6ea8cf6a1da47a13787b49abd66a87e3da57d34
2024-10-02 07:28:32 -07:00
Riccardo Cipolleschi 519e07ae62 Add changelog for 0.74.6 (#46783)
Summary:
Add changelog for 0.74.6

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

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

Test Plan: N/A

Reviewed By: cortinico

Differential Revision: D63756879

Pulled By: cipolleschi

fbshipit-source-id: c36fae089c58fad49f45fa3b3380c38490d67293
2024-10-02 07:16:21 -07:00
Pieter De Baets c06b1e9a0b Rollout destroyFabricSurfacesInReactInstanceManager (#46778)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46778

This has been rolled out internally already and is a good cleanup for OSS too. We no longer use this config externally (BRIDGE+FABRIC) so this shouldn't actually affect the new arch rollout.

Changelog: [Internal]

Reviewed By: fabriziocucci

Differential Revision: D63752084

fbshipit-source-id: da3025f7b072dc7b82f8de22ff247b3979ae64d0
2024-10-02 05:10:49 -07:00
Pieter De Baets 17f4c45eed Add missing lock in ReactInstanceManager#attachRootView (#46776)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46776

All other paths that touch `mAttachedReactRoots` uses this lock. We expect this to address a crash we're seeing in production where `startSurface` is invoked multiple times.

Changelog: [Internal]

Reviewed By: fabriziocucci

Differential Revision: D63752083

fbshipit-source-id: f06d07aa70719945f6956fbf6e0cde3e9c8e8ed0
2024-10-02 05:10:49 -07:00
Pieter De Baets 5b5e150eaf Fix Cxx TurboModule methods not being cached (#46751)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46751

rubennorte noticed that some turbo module methods were not getting cached on the jsRepresentation as expected. This is caused by the react-native-codegen wrappers we generate overriding the `get` method and bypassing this caching layer. Instead they should be overriding `create` to lazily allocate new properties. To prevent this from re-occuring, I've made `get` final so no other overrides can happen.

## Changelog:

[General][Fixed] Properties for C++ TurboModules using codegen were not correctly cached
[General][Breaking] TurboModule::get is now a final method, override `create` to customize property lookup

Reviewed By: rubennorte

Differential Revision: D63665966

fbshipit-source-id: c614901c2f0d698147ec9ba36a4b592ed3d37652
2024-10-02 05:10:33 -07:00
Rubén Norte 44f431b471 Make detail readonly in PerformanceMark (#46697)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46697

Changelog: [internal]

This is already the case in `PerformanceMeasure` but for some reason we didn't apply it here as well.

Reviewed By: rshest

Differential Revision: D63541134

fbshipit-source-id: 262d504ed153e07e89492945f761887729bad9e0
2024-10-02 03:13:24 -07:00
Rubén Norte 434decb409 Optimize locks in PerformanceEntryReporter (#46698)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46698

Changelog: [internal]

Small optimization to use readers/writers for locking in `PerformanceEntryReporter`.

Reviewed By: rshest

Differential Revision: D63540236

fbshipit-source-id: 80b3fd313453ad8da4f0af2deaab61a86064b4b7
2024-10-02 03:13:24 -07:00
Rubén Norte 559c6029fd Refactor Performance and PerformanceObserver internals (#46693)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46693

Changelog: [internal]

This unifies the native modules for `Performance` and `PerformanceObserver` in the same module. Keeping them separate is artificial and introduces unnecessary duplication. These APIs are very closely related so it makes sense to unify

Reviewed By: javache

Differential Revision: D63471855

fbshipit-source-id: fa8c5dc7b7c68954fc11867f68909d2c6c2ee85c
2024-10-02 03:13:24 -07:00
Rubén Norte b62ae0d02b Remove dependency to PerformanceEntryReporter singleton from RuntimeSchedulerTest (#46760)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46760

Changelog: [internal]

Relying on the singleton was causing issues in iOS tests for RuntimeScheduler. This fixes those issues.

Reviewed By: rshest

Differential Revision: D63702251

fbshipit-source-id: 42b98e673ffba6f45b52510cdb3eea410e55b894
2024-10-02 03:13:24 -07:00
Rubén Norte 0fb3c24a82 Small renames in PerformanceEntryReporter (#46688)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46688

Changelog: [internal]

Just aligns on `report*` as the public API in `PerformanceEntryReporter` (e.g.: `measure` -> `reportMeasure`, `logEventEntry` -> `reportEvent`, etc.).

Reviewed By: rshest

Differential Revision: D63471856

fbshipit-source-id: 59617160c238aaefaefe8b6fc27de4481ef32ada
2024-10-02 03:13:24 -07:00
Tim Yung de927e6138 Animated: Enqueue Completion Callbacks in Microtask (#46714)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46714

Sets up a feature flag to experiment with scheduling `Animation` completion callbacks in a microtask instead of executing them synchronously. (The completion callback is the callback passed into `animation.start(<callback>)`).

There are currently 4 potential scheduling behaviors of the animation completion callback:

- Synchronously when `start()` is invoked, for spring and timing animations that immediately complete (e.g. no delays and not native driver).
- Synchronously when `stop()` is invoked, if the animation has not yet completed.
- Synchronously during the layout effect phase, or commit phase (if the `useInsertionEffectsForAnimations` feature flag is enabled), if the animation has not yet completed.
- Asynchronously when the animation completes (e.g. non-zero delay or when the native driver is employed).

The wide number of variables and the timing-dependent nature of these variables means that the behavior of the completion callback is very non-deterministic.

Imperically, we have also found that most codebases using `useNativeDriver` mostly have completion callbacks executed asynchronously. However, this leads to surprising problems where the callback causes unpredictable behavior when it is called synchronously (e.g. when the animating component is unmounted *during* the animation).

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D63573322

fbshipit-source-id: 16c48be78c9ac65a64021249fad10f7265737c44
2024-10-02 02:07:00 -07:00
Tim Yung 11bf3a32e1 Animated: Rename __debouncedOnEnd to __notifyAnimationEnd (#46718)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46718

Simple rename of a protected method that should not be called by anyone outside of the `Animation` class and its subclasses, just to make it more intuitive.

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D63572363

fbshipit-source-id: cf68f63a9b361767b9dbfcd73124bcdae7a1806e
2024-10-02 02:07:00 -07:00
Tim Yung b519d49106 Animated: Hoist Common Logic to Parent Class (#46717)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46717

Reduces redundancy and cleans up the layers of abstraction between the `Animation` class and its subclasses, by hoisting common and duplicated logic into the parent class.

I also cleaned up the Flow types in these files while I was at it.

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D63572064

fbshipit-source-id: ab6bf7265b67ab38cc5a9d5c94f8cd1456c93f23
2024-10-02 02:07:00 -07:00
Tim Yung fd8cf19625 Animated: Fail Fast on Native Driver Incompatibility (#46720)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46720

Refactors the `Animation` subclasses (from Animated) such that using `useNativeDriver` with a non-native `AnimatedValue` will consistently fail when calling `start()`.

The current behavior is inconsistent because if a timing or spring animation has a non-zero delay, the error will be thrown in asynchronously in a timeout.

Changelog:
[General][Changed] - Animations started with incompatible `useNativeDriver` and `AnimatedValue` configurations will now synchronously fail. Previously, spring and timing animations with non-zero delays would throw the error asynchronously.

Reviewed By: javache

Differential Revision: D63572062

fbshipit-source-id: 2619e2867fe7754695e3347c838ad6fe136a6614
2024-10-02 02:07:00 -07:00
Tim Yung 63100a9639 Animated: Simplify TimingAnimation#start Logic (#46719)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46719

Implements a minor refactor of `TimingAnimation#start` so that we standardize how the `_useNativeDriver` case is handled.

There is no behavior change from this besides more consistently assigning to `this._startTime`. (Previously, we would not set it if the duration were 0 and `!useNativeDriver`.)

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D63572066

fbshipit-source-id: 9cbd05c5ca5e00227be69441b9d7d8a502690246
2024-10-02 02:07:00 -07:00
Tim Yung 85aa9278f9 Animated: Change nativeID to Private Property (#46716)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46716

Changes `_nativeId` to be a private property in the `Animation` class (from Animated).

Changelog:
[Internal]

Reviewed By: javache

Differential Revision: D63572065

fbshipit-source-id: 24facca0ccb1256f602ec4406bf8c0b22c4bbf96
2024-10-02 02:07:00 -07:00
Tim Yung b3fe06b268 Animated: Change onEnd to Private Property (#46721)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46721

Currently, the `Animation` class (from Animated) defines an unofficially protected `__onEnd` property that subclasses are expected to populate. However, subclasses are expected to *not* invoke `__onEnd`, but instead call `__debouncedOnEnd`.

In order to make this code less fragile, this commit refactors the `Animation` class and its subclasses so that `onEnd` is stored in a private property and initialized by the `start` method in the `Animation` parent class. Now, the only way to invoke the `onEnd` callback is by calling `__debouncedOnEnd`.

The subclasses have been adjusted to call the `start` superclass method to initialize this.

Changelog:
[General][Changed] - The `Animation` superclass no longer exposes `__onEnd` as a property. Subclasses must instead invoke `super.start(…)` in their `start()` implementation.

Reviewed By: javache

Differential Revision: D63572063

fbshipit-source-id: 221153ca890c67c59713d607032536f57d7a5b0a
2024-10-02 02:07:00 -07:00
Tim Yung fd355308fa Animated: Fix NativeAnimatedModule Mock for Jest (#46715)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46715

Properly mocks `NativeAnimatedModule` in Jest so that we can cleanup the `process.env.NODE_ENV` checks in Animated.

Changelog:
[General][Added] - Added Jest mocks for `NativeAnimatedModule`

Reviewed By: javache

Differential Revision: D63572067

fbshipit-source-id: a4fcedeebbaaa47a34bb356305652a3ed6358855
2024-10-02 02:07:00 -07:00
Tim Yung 177697f539 RN: Migrate to HostInstance Type (#46742)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46742

Migrates type definitions in React Native to use the newly created `HostInstance` type instead of `NativeMethods` and `React.ElementRef<HostComponent<T>>`.

Changelog:
[General][Changed] - Simplified Flow types to use `HostInstance` (which changing nominal types).

Reviewed By: NickGerleman

Differential Revision: D63646763

fbshipit-source-id: 904894dc40da4d2e70bcb6df47018fc6248ea972
2024-10-01 22:51:48 -07:00
yungsters (Meta Employee) e24f9917c2 Define HostInstance type for React Native (#46743)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46743

Creates a new `HostInstance` type for React Native, to more accurately capture the intent most developers have when using the `NativeMethods` type or `React.ElementRef<HostComponent<T>>`.

Since `React.ElementRef<HostComponent<T>>` is typed as `React.AbstractComponent<T, NativeMethods>`, that means `React.ElementRef<HostComponent<T>>` is equivalent to `NativeMethods` which is equivalent to `HostInstance`.

Changelog:
[General][Added] - Added `HostInstance` type to represent the instance of a `HostComponent<T>`.

Test Plan:
Ran the following successfully:

```
$ cd ~/fbsource
$ js1 flow
```

Reviewed By: NickGerleman

Differential Revision: D63646555

Pulled By: yungsters

fbshipit-source-id: 075859e6b0217521ba9ab2b92843ae7e47db5be0
2024-10-01 22:51:48 -07:00
Ariel Lin d4ea147b41 add support for Android's "High Text Contrast" setting into AccessibilityInfo (#46746)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46746

This change adds `isHighTextContrastEnabled()` to `AccessibilityInfo` to enable access to Android OS's "High contrast text" setting option. It also adds a new event, `highContrastTextChanged`, to enable listeners to subscribe to changes on this setting.

## Changelog

[Android][Added] - Added `isHighTextContrastEnabled()` to `AccessibilityInfo` to read `ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED` setting value

Reviewed By: NickGerleman

Differential Revision: D63155444

fbshipit-source-id: 9829b40e6c183f6beba732190dc318894e9d9a3f
2024-10-01 19:57:46 -07:00
Samuel Susla d19a2178b6 remove use of type alias from Differentiator (#46762)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46762

changelog: [internal]

Typealias NonOwningList obscures the underlaying type and provides limited benefit. Using std::vector<ShadowViewNodePair*> is more readable.

Reviewed By: NickGerleman

Differential Revision: D63396285

fbshipit-source-id: 70cda3f33a7649cabbf5888fbefe0610d2c002b3
2024-10-01 17:31:46 -07:00
Alex Hunt ebc699ce7f Tweak start command output (#46770)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46770

Small updates to the `react-native start` command CLI output:

- Change "Welcome..." text to blue.
- Display server base URL instead of port only.
- Embolden key command letters.
- "Ctrl+C to exit" prompt.
- Extra newlines for balance.

Changelog: [Internal]

Reviewed By: cortinico, cipolleschi

Differential Revision: D63328267

fbshipit-source-id: 119ddb2ba68c99df532840285c3c1f922e727e8b
2024-10-01 17:14:43 -07:00
Alex Hunt df8f4d6b5d Replace and remove optional dep on cli-tools logger (#46769)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46769

(Further refactors to logging after D63255296.)

Fully decouples `community-cli-plugin` from the unlisted optional dependency on `react-native-community/cli-tools'`. This is motivated by changes in https://github.com/facebook/react-native/pull/46627 which switch to using Metro's `TerminalReporter` API for emitting logs safely.

- Swaps out logs in the dev server for the `unstable_server_log` Metro reporter event.
- Swaps out `logger.debug()` calls for the `debug` package, currently used by Metro and `dev-middleware`.
- Swaps out other logs in the `bundle` command for `console`.
- (Also specify missing `semver` dep.)

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D63328268

fbshipit-source-id: f552748ecc3456bd5fb8870c3a51d744a6bf3e70
2024-10-01 17:14:43 -07:00
Alex Hunt b52bbb4d21 Simplify key handling in start command (#46768)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46768

Remove the `KeyPressHandler` util in favour of using the `process.stdin` APIs inline.

This reduces complexity (where we were effectively not using the conditional interception this previously implemented — see also https://github.com/facebook/react-native/pull/46416), and more closely mirrors our internal dev server setup.

Resolves https://github.com/facebook/react-native/issues/46571.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D63255321

fbshipit-source-id: 5cdf7a480053a2215fa50f544733f443bab07ef2
2024-10-01 17:14:43 -07:00
Alex Hunt 7186fdeb1c Replace execa with child_process (#46767)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46767

Swaps out `execa` dependency for Node's built in `child_process`.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D63255320

fbshipit-source-id: ce7ef5e2ea78aa96c61815ff8c1e054a8f04e8b0
2024-10-01 17:14:43 -07:00
Joe Vilches e1246f04d1 Add RNTester box sizing example and e2e test (#46765)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46765

Tests are good!

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D63471840

fbshipit-source-id: d7bb6f115bcae502e9f8b5ce2a12df8e850d5c26
2024-10-01 15:19:22 -07:00
Joe Vilches 39b9cf2412 Plumbing to get boxSizing prop to Yoga (#46766)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46766

tsia!

Changelog: [Internal]

Reviewed By: rozele

Differential Revision: D63430964

fbshipit-source-id: f57e9a51236cb4c7d4c284af6987f88f9c7597da
2024-10-01 15:19:22 -07:00
Joe Vilches 11ef671063 Camel case *AxisownerSize (#46744)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46744

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

This was annoying me :)

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D63424778

fbshipit-source-id: 8f9df4e92bde251214f4c1d61ff8282d56f87816
2024-10-01 15:19:22 -07:00
Joe Vilches d06a9b356b Let flex basis support content box (#46740)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46740

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

The flex basis length applies to the value of `box-sizing` per the spec: https://drafts.csswg.org/css-flexbox-1/#flex-basis-property

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D63424590

fbshipit-source-id: f73bffd30cc7b673453a55089ecc880819d3d788
2024-10-01 15:19:22 -07:00
Joe Vilches 353529867f Impl of content box (#46741)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46741

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

box sizing is really just a reinterpretation of what length properties (like `width`, `height`, `max-width`, etc) mean. So to implement this I just add the border and padding if we are in content box when we ask for any of these properties. All the math that gets done by the algorithm is still in border box land, and the layout we return is to be interpreted as the border box (this is actually the expected behavior per https://drafts.csswg.org/css-sizing/#box-sizing). This makes this implementation pretty simple actually.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D63416833

fbshipit-source-id: fd76132cf51e8a5092129802c3a12ab24023018b
2024-10-01 15:19:22 -07:00
Joe Vilches 999a66b2a3 Clean up calls to dimension() with a hardcoded FlexDirection (#46739)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46739

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

This is a bit more clear, imo

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D63408245

fbshipit-source-id: cea9723914f69d2697e18c8bfe2b55c830af2b6a
2024-10-01 15:19:22 -07:00
Joe Vilches e704f3ba9b Rename Node.h's getResolvedDimension to getProcessedDimension (#46649)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46649

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

To get the height and width we call a function currently named `getResolvedDimension`. This returns a `Style::Length`, which in most cases we "resolve" immediately by calling `resolve`. This is a bit confusing that you need to `resolve` something that is already `resolved`.

I plan on adding a new function soon for `contentBox` which would resolve the length for you, so I think this should be renamed.

Also deleted unused `getResolvedDimensions`

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D63407730

fbshipit-source-id: e855c17d9c99817be308b7263fcb5d43559ede14
2024-10-01 15:19:22 -07:00
Nick Gerleman 267b250690 Cleanup background drawing feature flags (#46761)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46761

The legacy paths for this is all gone and non functional. We can clean thes up fully now.

Changelog: [Internal]

Reviewed By: rshest, Abbondanzo

Differential Revision: D63652264

fbshipit-source-id: cabc1af0098553c64f834e6bc30000ef7a942a4c
2024-10-01 12:46:29 -07:00
Christoph Purrer 1118cc6327 Share TextInputEventEmitter between C++ platforms (#46198)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46198

Extending on https://github.com/facebook/react-native/pull/43431 this change allows to share the TextInputEventEmitter with our C++ based platforms such as RN Windows > https://github.com/microsoft/react-native-windows/blob/main/vnext/Microsoft.ReactNative/Fabric/Composition/TextInput/WindowsTextInputEventEmitter.h

## Changelog:
[Internal] - Share TextInputEventEmitter between C++ platforms

Reviewed By: NickGerleman

Differential Revision: D61749959

fbshipit-source-id: 2526bf29200cd6a3dc6d5eaef5edbaf4b1df5751
2024-10-01 12:35:16 -07:00
Alex Hunt aa55d765e5 Add CLI selection of multiple debug targets (#46627)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46627

IMPORTANT: Requires a Metro bump, CI will fail until updated.

Introduces a target selection API for launching React Native DevTools when more than one device is connected.

Credit to robhogan for the initial internal implementation of `OpenDebuggerKeyboardHandler`!

(This leverages recent additions to Metro's reporter API — which we should follow up on to use for the rest of `community-cli-plugin`. Notably, using `TerminalReporter` ensures server output won't conflict with Metro's own event and progress logs.)

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D63255295

fbshipit-source-id: da93500358791eabe4cab433cad31b82d518fb5f
2024-10-01 11:27:41 -07:00
Alex Hunt 7c2a7de162 Bump Metro to 0.81.0-alpha.2 (#46703)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46703

Updates us in line with the release branch and unblocks https://github.com/facebook/react-native/pull/46627.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D63544047

fbshipit-source-id: 4c093e6c2fc389888f12063df013db7023761859
2024-10-01 11:27:41 -07:00
Blake Friedman ffb10b5b4c Replace sh scripts with tested JS scripts to release template (#46363)
Summary:
The previous scripts to trigger the react-native-communty/template
release workflow has not been working. This is a rewrite is js, along
with some testing to make this more robust.

I've have a PR to combine the publish and tag steps in the template publication: https://github.com/react-native-community/template/pull/65, this takes advantage of that change.

Changelog: [Internal]

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

Test Plan:
1. Unit tests
2. Once the infrastructure lands in the `react-native-community/template` workflow, we can trigger a dry run.

## TODO:
- ~~Still needs to be used in the GH release workflow.~~
- ~~Template release workflow needs to land the dry_run input change.~~

## Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D62296008

Pulled By: blakef

fbshipit-source-id: 217326c44b1d820e36a1d847cf9ad24d228087c1
2024-10-01 11:03:36 -07:00
Rubén Norte a5e430579e Improve RNTester example for performance.mark/measure (#46759)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46759

Changelog: [internal]

This improves the example in RNTester for `performance.mark` and `performance.measure` by only listing the marks/measures explicitly emitted from the example. This removes noise if other parts of the app are logging marks/measures as well.

Reviewed By: rshest

Differential Revision: D63695731

fbshipit-source-id: f65cf59363da0e6c9e0b3ffadf05abd2eb5a214c
2024-10-01 11:03:31 -07:00
Riccardo Cipolleschi eaa780de1c Fix crash for Modal not attached to window manager (#46758)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46758

There are some occurrencies where the Modal results not attached to the Window, perhaps when the app is backgrounded.

This trigger an exception `java.lang.IllegalArgumentException: View=DecorView@b9f88af[AdsManagerActivity] not attached to window manager`.\

This was fixed already but the conversion from Java to Kotlin missed a condition in the `||` clause. We are adding it back.

## Changelog
[Android][Fixed] - Fix crash for Modal not attached to window manager

## Facebook
The original fix is in this diff  D22264672 by mdvacca
Also see this post: https://fb.workplace.com/groups/rn.support/permalink/27047414764880449/

Reviewed By: cortinico

Differential Revision: D63700769

fbshipit-source-id: bc8a44868d5cacb8822e1646c2b7643682f45e1b
2024-10-01 10:59:40 -07:00