Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Draft] WIP Merge up to 0.74 branch cut #2145

Closed
wants to merge 19 commits into from

Conversation

FalseLobster
Copy link

@FalseLobster FalseLobster commented Jul 3, 2024

Summary:

WIP Merge up to 0.74 branch cut (facebook@c99d96b)

Things to be done:

  • Summarize interesting merges
    • facebook@1b85ed9 Moved RCTPushNotificationManager to use UNNotification APIs
    • facebook@3f621df RCTActionSheetManager was reworked for synchronous calls
    • facebook@e2eb26c RCTRedBox was reworked for iPad and orientation changes, the functionality of RCTRedBoxWindow was reworked into the new ViewController introduced upstream, RCTRedBoxController
    • facebook@0806ad7 Introduced a new stable id for the inspector dev server based on UUID which required a custom macOS implementation
    • facebook@4c108aa Added support to dynamic colors in Fabric
  • Review and remove unfinished merges (marked TBD / REVIEW in a few places)
  • Get test pages rendering (e.g. currently Button redboxes)
  • Address changes in deleted files in publish-npm-test.js and get-and-update-nightlies.js (stub out Android publish)
  • Fix macOS UTs
  • Publish new version of virtualized-list package

Test Plan:

@FalseLobster FalseLobster requested a review from a team as a code owner July 3, 2024 23:55
@Saadnajmi Saadnajmi mentioned this pull request Jul 23, 2024
@Saadnajmi
Copy link
Collaborator

Superseded by #2153

@Saadnajmi Saadnajmi closed this Aug 3, 2024
Saadnajmi added a commit that referenced this pull request Aug 9, 2024
Picking up from
#2145, many thanks
to @FalseLobster for the bulk of the work :)

Merge up to 0.74 branch cut
(facebook@c99d96b)

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.

-
facebook@1b85ed9
Moved RCTPushNotificationManager to use UNNotification APIs
-
facebook@3f621df
RCTActionSheetManager was reworked for synchronous calls
-
facebook@e2eb26c
RCTRedBox was reworked for iPad and orientation changes, the
functionality of RCTRedBoxWindow was reworked into the new
ViewController introduced upstream, RCTRedBoxController
-
facebook@0806ad7
Introduced a new stable id for the inspector dev server based on UUID
which required a custom macOS implementation
-
facebook@4c108aa
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`](#356),
which is probably more accurate than the `scale` prop we added to
RCTShadowView that keys off the main screen.
- Reverted #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
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants