Граф коммитов

34948 Коммитов

Автор SHA1 Сообщение Дата
React-Native Bot 09cf897e0a applying package updates ***NO_CI*** 2024-10-15 20:02:43 +00:00
Saad Najmi 2f944ebd86
fix(CI): Fix `verify react-native-macos-init` job (#2199)
* fix: Sync `react-native-macos-init` version with NPM registry

* build react-native-macos-init first

* fixes
2024-10-15 19:56:55 +00:00
Saad Najmi db89ff48df
cherrypick: Bring changes to improve our RCTUIGraphicsImageRenderer shim (#2219)
* Rename `RCTUIGraphicsImageRenderer` to `RCTMakeUIGraphicsImageRenderer` (#46772)

Summary:
Because `UIGraphicsImageRenderer` doesn't exist on macOS, I need to shim it for React Native macOS (See https://github.com/microsoft/react-native-macos/pull/2209). I planned to use the name `RCTUIGraphicsImageRenderer`. However.. it seems that is used by a static helper function in `RCTBorderDrawing.m`. So.. let's rename it? The function is just a helper method to make an instance of the class, so I think the name `RCTMakeUIGraphicsImageRenderer` is slightly more idiomatic anyway.

This method is not public, so it should not break the public API of React Native.

[IOS] [CHANGED] - Rename `RCTUIGraphicsImageRenderer` to `RCTMakeUIGraphicsImageRenderer`

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

Test Plan: CI should pass

Reviewed By: joevilches

Differential Revision: D63765490

Pulled By: cipolleschi

fbshipit-source-id: de68dce0f92ec249ea8586dbf7b9ba34a8476074

* fix(iOS): Replace uses of `CGColorRef` with UIColor to avoid manual memory management (#46847)

Summary:
Update React Native on iOS to do less manual memory management, by replacing uses of `CGColorRef` with `UIColor`, and only calling `UIColor.CGColor` when needed. This results in much less manual memory management, which is probably a good thing in 2024 :D. The downside is there is a breaking change: the signature of a method in `RCTBorderDrawing` changes.

This is a followup to https://github.com/facebook/react-native/issues/46797 . After that PR merged and I tested merging React Native macOS to the `0.76-stable` branch cut commit again, I saw even more places I needed to manually call `CGColorRetain` / `CGColorRelease`. The reason is due to React Native macOS specifics (explained below) and I could update React Native macOS to not need these changes, but I thought I would at least throw up a PR to propose the changes, as it may be good to move away from using Core Graphics' C base API as much as possible.

With https://github.com/microsoft/react-native-macos/pull/2209 , I wrote a shim of [UIGraphicsImageRenderer](https://developer.apple.com/documentation/uikit/uigraphicsimagerenderer) for macOS. The main difference is my shim calls the NSImage API [imageWithSize:flipped:drawingHandler:](https://developer.apple.com/documentation/appkit/nsimage/1519860-imagewithsize?language=objc) to shim the UIGraphicsImageRenderer API [imageWithData:](https://developer.apple.com/documentation/uikit/uiimage/1624137-imagewithdata). The difference between the two is that the macOS API copies the block, and executes it when Appkit is about to draw the image, while the iOS API executes the block right away. Because of this, I think I am hitting way more places where `CGColorRef` variables needed to be retained / released. Additionally, I hit more of them when I merge to the 0.76 branch cut commit (this is why I didn't catch it with https://github.com/facebook/react-native/issues/46797).

Given this constraint, I have a couple of options:
1. Refactor my macOS shim to use the deprecated API [[NSImage lockFocus]](https://developer.apple.com/documentation/appkit/nsimage/1519891-lockfocus)
    - I am not a fan of this because `lockFocus` was deprecated for `imageWithSize:flipped:drawingHandler:`
2. Refactor my macOS shim to do what we used to do: Create a CGContext manually and write it to an image
    - This is probably OK. Relies on less Appkit specifics, and potentially gives more control to RN on the rendering layer, which I recall lenaic told me is better for Fabric)
3. Refactor React Native to avoid CGColorRef altogether, and use `UIColor` (which ARC will memory manage for us) as much as possible.
    - This is the approach of this PR and my preferred approach. The downside is this changes the signature of some of the methods in `RCTBorderDrawing` which is a breaking change. I've seen other PRs do this, so maybe its OK?

[IOS] [BREAKING] -  Replace uses of `CGColorRef` with UIColor to avoid manual memory management

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

Test Plan: Launching RNTester's View example (which tests a lot of the border / outline / shadow rendering) does not crash for me on both iOS and macOS.

Reviewed By: NickGerleman

Differential Revision: D63989547

Pulled By: joevilches

fbshipit-source-id: 5e85e17567e3dd8b4b0388452398954ad2e02464

* Followup fixes

* Remove extra scaleFactor argument that is now unused

* Further reduce diffs related to scaleFactor

* fix typos and dead code
2024-10-13 14:15:55 -05:00
Navneet Kambo 8cd5b677f0
Multi line text view key handling: add check for first responder (#2215) 2024-10-08 22:23:54 -05:00
Saad Najmi 2d866c826b
feat(RCTUIKit): Shim RCTUIGraphicsImageRenderer (#2209)
* feat(RCTUIKit): Shim RCTUIGraphicsImageRenderer

* Update RCTBorderDrawing.m

* `[RCTUIGraphicsImageRendererFormat defaultFormat]` doesn't return a singleton

* `[NSImage lockFocus]` is deprecated. Use a newer API.

* fix typo

* Implement `format.opaque`
2024-10-03 18:56:07 -05:00
Saad Najmi 3ebf897664
fix: Properly dismiss RCTDevLoadingView (#2211) 2024-10-03 18:55:20 -05:00
dependabot[bot] bb565371e7
Bump rexml from 3.2.6 to 3.3.6 in /packages/helloworld (#2175)
Bumps [rexml](https://github.com/ruby/rexml) from 3.2.6 to 3.3.6.
- [Release notes](https://github.com/ruby/rexml/releases)
- [Changelog](https://github.com/ruby/rexml/blob/master/NEWS.md)
- [Commits](https://github.com/ruby/rexml/compare/v3.2.6...v3.3.6)

---
updated-dependencies:
- dependency-name: rexml
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Saad Najmi <sanajmi@microsoft.com>
2024-09-30 16:27:45 -07:00
Saad Najmi c361308b2f
fix(CI): Download visionOS if necessary (#2204) 2024-09-28 06:45:05 -07:00
Saad Najmi 704b60c62d
fix: Properly clean up RCTDevLoadingView on hide (#2201) 2024-09-26 06:20:06 -07:00
Saad Najmi a87ddb5953
fix: Allow viewRegistry to accept subclasses of NSView (#2196) 2024-09-20 08:21:31 -07:00
Nahuel Veron b0111c0d3c
fix: Remove flipper config from the Podfile template (#2195) 2024-09-20 08:20:27 -07:00
Saad Najmi db3f8e7f87
Sync `react-native-macos-init` vesrion with NPM registry using beachball (#2187) 2024-08-30 17:02:16 -07:00
Saad Najmi b86ac52398
fix: Properly import `npm-registry-fetch` in `react-native-macos-init` (#2186)
* fix: Properly import `npm-registry-fetch` in `react-native-macos-init`

* Change files
2024-08-30 16:46:24 -07:00
Saad Najmi b732623bb5
[react-native-macos-init] Push change files for a new version #2177 2024-08-30 14:38:17 -07:00
Tommy Nguyen 6d757396cf
fix: `local-cli` is missing from published package (#2182) 2024-08-30 12:21:46 -07:00
Saad Najmi aa9817a205
fix: Port publish pipeline changes from 0.74 and 0.75 stable branches (#2180) 2024-08-29 23:50:25 -07:00
Saad Najmi 3d5ba58667
Merge up to 0.75 branch cut (#2157)
Merge up to
6f7eae5c58
, the commit for the `0.75-stable` branch cut.

## Summary:

### Interesting upstream changes:

- Some commit removed `packages/react-native/local-cli`, as React Native
is reducing its dependency on `@react-native-community/cli`.
- We will keep this directory around so we can continue shipping our
`run-macos` command.
-
775713cef7
Upstream commit that replicates a diff we’ve had in RNM for a while to
have `focusable` consistent with `disabled`. I also modified our macOS
prop `acceptsFirstMouse` to match.
-
a1b318c18b
`TouchableWithoutFeedback` was rewritten as a Function component using
Pressability. We needed to update our implementation to match.
-
a40bd8e34a
Adds DisplayP3 Colorspace support. This mostly worked with NSColor,
minus a one line diff in `HostPlatformColor.mm` where we have to handle
an assert.
- I also opened https://github.com/facebook/react-native/pull/46071/ to
fix a nit on the implementation.
-
a977b2e69b
Ported DevSettingsModule.java to Kotlin, we needadd back our one method
`setIsSecondaryClickToShowDevMenuEnabled`
-
252ef19c8d
encouraged me to update some uses of `RCTUIView` to `RCTPlatformView`
inside RCTScrollView.
-
eadcebbb3e
Adds support for Text highlighting in Fabric
-
95a8c99f3f
encouraged me to undo a couple of ifdefs:
- `RCTSendScrollEventForNativeAnimations_DEPRECATED` is now implemented
for macOS
- We had a couple of ifdefs in RCTScrollView to use `self.contentView`
instead of `_contentView`. I undid these. We should make sure these are
proper, and if so, upstream the change.
-
8597727c28
Needed some diffs that need an `@availability` check for macOS 11…
-
f6badca2f9
was kept in for macOS as well.
- RCTSegmentedControl was removed from React Native Core.
    - Followup: Upstream our macOS implementation.


### Other interesting changes:

- Disabled the RNTester Integration test WebsocketTest for macOS. This
passed locally for me, so I’m not sure why it’s failing in CI.
    - Followup: Add a task to re-enable this test. 
- Ifdeffed out most references of `InputAccessoryView` to only iOS. This
isn’t relevant for macOS or visionOS.
- Removed diffs in `RCTImageLoader` introduced way back with
4b19d14eba
. They don’t seem to be necessary anymore
- We ifdefed out the implementation for
`RCTPausedInDebuggerOverlayController`. This is used by the experimental
new debugger with Hermes.
- Followup: Implement this for macOS at a future time. For bonus points,
rewrite it in SwiftUI.

### Other notes

There’s an increasing amount of places where upstream
code calls `UIView.backgroundColor = <>`. This is one of those things
that doesn’t entirely work properly without `RCTUIView`, but in most
places, I use `RCTPlatformView` (aka `NSView`) and shim it as
follows:
```
#if !TARGET_OS_OSX // [macOS]
  view.backgroundColor = [UIColor systemBackgroundColor];
#else // [macOS
  view.wantsLayer = true;
view.layer.backgroundColor = [[NSColor windowBackgroundColor] CGColor];
#endif // macOS]
```
This mostly works.. except for Light/Dark mode, because the background color won’t update. To properly implement `backgroundColor`, we need to override `displayLayer`. `RCTUIView` already does this, so perhaps the followup is to update most uses to use RCTUIView. Also, maybe `RCTUIKit` should be a separate pod altogether?

## Test Plan:

Ci should pass.

## List of merge conflicts
```
Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)
        both modified:   jest.config.js
        both modified:   package.json
        added by us:     packages/helloworld/generate-macos.js
        added by us:     packages/helloworld/generator-common/index.js
        added by us:     packages/helloworld/generator-macos/index.js
added by us:
packages/helloworld/generator-macos/templates/macos/HelloWorld-macOS/AppDelegate.h
added by us:
packages/helloworld/generator-macos/templates/macos/HelloWorld-macOS/AppDelegate.mm
added by us:
packages/helloworld/generator-macos/templates/macos/HelloWorld-macOS/Assets.xcassets/AppIcon.appiconset/Contents.json
added by us:
packages/helloworld/generator-macos/templates/macos/HelloWorld-macOS/Assets.xcassets/Contents.json
added by us:
packages/helloworld/generator-macos/templates/macos/HelloWorld-macOS/Base.lproj/Main.storyboard
added by us:
packages/helloworld/generator-macos/templates/macos/HelloWorld-macOS/HelloWorld.entitlements
added by us:
packages/helloworld/generator-macos/templates/macos/HelloWorld-macOS/Info.plist
added by us:
packages/helloworld/generator-macos/templates/macos/HelloWorld-macOS/main.m
added by us:
packages/helloworld/generator-macos/templates/macos/HelloWorld.xcodeproj/project.pbxproj
added by us:
packages/helloworld/generator-macos/templates/macos/HelloWorld.xcodeproj/xcshareddata/xcschemes/HelloWorld-iOS.xcscheme
added by us:
packages/helloworld/generator-macos/templates/macos/HelloWorld.xcodeproj/xcshareddata/xcschemes/HelloWorld-macOS.xcscheme
added by us: packages/helloworld/generator-macos/templates/macos/Podfile
added by us:
packages/helloworld/generator-macos/templates/macos/_gitignore
added by us: packages/helloworld/runMacOS/findXcodeProject.js
        added by us:     packages/helloworld/runMacOS/runMacOS.js
both modified: packages/react-native-test-renderer/package.json
both modified:
packages/react-native/Libraries/AppDelegate/RCTAppDelegate.h
both modified:
packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm
both modified: packages/react-native/Libraries/Components/Button.js
both modified:
packages/react-native/Libraries/Components/ScrollView/ScrollView.js
both modified:
packages/react-native/Libraries/Components/TextInput/RCTTextInputViewConfig.js
both modified:
packages/react-native/Libraries/Components/TextInput/TextInput.js
both modified:
packages/react-native/Libraries/Components/Touchable/TouchableHighlight.js
both modified:
packages/react-native/Libraries/Components/Touchable/TouchableOpacity.js
both modified:
packages/react-native/Libraries/Components/Touchable/TouchableWithoutFeedback.js
both modified:
packages/react-native/Libraries/Components/View/ReactNativeStyleAttributes.js
both modified:
packages/react-native/Libraries/Image/RCTUIImageViewAnimated.mm
both modified:
packages/react-native/Libraries/PushNotificationIOS/RCTPushNotificationManager.h
both modified:
packages/react-native/Libraries/PushNotificationIOS/RCTPushNotificationManager.mm
both modified:
packages/react-native/Libraries/StyleSheet/StyleSheetTypes.d.ts
both modified:
packages/react-native/Libraries/StyleSheet/StyleSheetTypes.js
both modified:
packages/react-native/Libraries/Text/TextInput/Multiline/RCTUITextView.mm
both modified:
packages/react-native/Libraries/Text/TextInput/RCTBackedTextInputViewProtocol.h
both modified:
packages/react-native/Libraries/Text/TextInput/RCTBaseTextInputView.mm
both modified:
packages/react-native/Libraries/Text/TextInput/RCTBaseTextInputViewManager.mm
both modified:
packages/react-native/Libraries/Text/TextInput/RCTInputAccessoryViewContent.mm
both modified: packages/react-native/Libraries/Text/TextProps.js
both modified:
packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap
        both modified:   packages/react-native/React/Base/RCTConvert.h
        both modified:   packages/react-native/React/Base/RCTConvert.mm
both modified:
packages/react-native/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm
both modified: packages/react-native/React/CoreModules/RCTDevSettings.mm
both modified: packages/react-native/React/CoreModules/RCTDeviceInfo.mm
both modified: packages/react-native/React/CoreModules/RCTRedBox.mm
both modified:
packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm
both modified:
packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm
both modified:
packages/react-native/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm
both modified:
packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm
both modified: packages/react-native/React/Modules/RCTUIManager.m
        both added:      packages/react-native/React/Views/RCTCursor.h
both modified:
packages/react-native/React/Views/RCTModalHostViewManager.h
deleted by them: packages/react-native/React/Views/RCTSegmentedControl.h
deleted by them: packages/react-native/React/Views/RCTSegmentedControl.m
deleted by them:
packages/react-native/React/Views/RCTSegmentedControlManager.m
        both modified:   packages/react-native/React/Views/RCTView.h
        both modified:   packages/react-native/React/Views/RCTView.m
both modified: packages/react-native/React/Views/RCTViewManager.m
both modified:
packages/react-native/React/Views/ScrollView/RCTScrollView.m
deleted by them:
packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/debug/DevSettingsModule.java
both modified:
packages/react-native/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleTurboModule.mm
both modified:
packages/react-native/ReactCommon/react/renderer/components/view/BaseViewProps.cpp
both modified:
packages/react-native/ReactCommon/react/renderer/components/view/ViewShadowNode.cpp
both modified:
packages/react-native/ReactCommon/react/renderer/components/view/primitives.h
both modified:
packages/react-native/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/HostPlatformColor.mm
        both modified:   packages/react-native/package.json
        both modified:   packages/react-native/react-native.config.js
        both modified:   packages/react-native/template/package.json
        both modified:   packages/rn-tester/Podfile.lock
both modified: packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj
both modified:
packages/rn-tester/js/examples/Accessibility/AccessibilityExample.js
both added: packages/rn-tester/js/examples/Cursor/CursorExample.js
both modified:
packages/rn-tester/js/examples/PlatformColor/PlatformColorExample.js
both modified: packages/rn-tester/js/examples/Text/TextExample.ios.js
both modified:
packages/rn-tester/js/examples/TextInput/TextInputExample.ios.js
        both modified:   packages/rn-tester/package.json
        both modified:   packages/virtualized-lists/package.json
deleted by them: scripts/releases-ci/prepare-package-for-release.js
        both modified:   scripts/releases-ci/publish-npm.js
        both modified:   yarn.lock
```
2024-08-22 23:35:02 -07:00
Saad Najmi 4c16290ed8 Merge commit '6f7eae5c583090bd62ca60a4c3170445e5a0a751' into main 2024-08-22 23:08:52 -07:00
Saad Najmi 7361b165ef
Bump minimum macOS requirement to 11.0 (#2170)
* Bump macOS minimum OS requirement to 11.0

* Update README.md

Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com>

* Update RCTUIKit.m

---------

Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com>
2024-08-23 01:33:59 +00:00
dependabot[bot] 6d4a0b1459
Bump ws from 6.2.2 to 6.2.3 (#2139)
Bumps [ws](https://github.com/websockets/ws) from 6.2.2 to 6.2.3.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/6.2.2...6.2.3)

---
updated-dependencies:
- dependency-name: ws
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-23 00:30:22 +00:00
Saad Najmi 60614dc41f
Introduce props `keyDownEvents` and `keyUpEvents` (#2171) 2024-08-22 17:23:59 -07:00
dependabot[bot] b3a63de1bd
Bump rexml from 3.2.9 to 3.3.6 (#2173)
Bumps [rexml](https://github.com/ruby/rexml) from 3.2.9 to 3.3.6.
- [Release notes](https://github.com/ruby/rexml/releases)
- [Changelog](https://github.com/ruby/rexml/blob/master/NEWS.md)
- [Commits](https://github.com/ruby/rexml/compare/v3.2.9...v3.3.6)

---
updated-dependencies:
- dependency-name: rexml
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-22 17:13:22 -07:00
Saad Najmi 1164bc9ede
Align cursor implementation to W3C cursors (#2162)
* Cherry-pick d3e3e2a870

* Port the rest of code

* Support most cursors on paper

* remove unnecessary style

* Support Fabric as well

* Share Paper and Fabric implementation

* fix typos

* Remove SF Symbol cursors

* update snapshots

* lint --fix

* Add vertical text

* undo space

* update snapshot

* fixes

* Update macros

* Implement RCTCursorNone

* Mark vertical-text as a macOS diff
2024-08-20 13:20:40 -07:00
Adam Gleitman a44c574126
Prevent spurious onBlur/onEndEditing events in `<TextInput>` elements with placeholder text (#2160)
* Add _isUpdatingPlaceholderText to prevent spurious "did end editing" notifications

* Organize macOS tags and ifdef blocks

---------

Co-authored-by: Adam Gleitman <adgleitm@microsoft.com>
2024-08-19 12:46:23 -07:00
Adam Gleitman 6785f6dba1
Deduplicate `textInputDid(Begin|End)Editing` calls for multiline `<TextInput>` elements (#2159)
* Add _isCurrentlyEditing to RCTBaseTextInputView

* Move _isCurrentlyEditing check earlier in textInputDidBeginEditing

* Adjust comment

* nit: remove extra newline

* Limit changes to macOS

---------

Co-authored-by: Adam Gleitman <adgleitm@microsoft.com>
2024-08-19 12:46:09 -07:00
Saad Najmi 23a33f2eff
Merge up to 0.74 branch cut commit (#2153)
Picking up from
https://github.com/microsoft/react-native-macos/pull/2145, many thanks
to @falselobster for the bulk of the work :)

Merge up to 0.74 branch cut
(c99d96b7a1)

This PR combines most of the work into the single large merge commit for
a couple of reasons:
1. To preserve git history with upstream React Native, we cannot "squash
or rebase the commits. Therefore, we must do a merge commit.
2. I am personally not a fan of committing git merge markers and
resolving them in followup commits.

I did have a couple of extra commits after the merge commit for work
that I feel could be separated out. I will do my best to list
interesting changes in this merge, and what files to look at + what
changes I made in those files. For a more "exhaustive" list, I also
listed all files that had merge conflicts below. This isn't 100% of the
changes (I touched some extra files for some lint fixes / shimming of
`UIView` -> `RCTPlatformView` / `RCTUIView`) but it will get you a good
80-90%.

## Summary:

### Interesting upstream changes:

Each of these changes resulted in extra work to support macOS. See the
original commit, which files were touched, and then how those files are
diffed in this change.

-
1b85ed94a1
Moved RCTPushNotificationManager to use UNNotification APIs
-
3f621df189
RCTActionSheetManager was reworked for synchronous calls
-
e2eb26c951
RCTRedBox was reworked for iPad and orientation changes, the
functionality of RCTRedBoxWindow was reworked into the new
ViewController introduced upstream, RCTRedBoxController
-
0806ad7854
Introduced a new stable id for the inspector dev server based on UUID
which required a custom macOS implementation
-
4c108aaae4
Added support to dynamic colors in Fabric

### Other interesting changes:
- Removed a lot of diffs around adding a `scaleFactor` to places where
we manually calculate frames / sizes. With React Native 0.74, [Yoga 3.0
introduces Per-Node
`PointScaleFactor`](https://github.com/microsoft/react-native-macos/pull/356),
which is probably more accurate than the `scale` prop we added to
RCTShadowView that keys off the main screen.
- Reverted https://github.com/microsoft/react-native-macos/pull/356.
This change added an integratiion test, and introduced a bunch of JS
diffs. The test itself has since been disabled, many of the JS diffs
were actually redundant (applying background colors in macOS only diffs
that got overwritten by new styling that upstream changes added, etc),
the test was not ported to new platforms (visionOS), and Integration
tests in general are heading a different direction (Appium +
WebdriverIO). I figured let's revert this and the diffs it introduced
rather than fix the integration test
- I had to manually ifdef out the dev menu `PerfMonitor` option as we
haven't ported that to macOS yet. This presumably now because a problem
as recent changes to bridgeless + removing diffs has changed which
modules are loaded when. In this case, I think the PerfMonitor module is
lazy loaded when you create the dev menu. Without the ifdef, we would
Redbox every time we open the dev menu.
- New lint rules did re-order a lot of imports in macOS specific
packages like our local-cli. I also did my best to move macOS specific
imports in JS files to a new line to make the diffs a little cleaner.
- I had to implement `RCTUITextView.selectedTextRange` on macOS, as that
started erroring in RNTester.

Todo:
- [ ] Publish new version of virtualized-list package

## Test Plan:

CI should pass. I encourage reviewers to check out and build RNTester as
well.

## List of merge conflicts.

```
Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)
	both modified:   Gemfile.lock
	both modified:   packages/community-cli-plugin/package.json
	both modified:   packages/metro-config/package.json
	both modified:   packages/normalize-color/package.json
	both modified:   packages/react-native/Libraries/Alert/NativeAlertManager.js
	both modified:   packages/react-native/Libraries/AppDelegate/RCTAppDelegate.h
	both modified:   packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm
	both modified:   packages/react-native/Libraries/Components/AccessibilityInfo/NativeAccessibilityManager.js
	deleted by them: packages/react-native/Libraries/Components/Button.flow.js
	both modified:   packages/react-native/Libraries/Components/Button.js
	both modified:   packages/react-native/Libraries/Components/ScrollView/ScrollView.js
	both modified:   packages/react-native/Libraries/Core/NativeExceptionsManager.js
	both modified:   packages/react-native/Libraries/Image/Image.ios.js
	both modified:   packages/react-native/Libraries/Image/RCTImageLoader.mm
	both modified:   packages/react-native/Libraries/NativeModules/specs/NativeDevSettings.js
	both modified:   packages/react-native/Libraries/PushNotificationIOS/NativePushNotificationManagerIOS.js
	both modified:   packages/react-native/Libraries/PushNotificationIOS/RCTPushNotificationManager.h
	both modified:   packages/react-native/Libraries/PushNotificationIOS/RCTPushNotificationManager.mm
	both modified:   packages/react-native/Libraries/Text/Text/RCTTextView.mm
	both modified:   packages/react-native/Libraries/Text/TextInput/RCTInputAccessoryViewManager.mm
	both modified:   packages/react-native/React-Core.podspec
	both modified:   packages/react-native/React/Base/RCTUtils.m
	both modified:   packages/react-native/React/CoreModules/RCTActionSheetManager.mm
	both modified:   packages/react-native/React/CoreModules/RCTAlertController.mm
	both modified:   packages/react-native/React/CoreModules/RCTAlertManager.mm
	both modified:   packages/react-native/React/CoreModules/RCTAppearance.mm
	both modified:   packages/react-native/React/CoreModules/RCTDevLoadingView.mm
	both modified:   packages/react-native/React/CoreModules/RCTDeviceInfo.mm
	both modified:   packages/react-native/React/CoreModules/RCTRedBox.mm
	both modified:   packages/react-native/React/CoreModules/RCTStatusBarManager.mm
	both modified:   packages/react-native/React/CoreModules/RCTTiming.mm
	both modified:   packages/react-native/React/CoreModules/React-CoreModules.podspec
	both modified:   packages/react-native/React/DevSupport/RCTInspectorDevServerHelper.mm
	both modified:   packages/react-native/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.mm
	both modified:   packages/react-native/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.mm
	both modified:   packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm
	both modified:   packages/react-native/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm
	both modified:   packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm
	both modified:   packages/react-native/React/Fabric/RCTConversions.h
	both modified:   packages/react-native/React/Fabric/RCTSurfacePointerHandler.mm
	both modified:   packages/react-native/React/Fabric/RCTSurfacePresenter.mm
	both modified:   packages/react-native/React/Modules/RCTUIManager.m
	both modified:   packages/react-native/React/React-RCTFabric.podspec
	both modified:   packages/react-native/React/UIUtils/RCTUIUtils.m
	both modified:   packages/react-native/React/Views/RCTDebuggingOverlayManager.h
	both modified:   packages/react-native/React/Views/RCTModalHostViewController.m
	both modified:   packages/react-native/React/Views/RCTShadowView.m
	both modified:   packages/react-native/React/Views/ScrollView/RCTScrollViewManager.m
	both modified:   packages/react-native/ReactCommon/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.h
	both modified:   packages/react-native/ReactCommon/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.mm
	both modified:   packages/react-native/ReactCommon/react/renderer/core/ConcreteComponentDescriptor.h
	both modified:   packages/react-native/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/RCTPlatformColorUtils.mm
	deleted by them: packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/NSTextStorage+FontScaling.h
	both modified:   packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextPrimitivesConversions.h
	both modified:   packages/react-native/ReactCommon/react/renderer/uimanager/UIManager.cpp
	both modified:   packages/react-native/index.js
	both modified:   packages/react-native/package.json
	both modified:   packages/react-native/react-native.config.js
	both modified:   packages/react-native/scripts/cocoapods/helpers.rb
	both modified:   packages/react-native/scripts/cocoapods/jsengine.rb
	both modified:   packages/react-native/scripts/cocoapods/utils.rb
	both modified:   packages/react-native/third-party-podspecs/boost.podspec
	both modified:   packages/rn-tester/IntegrationTests/LayoutEventsTest.js
	both modified:   packages/rn-tester/NativeComponentExample/ios/RNTMyLegacyNativeViewManager.mm
	both modified:   packages/rn-tester/NativeComponentExample/ios/RNTMyNativeViewComponentView.h
	both modified:   packages/rn-tester/NativeComponentExample/ios/RNTMyNativeViewComponentView.mm
	both modified:   packages/rn-tester/NativeComponentExample/ios/RNTMyNativeViewManager.mm
	both modified:   packages/rn-tester/Podfile
	both modified:   packages/rn-tester/Podfile.lock
	both modified:   packages/rn-tester/RCTTest/FBSnapshotTestCase/FBSnapshotTestController.m
	both modified:   packages/rn-tester/RCTTest/FBSnapshotTestCase/UIImage+Compare.m
	both modified:   packages/rn-tester/RNTester/AppDelegate.mm
	deleted by them: packages/rn-tester/RNTester/RNTester.entitlements
	both modified:   packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj
	both modified:   packages/rn-tester/js/RNTesterApp.ios.js
	both modified:   packages/rn-tester/js/components/RNTesterBlock.js
	both modified:   packages/rn-tester/js/components/RNTesterModuleList.js
	both modified:   packages/rn-tester/js/examples/Accessibility/AccessibilityExample.js
	both modified:   packages/rn-tester/js/examples/Image/ImageExample.js
	both modified:   packages/rn-tester/js/examples/PlatformColor/PlatformColorExample.js
	both modified:   packages/rn-tester/js/examples/TextInput/TextInputExample.ios.js
	both modified:   packages/rn-tester/js/examples/TextInput/TextInputSharedExamples.js
	both modified:   packages/virtualized-lists/Lists/VirtualizedList.js
	both modified:   packages/virtualized-lists/Lists/VirtualizedListCellRenderer.js
	both modified:   packages/virtualized-lists/package.json
	deleted by them: scripts/__tests__/publish-npm-test.js
	deleted by them: scripts/monorepo/get-and-update-nightlies.js
	deleted by them: scripts/prepare-package-for-release.js
	deleted by them: scripts/publish-npm.js
	both modified:   scripts/releases/utils/release-utils.js
	both modified:   yarn.lock
```
2024-08-09 14:28:25 -07:00
Saad Najmi 7ed80be125 Remove macOS only uses of scale factor 2024-08-06 17:17:13 -07:00
Saad Najmi 0c67608bb7 Merge commit 'c99d96b7a1a4dc905ce642966633b4d3c78bd3c9' into main
Co-authored-by: Alicia Drummond <7664112+FalseLobster@users.noreply.github.com>
2024-08-06 17:17:13 -07:00
Saad Najmi 67a4a0f83e
Refactor Redbox, Logbox, and DevLoadingView as Sheets (#2151)
* fix(iOS): adjust RCTRedBox to work for iPad and support orientation changes (#41217)

Summary:
When opening `RCTRedBox` on an iPad (and also visionOS) there was an issue with buttons width going out of screen. When changing screen orientation, RedBox wasn't recalculating view positions.

**Root cause**: Getting frame of root view to display this modal and basing all calculations on it.

**Solution**: Use Auto Layout to build UI that responds to orientation changes and device specific modal presentation.

I've also tested it with adding custom buttons to RedBox and it works properly.

[IOS] [FIXED] - adjust RCTRedBox to work for iPad and support orientation changes

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

Test Plan:
Launch the app without metro running and check out RedBox that's shown there. Also change screen orientation to see proper recalculation of view positions.

https://github.com/facebook/react-native/assets/52801365/892dcfe7-246f-4f36-be37-12c139c207ac

https://github.com/facebook/react-native/assets/52801365/dfd0c3d8-5997-462d-97ec-dcc3de452e26

Reviewed By: GijsWeterings

Differential Revision: D50734569

Pulled By: javache

fbshipit-source-id: 51b854a47caf90ae46fcd32c4adcc64ec2ceb63f

* refactor: use less verbose API for RCTRedBox constraints (#42261)

Summary:
This PR is a continuation of my previous PR where I refactored RCTRedBox to use Auto Layout (https://github.com/facebook/react-native/issues/41217). This PR uses less verbose API for defining constraints.

## Changelog:

[IOS] [CHANGED] - use less verbose Auto Layout API for RCTRedBox constraints

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

Test Plan:
Launch the app without metro enabled to see the RCTRedBox

![CleanShot 2024-01-12 at 14 54 20@2x](https://github.com/facebook/react-native/assets/52801365/32ee9916-3e32-46c3-9f6b-c313631aa1e5)
![CleanShot 2024-01-12 at 14 54 16@2x](https://github.com/facebook/react-native/assets/52801365/c625b9b9-b462-4e67-831f-0192427bbe93)

Reviewed By: NickGerleman

Differential Revision: D52730458

Pulled By: javache

fbshipit-source-id: dc7227e7b6e3238c195342cb0460850b57eb75c3

* refactor Redbox on macOS and present as a sheet

* present RCTDevLoadingView as a sheet

* refactor Logbox and present as a sheet

* change RCTRootView.loadingView to RCTPlatformView

* update Podfile.lock

* PR feedback

---------

Co-authored-by: Oskar Kwaśniewski <oskarkwasniewski@icloud.com>
2024-08-01 17:37:26 -07:00
Saad Najmi 042cd6c36b
Bump fast-xml-parser from 4.3.2 to 4.4.1 (#2150)
Bumps
[fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser)
from 4.3.2 to 4.4.1.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/CHANGELOG.md">fast-xml-parser's
changelog</a>.</em></p>
<blockquote>
<p><!-- raw HTML omitted -->Note: If you find missing information about
particular minor version, that version must have been changed without
any functional change in this library.<!-- raw HTML omitted --></p>
<p><strong>4.4.1 / 2024-07-28</strong></p>
<ul>
<li>v5 fix: maximum length limit to currency value</li>
<li>fix <a
href="https://redirect.github.com/NaturalIntelligence/fast-xml-parser/issues/634">#634</a>:
build attributes with oneListGroup and attributesGroupName (<a
href="https://redirect.github.com/NaturalIntelligence/fast-xml-parser/issues/653">#653</a>)(By
<a href="https://github.com/a-rasin">Andreas Naziris</a>)</li>
<li>fix: get oneListGroup to work as expected for array of strings (<a
href="https://redirect.github.com/NaturalIntelligence/fast-xml-parser/issues/662">#662</a>)(By
<a href="https://github.com/a-rasin">Andreas Naziris</a>)</li>
</ul>
<p><strong>4.4.0 / 2024-05-18</strong></p>
<ul>
<li>fix <a
href="https://redirect.github.com/NaturalIntelligence/fast-xml-parser/issues/654">#654</a>:
parse attribute list correctly for self closing stop node.</li>
<li>fix: validator bug when closing tag is not opened. (<a
href="https://redirect.github.com/NaturalIntelligence/fast-xml-parser/issues/647">#647</a>)
(By <a href="https://github.com/RyosukeFukatani">Ryosuke
Fukatani</a>)</li>
<li>fix <a
href="https://redirect.github.com/NaturalIntelligence/fast-xml-parser/issues/581">#581</a>:
typings; return type of <code>tagValueProcessor</code> &amp;
<code>attributeValueProcessor</code> (<a
href="https://redirect.github.com/NaturalIntelligence/fast-xml-parser/issues/582">#582</a>)
(By <a href="">monholm</a>)</li>
</ul>
<p><strong>4.3.6 / 2024-03-16</strong></p>
<ul>
<li>Add support for parsing HTML numeric entities (<a
href="https://redirect.github.com/NaturalIntelligence/fast-xml-parser/issues/645">#645</a>)
(By <a href="https://github.com/DerZade">Jonas Schade </a>)</li>
</ul>
<p><strong>4.3.5 / 2024-02-24</strong></p>
<ul>
<li>code for v5 is added for experimental use</li>
</ul>
<p><strong>4.3.4 / 2024-01-10</strong></p>
<ul>
<li>fix: Don't escape entities in CDATA sections (<a
href="https://redirect.github.com/NaturalIntelligence/fast-xml-parser/issues/633">#633</a>)
(By <a href="https://github.com/wackbyte">wackbyte</a>)</li>
</ul>
<p><strong>4.3.3 / 2024-01-10</strong></p>
<ul>
<li>Remove unnecessary regex</li>
</ul>
<p><strong>4.3.2 / 2023-10-02</strong></p>
<ul>
<li>fix <code>jObj.hasOwnProperty</code> when give input is null (By <a
href="https://github.com/ardatan">Arda TANRIKULU</a>)</li>
</ul>
<p><strong>4.3.1 / 2023-09-24</strong></p>
<ul>
<li>revert back &quot;Fix typings for builder and parser to make return
type generic&quot; to avoid failure of existing projects. Need to decide
a common approach.</li>
</ul>
<p><strong>4.3.0 / 2023-09-20</strong></p>
<ul>
<li>Fix stopNodes to work with removeNSPrefix (<a
href="https://redirect.github.com/NaturalIntelligence/fast-xml-parser/issues/607">#607</a>)
(<a
href="https://redirect.github.com/NaturalIntelligence/fast-xml-parser/issues/608">#608</a>)
(By [Craig Andrews]<a
href="https://github.com/candrews">https://github.com/candrews</a>))</li>
<li>Fix <a
href="https://redirect.github.com/NaturalIntelligence/fast-xml-parser/issues/610">#610</a>
ignore properties set to Object.prototype</li>
<li>Fix typings for builder and parser to make return type generic (By
<a href="https://github.com/sarahdayan">Sarah Dayan</a>)</li>
</ul>
<p><strong>4.2.7 / 2023-07-30</strong></p>
<ul>
<li>Fix: builder should set text node correctly when only textnode is
present (<a
href="https://redirect.github.com/NaturalIntelligence/fast-xml-parser/issues/589">#589</a>)
(By <a href="https://github.com/joneqian">qianqing</a>)</li>
<li>Fix: Fix for null and undefined attributes when building xml (<a
href="https://redirect.github.com/NaturalIntelligence/fast-xml-parser/issues/585">#585</a>)
(<a
href="https://redirect.github.com/NaturalIntelligence/fast-xml-parser/issues/598">#598</a>).
A null or undefined value should be ignored. (By <a
href="https://github.com/cecia234">Eugenio Ceschia</a>)</li>
</ul>
<p><strong>4.2.6 / 2023-07-17</strong></p>
<ul>
<li>Fix: Remove trailing slash from jPath for self-closing tags (<a
href="https://redirect.github.com/NaturalIntelligence/fast-xml-parser/issues/595">#595</a>)
(By <a href="https://github.com/m-radzikowski">Maciej
Radzikowski</a>)</li>
</ul>
<p><strong>4.2.5 / 2023-06-22</strong></p>
<ul>
<li>change code implementation</li>
</ul>
<p><strong>4.2.4 / 2023-06-06</strong></p>
<ul>
<li>fix security bug</li>
</ul>
<p><strong>4.2.3 / 2023-06-05</strong></p>
<ul>
<li>fix security bug</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="d40e29cc4b"><code>d40e29c</code></a>
update package detail and browser bundles</li>
<li><a
href="d0bfe8a3a2"><code>d0bfe8a</code></a>
fix maxlength for currency value</li>
<li><a
href="2c14fcf048"><code>2c14fcf</code></a>
Update bug-report-or-unexpected-output.md</li>
<li><a
href="acf610f25d"><code>acf610f</code></a>
fix <a
href="https://redirect.github.com/NaturalIntelligence/fast-xml-parser/issues/634">#634</a>:
build attributes with oneListGroup and attributesGroupName (<a
href="https://redirect.github.com/NaturalIntelligence/fast-xml-parser/issues/653">#653</a>)</li>
<li><a
href="931e91013b"><code>931e910</code></a>
fix: get oneListGroup to work as expected for array of strings (<a
href="https://redirect.github.com/NaturalIntelligence/fast-xml-parser/issues/662">#662</a>)</li>
<li><a
href="b8e40c842b"><code>b8e40c8</code></a>
Update ISSUE_TEMPLATE.md</li>
<li><a
href="a6265ba856"><code>a6265ba</code></a>
chore: add trend image (<a
href="https://redirect.github.com/NaturalIntelligence/fast-xml-parser/issues/658">#658</a>)</li>
<li><a
href="db1c548480"><code>db1c548</code></a>
redesign README.md</li>
<li><a
href="338a2c6266"><code>338a2c6</code></a>
Rename 1.Getting Started.md to 1.GettingStarted.md</li>
<li><a
href="c762537495"><code>c762537</code></a>
Rename v5 docs filenames (<a
href="https://redirect.github.com/NaturalIntelligence/fast-xml-parser/issues/659">#659</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/NaturalIntelligence/fast-xml-parser/compare/v4.3.2...v4.4.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=fast-xml-parser&package-manager=npm_and_yarn&previous-version=4.3.2&new-version=4.4.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/microsoft/react-native-macos/network/alerts).

</details>
2024-07-30 11:22:06 -07:00
dependabot[bot] 0c2c8b0272
Bump fast-xml-parser from 4.3.2 to 4.4.1
Bumps [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser) from 4.3.2 to 4.4.1.
- [Release notes](https://github.com/NaturalIntelligence/fast-xml-parser/releases)
- [Changelog](https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/NaturalIntelligence/fast-xml-parser/compare/v4.3.2...v4.4.1)

---
updated-dependencies:
- dependency-name: fast-xml-parser
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-29 21:43:57 +00:00
Adam Gleitman 10b1cd8497
Add onMouseEnter and onMouseLeave to Text (cherry-picked from 0.73-stable) (#2149)
* [0.73-stable] New events for RCTUIView (#2137)

* Move mouse events from RCTView to superclass RCTUIView

* Add focus and responder events

* Move mouse event implementations to RCTUIView class

---------

Co-authored-by: Adam Gleitman <adgleitm@microsoft.com>

* [0.73-stable] Add mouse hover events to `RCTTextView` (#2143)

* Initial implementation

* Refactor and dedupe some code

* Basic error handling

* Clarify comment about mousemove order

* Cleanup: enumerate all text attributes at once instead of doing multiple passes

* Use *shadow* view traversal for handling nested mouse events

* Remove potentially confusing comment

* descendantViewTags doesn't need to worry about duplicates

* Distinguish between embedded views and virtual text subviews

* Scope _virtualSubviews to macOS only

* nit: use separate #if blocks for `setTextStorage:...` and `getRectForCharRange:` inclusions

* TARGET_OS_OSX blocks for virtualSubviewTags

* Remove #if TARGET_OS_OSX blocks, since these changes are potentially upstreamable

* Clarify a TODO

---------

Co-authored-by: Adam Gleitman <adgleitm@microsoft.com>

* Add an example for Text mouse hover events

* Add missing macOS props to Text.d.ts

* Fix flow errors

* Fix lint errors

---------

Co-authored-by: Adam Gleitman <adgleitm@microsoft.com>
2024-07-26 17:05:22 -07:00
Saad Najmi 73cdf93803
chore: Upgrade to yarn 4.3.1 (#2148)
## Summary:

Originally, I meant to just update the lock to resolve some CVEs. It
seems our lock is actually clean, so instead I'm updating yarn to the
latest version.

## Test Plan:

CI passes.
2024-07-26 14:25:49 -07:00
Saad Najmi 2592d27022 chore: Upgrade to yarn 4.3.1 2024-07-26 10:32:51 -07:00
Blake Friedman 6f7eae5c58 fix disk utilisation step in GHA (#45006)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45006

The steps were pointing to an incorrect folder.  Updated to points to react-native/packages

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D58669426

fbshipit-source-id: b58b9bc7d8c7860f2f46c8bdf4bf0636e82ee357
2024-06-17 06:18:18 -07:00
Afonso 0950916846 Fix custom port listening configuration through metro.config.js (#44957)
Summary:
After updating my project to 0.73.2 I noticed that even though I had a specific port set in my `metro.config.js`, every time I'd start my project, it was running on port 8081. Passing the `--port` argument would allow me to change the port, but the config from metro did not.  I checked if the metro config was being properly applied, using `--verbose` and it was.

So I dug a bit, trying to figure out what had changed and noticed the coalescing of the value, whenever the argument `--port` is not present. That seemed odd since it meant that there's always a port defined for the `options` of `loadMetroConfig`, which would always be used in the `loadConfig` step.

To confirm I was on the right track I went to the [cli-plugin-metro](https://github.com/react-native-community/cli/blob/v11.3.10/packages/cli-plugin-metro) repo, to the last release before the move here, and noticed that there was [no coalescing in the same method](https://github.com/react-native-community/cli/blob/v11.3.10/packages/cli-plugin-metro/src/commands/start/runServer.ts#L60).

In this PR, I remove the coalescing of the port from `runServer.js` from the `community-cli-plugin`, to allow the port configuration through `metro.config.js`.

## Changelog:
[INTERNAL] [FIXED] - Fix server port configuration via `metro.config.js`
<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

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

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

Test Plan:
Running `yarn start` and verifying that:
- it would listen to port `8081` if no argument nor a custom port was set in `metro.config.js`
- it would listen to port `8082` if that one was defined in `metro.config.js`
- it would listend to port `8083` if that port was passed as an argument to the command (i.e. `yarn start --port 8083` even though port 8082 was defined in `metro.config.js`

Reviewed By: cortinico

Differential Revision: D58605152

Pulled By: robhogan

fbshipit-source-id: 9cf7a8b6a0d9de3af1ca4092906b4c648acee373
2024-06-17 05:52:16 -07:00
Blake Friedman fa8ea481f0 Add more disk visibility on GHA Android builds (#45005)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45005

We've had failures owing to running out of disk space, however this isn't a stable failure.  Adding more data about disk availability and utilisation to help debug these issues.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D58667190

fbshipit-source-id: 3d5f7cc985ac71044818f7b5663ef7400ad691b5
2024-06-17 04:30:47 -07:00
Robert Pasiński abfadc6083 feat: Implement requestIdleCallback (#44636) (#44759)
Summary:
Implements `requestIdleCallback` and `cancelIdleCallback`

### Notes

Proposed implementation does yet cover all WHATWG eventloop requirements.
 - Deadline computation is not implemented and is polyfilled by giving each callback `50ms`, rather than it being shared between other idle callbacks.
 - The requested callbacks are called with lowest priority by the scheduler as of now, but the execution is not as described in the standard.

## Changelog:

- [GENERAL] [ADDED] - Implemented `requestIdleCallback` and `cancelIdleCallback`

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

Reviewed By: javache, sammy-SC

Differential Revision: D58415077

Pulled By: rubennorte

fbshipit-source-id: 46189d4e3ca1d353fa6059a904d677c28c61b604
2024-06-17 04:22:43 -07:00
Jakub Piasecki 9922628032 Allow for setting accessibility label on text (#45003)
Summary:
Closes https://github.com/facebook/react-native/issues/43648.

`accessibilityLabel` is overridden on `RCTParagraphComponentView`: fe06cbfbf3/packages/react-native/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm (L157-L160)

Effectively making it ignore whatever is set in the prop on the component. This PR updates the overridden method to check if the prop is set (and return that if it is) before returning the text as a label.

## Changelog:

[IOS] [FIXED] - Fix the accessibility label not being applied to text components on the new architecture

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

Test Plan:
Tried out on the reproduced from the issue.

|Text with label set|Text with no label set|
|-|-|
|<img width="982" alt="Screenshot 2024-06-17 at 08 33 58" src="https://github.com/facebook/react-native/assets/21055725/646014b3-5e9e-4023-8fe7-6dd65f04b217">|<img width="982" alt="Screenshot 2024-06-17 at 08 34 12" src="https://github.com/facebook/react-native/assets/21055725/2d712ced-ab78-4f8d-b482-b30df53ca949">|

Reviewed By: javache

Differential Revision: D58664380

Pulled By: cipolleschi

fbshipit-source-id: 88b45ca859283e16472630675b66a12732be6388
2024-06-17 03:12:23 -07:00
Tim Yung 97f9e101bf RN: Update Renderers for React 19 (#44991)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44991

Updates the open source renderers for React 19. This is in preparation for React Native 0.75.

Notable, this incorporates the feature flag changes from [facebook/react#29903](https://github.com/facebook/react/pull/29903).

Changelog:
[General][Changed] - Upgrade Renderers for React 19

Reviewed By: robhogan

Differential Revision: D58632199

fbshipit-source-id: 674bb47554e4b0c6ab5127fb9683ed8284b7a4ce
2024-06-17 02:59:55 -07:00
Tim Yung 0dd8224a71 RN/Relay: Bump Dependency to React 19 (#44990)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44990

Upgrades React Native and Relay to depend on React 19, which is currently published as release candidates. This is in preparation for React Native 0.75.

This will depend on updating open source renderers after [facebook/react#29903](https://github.com/facebook/react/pull/29903) is merged.

Changelog:
[General][Changed] - Upgrade to React 19

Reviewed By: robhogan

Differential Revision: D58625271

fbshipit-source-id: f9ad95b18716a9ce02f7cfbcc7248bdfb244c010
2024-06-17 02:59:55 -07:00
Tim Yung 5a8327857b RN: Configure Jest for React 19 (#44989)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44989

Enables these 2 global feature flags for React Native Jest testing:

- `IS_REACT_ACT_ENVIRONMENT`
- `IS_REACT_NATIVE_TEST_ENVIRONMENT`

Changelog:
[General][Changed] - Enables React global flag that causes Jest testing environment to require `act()`

Reviewed By: robhogan

Differential Revision: D58644562

fbshipit-source-id: 4de5ea3a89e8ca99ac4c1c21721872db4f5552b3
2024-06-17 02:59:55 -07:00
Tim Yung 180dbbf0fb RN: Mitigate Remaining Jest Failures for React 19 (#45002)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45002

There are a couple Jest unit test cases for `VirtualizedList-test.js` that require further investigation.

We believe that these are problems with Jest fake timers in the test and not with the component itself, so for now let's skip them so as to unblock the upgrade to React 19.

Changelog:
[Internal]

Reviewed By: robhogan

Differential Revision: D58656948

fbshipit-source-id: d52f3ad8277def6eae20cbbc11751d73b769d929
2024-06-17 02:59:55 -07:00
dependabot[bot] 67152e1fd1
Bump braces from 3.0.2 to 3.0.3 (#2138)
Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3.
- [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/braces/compare/3.0.2...3.0.3)

---
updated-dependencies:
- dependency-name: braces
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-17 08:40:06 +02:00
Tim Yung fe06cbfbf3 Add missing `act`s to VirtualizedList-test and migrate to async act (#44997)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44997

Wrap `VirtualizedList-test` uses of `react-test-renderer` in `act` as appropriate, so as to pass under current React and mostly pass under React 19, with further fixes to come.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D58649295

fbshipit-source-id: 5e0fa791d581fbf004a2ca7eaa5c4b4d9a15ddfe
2024-06-16 23:02:19 -07:00
Rob Hogan 8c06a69163 assetRelativePathInSnapshot-test: use act-wrapping abstraction for create
Summary:
Migrate assetRelativePathInSnapshot-test to `act`-wrapping abstraction for `react-test-renderer` `create` in preparation for React 19.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D58653908

fbshipit-source-id: 432b172348c445b1684e60cf60b6ab94d62f21e1
2024-06-16 21:38:01 -07:00
Rob Hogan 50e65d4828 FlatList-test: use act-wrapping abstraction for create
Summary:
Migrate FlatList-test to `act`-wrapping abstraction for `react-test-renderer` `create` in preparation for React 19.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D58653845

fbshipit-source-id: 426fcef454927cee0eb2c38ef16c82106354e5d9
2024-06-16 21:38:01 -07:00
Rob Hogan cf6df4392f TouchableWithoutFeedback-test: use act-wrapping abstraction for create
Summary:
Migrate TouchableWithoutFeedback-test to `act`-wrapping abstraction for `react-test-renderer` `create` in preparation for React 19.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D58653765

fbshipit-source-id: 901ea10ec5dd72f8403a84cfd9f9e8ed55dbe04c
2024-06-16 21:38:01 -07:00
Rob Hogan a6e4e3aad2 ReacNativeTestTools-test: use act-wrapping abstraction for create
Summary:
Migrate ReacNativeTestTools-test to `act`-wrapping abstraction for `react-test-renderer` `create` in preparation for React 19.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D58653724

fbshipit-source-id: bd33fcde6d620f6b5400a043b3ef944ddba7607e
2024-06-16 21:38:01 -07:00
Rob Hogan 6d836c5182 TouchableOpacity-test: use act-wrapping abstraction for create
Summary:
Migrate TouchableOpacity-test to `act`-wrapping abstraction for `react-test-renderer` `create` in preparation for React 19.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D58653673

fbshipit-source-id: 612ef12bca3011951297b5c17f1606e7cb7eebe7
2024-06-16 21:38:01 -07:00