Commit Graph

32917 Commits

Author SHA1 Message Date
Vitali Zaidman
5cdfec9843 update metro version in react-native (#46264)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46264

React-native was not in sync with metro changes that RN relies on

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D61982240

fbshipit-source-id: 63b1f53174ab0ec663a537569a032c62c431eb83
2024-08-30 05:26:34 -07:00
Edmond Chui
2cfd082659 Update debugger-frontend from ae992da...d3a8d98 (#46265)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46265

Changelog: [Internal] - Update `react-native/debugger-frontend` from ae992da...d3a8d98

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](ae992da402...d3a8d98f14).

Reviewed By: huntie

Differential Revision: D61976181

fbshipit-source-id: 2d9d723246c2c04eeb027ec44a48f9e6278d2fa5
2024-08-30 05:08:56 -07:00
Joe Vilches
defb0bd137 Add more tests for border + child interaction (#46195)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46195

go tests!

Testing
* Symmetrical, transparent border clips to padding box (wrong behavior atm)
* Asymmetrical, transparent border clips to padding box (wrong behavior atm)
* Children render over borders with no clipping (correct behavior atm)

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D61695025

fbshipit-source-id: 01eb69193df4f2d4c71dc7f9bf764a4554777c97
2024-08-30 02:00:19 -07:00
Joe Vilches
4f50aca247 Decouple clipping logic from border drawing (#46191)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46191

Borders should not have to deal with clipping logic, that is fairly independent.

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D61418470

fbshipit-source-id: 762dbf30d50b5ce9b2b73720e58625447d8bf00e
2024-08-30 02:00:19 -07:00
Joe Vilches
7653f7600e Decouple background color from border drawing (#46190)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46190

Right now the background color is tightly coupled with border drawing. For starters, I find this a bit confusing as one would not assume they are very closely related. But this also causes a bug around not being able to properly clip to the padding box, because if we did this we would clip the background color and transparent borders would look wrong.

This would also block a fix related to how borders display with clipped content that is coming in the later diffs. If we decide to use the border image, then we cannot properly display things like images since they would be on top of this image (otherwise background color shows through).

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D61248625

fbshipit-source-id: ad398bbcfb69edc7d61362920773b51abea81d08
2024-08-30 02:00:19 -07:00
Joe Vilches
2176866eb5 Add children to separate _containerView, if needed (#46189)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46189

A lot of the style decorators we have (filters, box shadows, borders, etc) use a separate sub-CALayer to accomplish what they want. This becomes an issue if we are clipping the content to the bounds and if these decorators extend beyond the bounds of the view as they are typically unaffected by this clipping. The main things here are `box-shadow` and `outline`. However, this implementation will let us fix some issues w.r.t content rendering under borders. See later diffs for that.

To fix this, if needed, we insert a `_containerView` to contain all of our subviews, and actually apply the clipping to. If this exists, our UIView will only have one subview, this one. But it may have multiple sublayers.

NOTE: This diff does not actually redirect the clipping. It just inserts the subview to test if this breaks anything in and of itself.

Changelog: [Internal]

Reviewed By: lenaic

Differential Revision: D61414649

fbshipit-source-id: ddc2bfa47199909274c44da96a16e008290f9d2b
2024-08-30 02:00:19 -07:00
Rubén Norte
d055efd4de Implement optimized event batching on Android (#46270)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46270

Changelog: [internal]

When analyzing traces, I noticed that we were using the choreographer to batch events in the native layer on Android. This approach isn't very efficient for 2 reasons:
1. The choreographer runs in specific intervals and there could be some delay between receiving the events and dispatching them from the choreographer.
2. A slow mount operation in the choreographer after receiving the event would completely block the dispatch for the whole duration of the operation. This could take as long as 100s of ms, so it can be very significant.

This is especially relevant with layout events, which are dispatched using the same mechanism as input events. In this case, there are instances where we delay rendering in JS because we're doing an expensive mount in the UI thread.

It makes sense to batch events in native so we don't do unnecessary work in JS to process them, but there's a better mechanism to do this. Instead of posting a frame callback in the choreographer, we can batch events using a new task in an Android handler running on the UI thread. This would run immediately after the job where the events are dispatched, after all the events are dispatched.

This implements that mechanism behind a feature flag.

Reviewed By: sammy-SC

Differential Revision: D62004018

fbshipit-source-id: d8b78a75cf05d0d8c9dd867a82a776f8d293a683
2024-08-29 20:57:25 -07:00
Rubén Norte
0eec866059 Improve naming of methods in FabricEventDispatcher (#46269)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46269

Changelog: [internal]

I'm planning some changes to this class and it was kinda hard for me to understand what some of these methods were meant to do. Doing a small refactor to rename them with more meaningful names.

Reviewed By: sammy-SC

Differential Revision: D62004020

fbshipit-source-id: 1e28e7e80f12a3a56ff16ace8794887b2f46495c
2024-08-29 20:57:25 -07:00
Rubén Norte
dbe2b38172 Remove unnecessary null check from FabricEventDispatcher (#46268)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46268

Changelog: [internal]

`mReactEventEmitter` is final and initialized with a non-null value in the constructor, so this check is redundant.

Reviewed By: sammy-SC

Differential Revision: D62004021

fbshipit-source-id: bb8719c286cd04005370f2cdef89928c0d01007a
2024-08-29 20:57:25 -07:00
Nick Gerleman
a2d53d5ea0 Support simple opacity in nested text (#46267)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46267

We can propagate opacity, already part of AttributedString, to alpha channel of paint used to draw text and background on canvas.

This does not support propagating to views, and contrary to the iOS example added which originated with legacy arch, does not correctly support nesting opacity. This is a limitation of new arch more generally, where an AttributedString fragment only contains inner-most opacity.

Bg and foreground are drawn separately with alpha as well, instead of rendering overlapping content offscreen to properly apply it (this is an issue on RN Android more generally, and existing color alpha support, but is pretty noticeable here).

This impl targets new arch only.

Changelog:
[Android][Added] - Support simple opacity in nested text

Reviewed By: alanleedev

Differential Revision: D61999163

fbshipit-source-id: adb99834e94e00cb84a98d56f422c15b1bd849db
2024-08-29 20:43:30 -07:00
Jorge Cabiedes Acosta
acbde249b7 Revert D61726506 (#46266)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46266

This diff reverts D61726506
T200279372

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D61986793

fbshipit-source-id: bbf462b79192b67801a6cf56727f8f43ade8fd56
2024-08-29 20:34:19 -07:00
Rubén Norte
4351247654 Lift Web Performance tracks in Perfetto to the top of the custom tracks list (#46263)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46263

Changelog: [internal]

Reviewed By: sammy-SC

Differential Revision: D61980863

fbshipit-source-id: 400a615e32e056f40302ceb0d0d6423198bec52a
2024-08-29 16:16:03 -07:00
Blake Friedman
9f3fe8178f Add missing commander dependency (#46242)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46242

This is transitively included, but should be explicitly included.

Changelog:
[Internal] commander is a dependency when bundling from Xcode

Reviewed By: cipolleschi

Differential Revision: D61916607

fbshipit-source-id: 1466d38d959970e5bd56576f8a7a22697d2eec4e
2024-08-29 16:09:33 -07:00
Rubén Norte
610212d6f4 Fix incorrect timing for events that do not update the UI (#46253)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46253

Changelog: [internal]

This is still internal because this API hasn't been publicly released yet.

## Context

This fixes a problem in our implementation for Event Timing API with paint time reporting (currently gated behind `ReactNativeFeatureFlags::enableReportEventPaintTime`) where events that don't trigger UI changes would wait for the next (unrelated) UI change to finish the event timing information.

## Implementation

We had this issue because we were relying on mount hooks to finish pending events. The problem is that if the event itself didn't cause a commit, the mount hook will not execute immediately, and we'll wait for the mount notification of whatever is the next change (in an arbitrary point in time in the future).

The fix for this has several parts:
1. Modify `RuntimeScheduler` to start tracking which surface IDs are the rendering updates applying to. It makes sense to do this regardless because `RuntimeScheduler` implements the Event Loop, and the Event Loop is aware of "documents" on Web (and the equivalent are surfaces in RN).
2. Create a new hook in `RuntimeScheduler` to report events after the task has finished executing (which is already a step in the Event Loop on Web). This will pass the list of surface IDs with pending changes, so the listener can determine if the events should be finished already or they should wait for mount for those changes.
3. Integrate `EventPerformanceLogger` with `RuntimeScheduler` and add the proper logic to handle this.

Reviewed By: sammy-SC, rshest

Differential Revision: D61939260

fbshipit-source-id: 505bd41db8d3f62e5065424e62f9ed540832eed9
2024-08-29 12:28:15 -07:00
Rubén Norte
c6aa9f4feb Add surfaceId to EventTarget (#46254)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46254

Changelog: [internal]

Right now it's very hard to access the surface ID from the target when dispatching events, and we need that to determine if the event we dispatched produced any updates its surface ID.

This adds surfaceId to EventTarget so we can access it without an unnecessary large amount of indirection in the current code.

This is a dependency for https://github.com/facebook/react-native/pull/46253 / D61939260, split to simplify reviewing.

Reviewed By: sammy-SC, rshest

Differential Revision: D61939910

fbshipit-source-id: 6dd6bc55fc6d4aa6cf8a535080c14a7a5b573b71
2024-08-29 12:28:15 -07:00
Rubén Norte
a0909efbec Move reporting of long tasks to before updating rendering (#46252)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46252

Changelog: [internal]

The long task API should only account for work specifically done by the task. Updating the rendering shouldn't be considered for that, so this moves the determination of long tasks before doing that work.

Reviewed By: sammy-SC, rshest

Differential Revision: D61939261

fbshipit-source-id: 6d2573d561d507dff60b9703e4cc90ce4d131960
2024-08-29 12:28:15 -07:00
Andrew Knapp
8501b6396b Fix GH-41226 by suppressing path adjustment when not actually drawing a border (#46239)
Summary:
When not drawing a border, the mGapBetweenPaths adjustment can create noticable pixelation when drawing curves through a low number of pixels.  This is noticable mostly on buttons and such on low-dpi devices.  This fix only applies the fix if clipping for the border radius is done.

When drawing small radius rounded backgrounds (e.g. to draw a circle or button) we see visible pixelation (see [GH-41226](https://github.com/facebook/react-native/issues/41226)) This is particularly noticable on low DPI devices.

## Changelog:

[ANDROID] [FIXED] - Don't use mGapBetweenPaths if not drawing a border

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

Test Plan:
Built an android app that directly uses CSSBackgroundDrawable to draw a background and verified repro of this issue.
![pre-fix](https://github.com/user-attachments/assets/e56a41b1-60f6-4953-9e91-b95a3380f2d7)
Then modified the code according to this PR and verified that anti-aliasing is appropriately applied
![fix](https://github.com/user-attachments/assets/b6b1aecf-a713-4e0a-9759-82c2dd862991)

Reviewed By: NickGerleman

Differential Revision: D61925281

Pulled By: jorge-cab

fbshipit-source-id: 93014629d031bd0d716cd3bb11e2c294dedad639
2024-08-29 11:21:21 -07:00
Thomas Nardone
48c4380a9b ReactImageView - fix double imageSource check (#46248)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46248

Only null check and grab the url once.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D61934974

fbshipit-source-id: 2214a79b34ecc9182e88551a7b04b58d371e5e7d
2024-08-29 11:12:08 -07:00
Eli White
84ec424e8a Remove superflous {type:string} from CodegenSchema (#46237)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46237

I can't find any uses of this, it's not referenced in any fixtures, and flow and typescript both pass without it.

Changelog: [Internal]

Reviewed By: makovkastar

Differential Revision: D61892355

fbshipit-source-id: 8ebb4da3e104109c740d90c2495dbcc89d3978e5
2024-08-29 10:51:31 -07:00
Eli White
a5363113f1 Fix NativeModuleEnumMembers type (#46222)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46222

This value was typed as always being a string, even though it  was containing both strings and numbers in the fixtures. This was because on this line https://fburl.com/code/9j7gh4av the input type is $FlowFixMe (from the source AST), which wasn't catching that it couldn't flow into just `string`.

Changelog: [Internal]

Reviewed By: makovkastar

Differential Revision: D61830075

fbshipit-source-id: 0d5a0239d7c0209049184ca858a7ceb1ada02f79
2024-08-29 10:51:31 -07:00
Eli White
0b56ccab2a Array's with unparsable element type's are explicitly Any vs missing (#46221)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46221

Previously the schema special cased unparseable elementType with elementType just being undefined. This causes issues for logic that requires recursively matching types. Instead of being implicit, this makes them explicitly an AnyTypeAnnotation

Changelog: [Internal]

Reviewed By: makovkastar

Differential Revision: D61825742

fbshipit-source-id: 47bf70d32d21647896d8f5319087378cc8ac8d4f
2024-08-29 10:51:31 -07:00
Blake Friedman
0f66a696b4 rebuild autolinking cache if empty or invalid (#46241)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46241

Our test for rebuilding the `autolinking.json` file currently rebuilds everytime if the cached json file ISN'T empty.  This means users who have an empty entry get stuck there.

I've also added more validation that the contents of the cached config have at a minimum the `.project.android.packageName` entry in it, otherwise it rebuilds.

Changelog: [Internal]

Closes 46134

Reviewed By: cortinico

Differential Revision: D61911114

fbshipit-source-id: 188c7f975ce05802c8ea06eaa48345c2bc96f2b2
2024-08-29 10:11:09 -07:00
Alan Lee
1333e0ee6a update compileSdk to 35 (#46235)
Summary:
X-link: https://github.com/facebook/yoga/pull/1692

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

Update compileSdk to 35 before adding relating work for Android 15

Changelog:
[Android][Added] - Update compileSdk to 35

Reviewed By: cortinico

Differential Revision: D61874541

fbshipit-source-id: f7c92dc15aa68a53bcd626450c515d2f24e9e40f
2024-08-29 09:17:42 -07:00
Edmond Chui
8b2ccea243 Update debugger-frontend from 7f6cfe3...32358bd (#46256)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46256

Changelog: [Internal] - Update `react-native/debugger-frontend` from 7f6cfe3...32358bd

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](7f6cfe3c84...32358bd289).

Reviewed By: hoxyq

Differential Revision: D61955962

fbshipit-source-id: 4b5d9fb1034b69deeaf386e23a96890d0adea77a
2024-08-29 04:07:11 -07:00
Alan Lee
768415dd62 Refactoring: extract helper functions from StatusBarModule (#46224)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46224

- Extract functions from StatusBarModule so they can be reused
- WindowUtil was created as a container for the extracted Window related helper functions

Changelog: [Internal]

Reviewed By: tdn120

Differential Revision: D61834841

fbshipit-source-id: a40f6b95ab7569bbe7680b5ca314eb0844114d1d
2024-08-29 01:53:56 -07:00
Jorge Cabiedes Acosta
6fa54f9b5d Remove experimental_ prefix from boxShadow and filter (#46245)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46245

As title

Changelog: [General] [Changed] - Add official `boxShadow` and `filter` CSS properties

Reviewed By: cipolleschi

Differential Revision: D61726506

fbshipit-source-id: 8ee7a95d95a66f1f890a5ebb6791da73219b2c52
2024-08-28 23:03:41 -07:00
Alan Lee
9cd6f3ea31 fix prettier error in CI (#46255)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46255

Trying to fix lint error in GH likely happening after this [commit](7bc9244d0c) (D60533197).

used ` yarn run format-check --write` to get changes need to fix the error when running prettier v29

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D61951889

fbshipit-source-id: 891b6b90e854504a35452e546c81bca644661dde
2024-08-28 19:35:46 -07:00
Nishan
20e3f4518f fix: Linear gradient border styles with BackgroundStyleApplicator (#46084)
Summary:
Fix linear gradient borders with BackgroundStyleApplicator.

### After fix
<img width="200" alt="Screenshot 2024-08-18 at 3 44 56 PM" src="https://github.com/user-attachments/assets/79ae7c9c-3b64-43e0-bbbe-ddc930c73648">

## Changelog:

[ANDROID] [FIXED] - Linear gradient border styles

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

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

Test Plan: Test border examples in LinearGradientExample.js

Reviewed By: rshest

Differential Revision: D61798132

Pulled By: NickGerleman

fbshipit-source-id: a8cf1d84166044e09fb573995cac3d3f31c2187b
2024-08-28 17:25:15 -07:00
David Prevost
7bc9244d0c Upgrade pretty-format to v29 (#45732)
Summary:
As described in [this issue](https://github.com/facebook/react-native/issues/45726), we had a problem where, at runtime, version v29 instead of v26 was used, so upgrading it is the fastest fix.

## Changelog:

[GENERAL] [CHANGED] - Upgrade pretty-format to 29.7.0

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

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

Test Plan:
I use console log in the RN tester app
![image](https://github.com/user-attachments/assets/3e3ab0d1-e32b-4b73-8f00-cbd8f040c5aa)

Reviewed By: blakef

Differential Revision: D60533197

Pulled By: tdn120

fbshipit-source-id: b83dbfe463971abbf00cfebdcc9e5dd6975de0d8
2024-08-28 13:12:43 -07:00
Jorge Cabiedes Acosta
8618eecde6 Make Filters implicitly set overflow hidden (#46145)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46145

Filters clip children by default due to using `RenderEffect` we are keeping this behavior but we were clipping to the border box while Web clips to padding box.

To keep the clipping consistent we are enforcing `Overflow.HIDDEN` when a view contains a filter.

Changelog: [Internal]

Reviewed By: joevilches

Differential Revision: D61630698

fbshipit-source-id: dcc3fd680546793096d8996f405724df0a834079
2024-08-28 11:58:42 -07:00
Alex Hunt
3077db32ef Update references to debugger frontend (#46232)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46232

Follows D61711818.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D61852414

fbshipit-source-id: a2d7f135a3ff03751c6d91978bebee007272f306
2024-08-28 03:20:17 -07:00
Alex Hunt
c2d73269b3 Rename Dev Menu debugger item (#46182)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46182

Renames the "Open Debugger" menu item as "Open DevTools".

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D61711818

fbshipit-source-id: 3867582f889c1b8c4242af1b63168c76d58df589
2024-08-28 03:20:17 -07:00
Alex Hunt
94e7a87f23 Remove --experimental-debugger option (#46231)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46231

Removes this option from `npx react-native start`. Flipper will no longer be the default launch flow in 0.76.

The debugger frontend variant remains controlled by `target.reactNative.capabilities?.prefersFuseboxFrontend`. This will always be Fusebox, since D60893243.

Changelog:
[General][Changed] Remove `--experimental-debugger` option from start command

Reviewed By: robhogan

Differential Revision: D61852415

fbshipit-source-id: 3351f0e12c24717916a70dd1ea28f8690bb5509f
2024-08-28 03:20:17 -07:00
Rubén Norte
cf356bd19b Remove legacy integration of createPerformanceLogger with Systrace (#46236)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46236

Changelog: [internal]

Reviewed By: bgirard

Differential Revision: D61885705

fbshipit-source-id: c84889d3b1a2c9544b393a2cbb04ee3b38522993
2024-08-27 19:15:38 -07:00
Rubén Norte
54ce662803 Create feature flag to fix incorrect "MountingCoordinator::hasPendingTransactions" on Android due to push model (#46223)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46223

Changelog: [internal]

This introduces a new feature flag to fix some problems with `IntersectionObserver` on Android.

## Context

Our current implementation works as follows:
1. When observing a new target, we synchronously check if there are pending transactions in the mounting layer for that surface.
    a) If there are, then we don't dispatch an initial notification for the current state of that target and we wait for those transactions to the applied. When they are, mount hooks are executed and the notifications are dispatched.
    b) If there aren't, then we cannot rely on receiving a notification via mount hooks, so we dispatch the notification immediately.

This works well to ensure that when observing a target that was just mounted by React we'll receive a notification with the paint time for that target.

The problem we currently have on Android is that that platform uses a "push" model for the mounting layer, which means we consume transactions immediately after commit. Because of that, when we check whether there are pending transactions, the mounting layer would report "no" but the consumed transactions haven't actually been mounted. In that case, we dispatch the notification immediately.

The result of that behavior is that we don't wait for the transactions that will paint a new target and instead report its intersection immediately, providing incorrect data about when it was first mounted.

## Changes

The way the new feature flag fixes the problem is by adding a new parameter in `MountingCoordinator::pullTransaction` to tell the coordinator that it should continue reporting pending transactions if there were any when that was called. We also add a new method to clear pending transactions when we execute mount hooks for that surface.

Reviewed By: javache

Differential Revision: D61831209

fbshipit-source-id: ed6e5a3d27bd3e802c79a203e920d247b1715c61
2024-08-27 15:23:39 -07:00
Joe Vilches
b01da5e53d Get filter/boxShadow to show up with CoreFeatures::enablePropIteratorSetter (#46234)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46234

We were seeing some cases of these not working and that was because CoreFeatures::enablePropIteratorSetter was set to true and we need to add this line for it to parse with that

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D61861547

fbshipit-source-id: 47356671dc61e99ffa3df9834eb5856f29b07c59
2024-08-27 12:56:13 -07:00
Nick Gerleman
03801f275e Move experimental_boxShadow and experimental_backgroundImage to BaseViewConfig
Summary:
RN Android has historically delegated any responsibilities for background and border rendering to individual view managers.

When we enforced that SVCs didn't allow more properties than native view configs, it meant that unlike for iOS, we needed to structure these SVCs to only apply to single view managers, to avoid warnings.

This creates issues for third-party view managers extending ReactViewGroupManager, which don't seem to get these attributes added to their SVCs under current setup. RNSVG also uses `codegenNativeComponent` on TS `ViewProps`, but for historically reasons around hiding props from the new arch, that does not include these props (and would not have a way to associate with the right process function if it did).

After we clean up an old experiment path (waiting a little bit longer for safety), BaseViewManager on Android will be able to influence rendering, and we can put these in BaseViewManager (see D61658737).

In the meantime, D60575253 allows us to make SVCs a superset of native view config, which means we can declare this for `BaseViewConfig`, before Java view managers catch up, without creating warnings.

Changelog:
[Android][Changed] - Move `experimental_boxShadow` and `experimental_backgroundImage` to BaseViewConfig

Reviewed By: RSNara

Differential Revision: D61744706

fbshipit-source-id: dcf3511ee6f826ef260f557703c182b361b7a2d7
2024-08-27 11:17:30 -07:00
Ruslan Lesiutin
f80e6c12b0 Back out "Introduce NativeDebuggerSessionObserver module" (#46042)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46042

# Changelog: [Internal]

Original commit changeset: dd095954529f

Original Phabricator Diff: D59975264

Reviewed By: robhogan

Differential Revision: D61325016

fbshipit-source-id: 99d98b95dd2133516cba4c8e13f2528bedc04a14
2024-08-27 11:02:15 -07:00
Ruslan Lesiutin
6d524451a6 use DebuggerSessionObserver in LogBox (#46045)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46045

# Changelog: [Internal]

Use newly added global instead of TurboModule

Reviewed By: robhogan

Differential Revision: D61301332

fbshipit-source-id: 4d7299aeb08dcafce2190c35adc56daaa8e29e0e
2024-08-27 11:02:15 -07:00
Ruslan Lesiutin
2e545b10f5 DebuggerSessionObserver: JavaScript API (#46043)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46043

# Changelog: [Internal]

Defined JavaScript interface, which can be used by other modules, such as LogBox, which will be migrated in the next diff

Reviewed By: robhogan

Differential Revision: D61301333

fbshipit-source-id: 63bb8581b893d0fdcb36e1fa16d243f1a5b08ac4
2024-08-27 11:02:15 -07:00
Ruslan Lesiutin
dd26c3c1d4 DebuggerSessionObserver: define global from C++ (#46044)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46044

# Changelog: [Internal]

Migrating from using TurboModule in favour of scheduling JavaScript tasks and using jsi.

See [this doc](https://docs.google.com/document/d/1i8Jp8AGPrqAVqqSVVqHNb5GeM_NMcsbAzzdOfMX_KZY/edit?usp=sharing) and this post(https://fb.workplace.com/groups/615693552291894/permalink/1790063878188183/) for more context.

Reviewed By: robhogan

Differential Revision: D61301334

fbshipit-source-id: 3489026ce7e3d789c552a52be5c8fe3ec82d1438
2024-08-27 11:02:15 -07:00
shubhamguptadream11
6365df54db fix(android): resolve crash by handling colour resource IDs with "android" package name fallback (#46202)
Summary:
Solves this issue: https://github.com/facebook/react-native/issues/29763

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

[ANDROID] [ADDED] - Added a conditional check in the `resolveThemeAttribute` function to reattempt resource resolution with the "android" package name if the resource ID is 0.

**Reason why app is getting crashes?**

The crash was occurring due to an issue with resolving certain color attributes in the Android theme. Specifically, when attempting to resolve attributes like textColorPrimary, the getIdentifier method returned a resource ID of 0, indicating that the resource could not be found. This issue resulted in the resolveThemeAttribute function failing, as it attempted to resolve a non-existent resource ID, which led to a crash.

**Key Points:**

**Problem**: Resource ID returned as 0 for specific attributes like textColorPrimary.
**Cause**: The resource ID of 0 indicates that the attribute was not found in the app's resources.
**Impact**: The resolveThemeAttribute function attempted to resolve an invalid resource ID, leading to crash because of this line: 6cfe51ded0/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/ColorPropConverter.java (L227)

The introduced fix includes a fallback mechanism to attempt resolution with the "android" package name when the initial lookup returns 0. This helps in correctly resolving theme attributes that might be part of the Android system's default resources, thereby preventing the crash.

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

Test Plan: - Tested the app with above colors mentioned. Ensured that app is not getting crashed.

Reviewed By: cipolleschi

Differential Revision: D61847357

Pulled By: cortinico

fbshipit-source-id: 50895a8fd7956e001dbbad9a505ae65151209bd9
2024-08-27 09:35:27 -07:00
Szymon Rybczak
396bdd87d8 fix: ensure --build-output destination exists (#45182)
Summary:
Replicates 48d4c29bba, which landed inside `cli-plugin-metro` inside RNC CLI, but because of migration of code to `community-cli-plugin` it looks like apparently the fix wasn't replicated.

## Changelog:

[GENERAL] [FIXED] - Ensure `--build-output` destination exists

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

Test Plan:
Specify a new directory that doesn't exists inside `--build-output`:

`npx react-native bundle --build-output dist/new-dir/index.bundle`

and this command shouldn't fail.

Reviewed By: christophpurrer

Differential Revision: D61850942

Pulled By: huntie

fbshipit-source-id: 90e57f19c661ace8206162d6fa2e6a27acb31e20
2024-08-27 09:04:14 -07:00
Edmond Chui
3a77e6e275 Update debugger-frontend from c98a122...7f6cfe3 (#46233)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46233

Changelog: [Internal] - Update `react-native/debugger-frontend` from c98a122...7f6cfe3

Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](c98a122180...7f6cfe3c84).

Reviewed By: huntie

Differential Revision: D61851264

fbshipit-source-id: bcb29b5e44e273862a318f281c1dfa05f86642a4
2024-08-27 08:29:36 -07:00
Oskar Kwaśniewski
0cb97f0261 feat: build codegen on postinstall (#46227)
Summary:
This PR solves a small issue I've encountered when working with the repo.

When changing branches we often run `yarn` to reinstall dependencies (let's say we change from 0.74-stable to main).

There are lots of changes between those two versions in the `react-native-codegen` package. This causes an issue when we install pods in `packages/rn-tester` the old version of codegen is used (the one cached from 0.74-stable) leading to a big error that's hard to solve at first.

This PR solves this by building codegen on `postinstall`. I've seen many newcomers blocked by this issue (and rerunning `yarn` is the natural thing to do in this situation)

## Changelog:

[INTERNAL] [ADDED] - Build codegen on postinstall when working with the monorepo

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

Test Plan: Run `yarn`

Reviewed By: cipolleschi

Differential Revision: D61849150

Pulled By: huntie

fbshipit-source-id: 24fc5cf9b6a2510298f7bcdce59043e5dcfbfdd4
2024-08-27 08:28:35 -07:00
Dmitry Rykun
46d17efa62 Start looking for codegen-enabled dependencies from the project root (#46229)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46229

When running codegen from `pod install`, something affects `require.resolve`, and it starts looking for codegen-enabled dependencies from the workspace root, not the current RN project root.
This is bad if we have different versions of same dependency across multiple workspaces. One of them will be hoisted to the workspace root, and will be used for all the workspaces.

This issue is described in details here https://github.com/facebook/react-native/issues/46196

This diff is supposed to fix this by adding the project root path to the `require.resolve` call.

Changelog: [iOS][Fixed] - Codegen will start looking for codegen-enabled dependencies from the project root.

Reviewed By: cipolleschi

Differential Revision: D61850219

fbshipit-source-id: d60a0e72e9c60e862c0d64e227ea3652d1be5a90
2024-08-27 07:58:39 -07:00
Alex Hunt
773fc8d0f1 Remove useFuseboxInternalBranding experiment (#46230)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46230

Follows https://github.com/facebookexperimental/rn-chrome-devtools-frontend/pull/101.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D61850578

fbshipit-source-id: 9283e74dd5fddac001f9748115dc8e85b8d0d491
2024-08-27 07:10:02 -07:00
Dawid
3596019489 Fix handling 'auto' checks in absolute layout (#46216)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46216

Regarding [issue](https://github.com/facebook/react-native/issues/45817) with incorrect layout when `left` is set to `auto`. This PR introduces handling `auto` whenever inline or flex position is checked to be defined and it fixes above issue.

Changelog:
[General][Fixed] - Fix handling 'auto' checks in absolute layout

## Tests:
 I have run the provided unit tests and everything passes.

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

Reviewed By: cipolleschi

Differential Revision: D61737876

Pulled By: NickGerleman

fbshipit-source-id: 531199a91c5e122b930b49725ea567cbb1d592ce
2024-08-27 06:00:34 -07:00
Nick Gerleman
b96238db11 Remove FakeYogaNode and FakeYogaConfig (#46215)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46215

These cause a build error in RN and need to be updated any time a thick Yoga API changes. This change replaces them with mocking the factories with Mockito instead.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D61804855

fbshipit-source-id: 24fbf10a12102de2975ba3aee45efe7350e294ec
2024-08-27 06:00:34 -07:00
shubhamguptadream11
8c81ffa60a fix(android): make getUri and isResource available for override (#46152)
Summary:
Fixes following issues:
- https://github.com/facebook/react-native/issues/46150
- https://github.com/facebook/react-native/issues/46155

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

[ANDROID] [FIXED] - Make getUri and isResource open

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

Reviewed By: NickGerleman, rshest, blakef

Differential Revision: D61845164

Pulled By: cortinico

fbshipit-source-id: 88ccdad92423b5add9b2fad4c98f296b6cbfb27d
2024-08-27 05:00:36 -07:00