Skip to content

Commit

Permalink
chore: merge up to 0.77 branch cut (#2333)
Browse files Browse the repository at this point in the history
## Summary:

Merge up to the 0.77-stable branch cut upstream. This one was fairly
easy, the original set of diffs was resolved in half a day. The rest of
the changes are in the commit" followup changes" that I'll rebase back
into the merge commit before checking in

## Test Plan:

CI should pass

## Notes

Original set of merge conflicts:
```
	both modified:   .gitignore
	both modified:   package.json
	both modified:   packages/helloworld/package.json
	both modified:   packages/react-native-test-library/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/AppDelegate/RCTRootViewFactory.mm
	both modified:   packages/react-native/Libraries/Components/AccessibilityInfo/AccessibilityInfo.js
	both modified:   packages/react-native/Libraries/Components/TextInput/RCTTextInputViewConfig.js
	both modified:   packages/react-native/Libraries/Components/Touchable/TouchableBounce.js
	both modified:   packages/react-native/Libraries/Components/Touchable/TouchableOpacity.js
	both modified:   packages/react-native/Libraries/Image/Image.ios.js
	both modified:   packages/react-native/Libraries/Image/ImageProps.js
	both modified:   packages/react-native/Libraries/Image/RCTResizeMode.h
	both modified:   packages/react-native/Libraries/Lists/SectionListModern.js
	both modified:   packages/react-native/Libraries/Text/TextInput/RCTBackedTextInputViewProtocol.h
	both modified:   packages/react-native/Libraries/Text/TextInput/RCTBaseTextInputView.h
	both modified:   packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap
	both modified:   packages/react-native/React/CoreModules/RCTActionSheetManager.mm
	both modified:   packages/react-native/React/CoreModules/RCTAppearance.h
	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/RCTDevMenu.mm
	both modified:   packages/react-native/React/CoreModules/React-CoreModules.podspec
	both modified:   packages/react-native/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.mm
	both modified:   packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTEnhancedScrollView.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/TextInput/RCTTextInputComponentView.mm
	both modified:   packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm
	both modified:   packages/react-native/React/Modules/RCTUIManager.mm
	both modified:   packages/react-native/React/Views/RCTBorderDrawing.h
	both modified:   packages/react-native/React/Views/RCTBorderDrawing.m
	both modified:   packages/react-native/React/Views/RCTView.m
	both modified:   packages/react-native/React/Views/ScrollView/RCTScrollEvent.m
	both modified:   packages/react-native/React/Views/ScrollView/RCTScrollView.h
	both modified:   packages/react-native/React/Views/ScrollView/RCTScrollView.m
	both modified:   packages/react-native/ReactCommon/react/renderer/components/textinput/TextInputEventEmitter.h
	both modified:   packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTFontUtils.mm
	both modified:   packages/react-native/index.js
	both modified:   packages/react-native/package.json
	both modified:   packages/react-native/scripts/codegen/generate-artifacts-executor.js
	both modified:   packages/react-native/sdks/hermes-engine/hermes-engine.podspec
	both modified:   packages/rn-tester/NativeComponentExample/ios/RNTMyLegacyNativeViewManager.mm
	both modified:   packages/rn-tester/NativeComponentExample/ios/RNTMyNativeViewComponentView.mm
	both modified:   packages/rn-tester/Podfile.lock
	both modified:   packages/rn-tester/RNTester/AppDelegate.mm
	both modified:   packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj
	both modified:   packages/rn-tester/RNTesterUnitTests/RCTViewTests.m
	both modified:   packages/rn-tester/js/components/ListExampleShared.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/Layout/LayoutEventsExample.js
	both modified:   packages/rn-tester/js/examples/PlatformColor/PlatformColorExample.js
	both modified:   packages/rn-tester/package.json
	both modified:   packages/virtualized-lists/package.json
	both modified:   scripts/releases-ci/publish-npm.js
	both modified:   yarn.lock
```
  • Loading branch information
Saadnajmi authored Feb 7, 2025
2 parents d8af03a + e231112 commit 5936634
Show file tree
Hide file tree
Showing 1,563 changed files with 104,117 additions and 70,363 deletions.
6 changes: 3 additions & 3 deletions .ado/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ variables:
- group: InfoSec-SecurityResults
- name: tags
value: production,externalfacing
# CodeQL Still has not fixed their bug running on Apple ARM64 jobs where they inject x64 binaries into arm64 processes and just make it crash :(
# Only workaround for now is to disable CodeQL on Apple jobs.
- name Codeql.Enabled
# CodeQL Still has not fixed their bug running on Apple ARM64 jobs where they inject x64 binaries into arm64 processes and just make it crash :(
# Only workaround for now is to disable CodeQL on Apple jobs.
- name: Codeql.Enabled
value: false
- template: /.ado/variables/vars.yml@self

Expand Down
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ module.exports = {
// These rules are not required with hermes-eslint
'ft-flow/define-flow-type': 0,
'ft-flow/use-flow-type': 0,
'lint/sort-imports': 1,
// flow handles this check for us, so it's not required
'no-undef': 0,
},
Expand Down
7 changes: 6 additions & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
; helloworld
<PROJECT_ROOT>/packages/helloworld/ios/Pods/

; Ignore rn-tester Pods
<PROJECT_ROOT>/packages/rn-tester/Pods/

[untyped]
.*/node_modules/@react-native-community/cli/.*/.*

Expand Down Expand Up @@ -69,6 +72,8 @@ suppress_type=$FlowFixMeProps
suppress_type=$FlowFixMeState
suppress_type=$FlowFixMeEmpty

ban_spread_key_props=true

[lints]
sketchy-null-number=warn
sketchy-null-mixed=warn
Expand All @@ -90,4 +95,4 @@ untyped-import
untyped-type-import

[version]
^0.245.2
^0.254.2
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 🐛 Bug Report
name: 🐛 React Native - Bug Report
description: Report a reproducible bug or regression in React Native.
labels: ["Needs: Triage :mag:"]
body:
Expand Down
76 changes: 76 additions & 0 deletions .github/ISSUE_TEMPLATE/debugger_bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: 🔍 Debugger - Bug Report
description: Report a bug with React Native DevTools and the New Debugger
labels: ["Needs: Triage :mag:", "Debugger"]

body:
- type: markdown
attributes:
value: "## Reporting a bug for React Native DevTools"
- type: markdown
attributes:
value: |
Thank you for taking the time to report an issue for React Native DevTools, our new Debugger for React Native.
Before you continue:
* If you're using **Expo** and you're noticing a bug, [report it here](https://github.com/expo/expo/issues).
* If you've found a problem with our **documentation**, [report it here](https://github.com/facebook/react-native-website/issues/).
* If you're having an issue with **Metro** (the bundler), [report it here](https://github.com/facebook/metro/issues/).
* If you're using an external library, report the issue to the **library first**.
* Please [search for similar issues](https://github.com/facebook/react-native/issues) in our issue tracker.
Make sure that your issue is tested against the [**latest stable**](https://github.com/facebook/react-native/releases/) of React Native.
- type: textarea
id: description
attributes:
label: Description
description: A clear and concise description of what the bug is.
validations:
required: true
- type: textarea
id: reproduction
attributes:
label: Steps to reproduce
description: The list of steps that reproduces the issue.
placeholder: |
1. Install the application with `yarn android`
2. Press `j` to open the debugger
3. Do something...
validations:
required: true
- type: input
id: version
attributes:
label: React Native Version
description: The version of react-native that this issue reproduces on. Bear in mind that only issues on [supported versions](https://github.com/reactwg/react-native-releases#which-versions-are-currently-supported) will be looked into.
placeholder: "0.76.0"
validations:
required: true
- type: textarea
id: react-native-info
attributes:
label: Output of `npx react-native info`
description: Run `npx react-native info` in your terminal, copy and paste the results here.
placeholder: |
Paste the output of `npx react-native info` here. The output looks like:
...
System:
OS: macOS 14.1.1
CPU: (10) arm64 Apple M1 Max
Memory: 417.81 MB / 64.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node: ...
version: 18.14.0
...
render: text
validations:
required: true
- type: textarea
id: extra
attributes:
label: Screenshots and Videos
description: |
Please provide screenshot or a video of your bug if relevant.
Issues with videos and screenshots are more likely to **get prioritized**.
2 changes: 1 addition & 1 deletion .github/actions/build-apple-slices-hermes/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ inputs:
description: The version of Hermes
slice:
required: true
description: The slice of hermes you want to build. It could be iphone, iphonesimulator, macos, catalyst, xros, or xrossimulator
description: The slice of hermes you want to build. It could be iphone, iphonesimulator, macos, catalyst, appletvos, appletvsimulator, xros, or xrossimulator
flavor:
required: true
description: The flavor we want to build. It can be Debug or Release
Expand Down
24 changes: 22 additions & 2 deletions .github/actions/build-hermes-macos/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ runs:
- name: Restore Cached Artifacts
uses: actions/cache/restore@v4
with:
key: v4-hermes-artifacts-${{ inputs.flavor }}-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}
key: v4-hermes-artifacts-${{ inputs.flavor }}-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}-${{ hashFiles('./packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}
path: |
/tmp/hermes/osx-bin/${{ inputs.flavor }}
/tmp/hermes/dSYM/${{ inputs.flavor }}
Expand Down Expand Up @@ -66,6 +66,18 @@ runs:
with:
path: ./packages/react-native/sdks/hermes/
name: slice-iphonesimulator-${{ inputs.flavor }}
- name: Slice cache appletvos
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
uses: actions/download-artifact@v4
with:
path: ./packages/react-native/sdks/hermes/
name: slice-appletvos-${{ inputs.flavor }}
- name: Slice cache appletvsimulator
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
uses: actions/download-artifact@v4
with:
path: ./packages/react-native/sdks/hermes/
name: slice-appletvsimulator-${{ inputs.flavor }}
- name: Slice cache catalyst
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
uses: actions/download-artifact@v4
Expand Down Expand Up @@ -93,6 +105,8 @@ runs:
tar -xzv -f build_catalyst_${{ matrix.flavor }}.tar.gz
tar -xzv -f build_iphoneos_${{ matrix.flavor }}.tar.gz
tar -xzv -f build_iphonesimulator_${{ matrix.flavor }}.tar.gz
tar -xzv -f build_appletvos_${{ matrix.flavor }}.tar.gz
tar -xzv -f build_appletvsimulator_${{ matrix.flavor }}.tar.gz
tar -xzv -f build_macosx_${{ matrix.flavor }}.tar.gz
tar -xzv -f build_xros_${{ matrix.flavor }}.tar.gz
tar -xzv -f build_xrsimulator_${{ matrix.flavor }}.tar.gz
Expand All @@ -105,6 +119,8 @@ runs:
mv build_macosx_${{ inputs.flavor }} build_macosx
mv build_iphoneos_${{ inputs.flavor }} build_iphoneos
mv build_iphonesimulator_${{ inputs.flavor }} build_iphonesimulator
mv build_appletvos_${{ inputs.flavor }} build_appletvos
mv build_appletvsimulator_${{ inputs.flavor }} build_appletvsimulator
mv build_catalyst_${{ inputs.flavor }} build_catalyst
mv build_xros_${{ inputs.flavor }} build_xros
mv build_xrsimulator_${{ inputs.flavor }} build_xrsimulator
Expand Down Expand Up @@ -163,6 +179,8 @@ runs:
mkdir -p "$WORKING_DIR/catalyst"
mkdir -p "$WORKING_DIR/iphoneos"
mkdir -p "$WORKING_DIR/iphonesimulator"
mkdir -p "$WORKING_DIR/appletvos"
mkdir -p "$WORKING_DIR/appletvsimulator"
mkdir -p "$WORKING_DIR/xros"
mkdir -p "$WORKING_DIR/xrsimulator"
Expand All @@ -173,6 +191,8 @@ runs:
cp -r build_catalyst/$DSYM_FILE_PATH "$WORKING_DIR/catalyst/"
cp -r build_iphoneos/$DSYM_FILE_PATH "$WORKING_DIR/iphoneos/"
cp -r build_iphonesimulator/$DSYM_FILE_PATH "$WORKING_DIR/iphonesimulator/"
cp -r build_appletvos/$DSYM_FILE_PATH "$WORKING_DIR/appletvos/"
cp -r build_appletvsimulator/$DSYM_FILE_PATH "$WORKING_DIR/appletvsimulator/"
cp -r build_xros/$DSYM_FILE_PATH "$WORKING_DIR/xros/"
cp -r build_xrsimulator/$DSYM_FILE_PATH "$WORKING_DIR/xrsimulator/"
Expand Down Expand Up @@ -200,7 +220,7 @@ runs:
uses: actions/cache/save@v4
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }} # To avoid that the cache explode.
with:
key: v4-hermes-artifacts-${{ inputs.flavor }}-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}
key: v4-hermes-artifacts-${{ inputs.flavor }}-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}-${{ hashFiles('./packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}
path: |
/tmp/hermes/osx-bin/${{ inputs.flavor }}
/tmp/hermes/dSYM/${{ inputs.flavor }}
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/build-hermesc-windows/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ runs:
shell: powershell
run: |
if (-not(Test-Path -Path $Env:HERMES_WS_DIR\win64-bin\hermesc.exe)) {
choco install --no-progress cmake --version 3.14.7
choco install --no-progress cmake --version 3.14.7 --allow-downgrade
if (-not $?) { throw "Failed to install CMake" }
cd $Env:HERMES_WS_DIR\icu
Expand Down
1 change: 1 addition & 0 deletions .github/actions/lint/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ runs:
run: yarn lint-ci
env:
GITHUB_TOKEN: ${{ inputs.github-token }}
GITHUB_PR_NUMBER: ${{ github.event.number }}
- name: Lint code
shell: bash
run: ./scripts/circleci/exec_swallow_error.sh yarn lint --format junit -o ./reports/junit/eslint/results.xml
Expand Down
44 changes: 29 additions & 15 deletions .github/actions/maestro-android/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ inputs:
required: false
default: 'true'
description: whether this action has to install java 17 or not
flavor:
required: true
description: the flavor we want to run - either debug or release
default: release
working-directory:
required: false
default: "."
description: The directory from which metro should be started

runs:
using: composite
steps:
Expand All @@ -25,7 +34,7 @@ runs:
run: export MAESTRO_VERSION=1.36.0; curl -Ls "https://get.maestro.mobile.dev" | bash
- name: Set up JDK 17
if: ${{ inputs.install-java == 'true' }}
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'zulu'
Expand All @@ -38,33 +47,38 @@ runs:
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Build Codegen
shell: bash
if: ${{ inputs.flavor == 'debug' }}
run: ./packages/react-native-codegen/scripts/oss/build.sh
- name: Run e2e tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 24
arch: x86
script: |
echo "Install APK from ${{ inputs.app-path }}"
adb install "${{ inputs.app-path }}"
echo "Start recording to /sdcard/screen.mp4"
adb shell screenrecord /sdcard/screen.mp4
echo "Start testing ${{ inputs.maestro-flow }}"
$HOME/.maestro/bin/maestro test ${{ inputs.maestro-flow }} --format junit -e APP_ID=${{ inputs.app-id }} --debug-output /tmp/MaestroLogs
echo "Stop recording. Saving to screen.mp4"
adb pull /sdcard/screen.mp4
ram-size: '4096M'
disk-size: '10G'
disable-animations: false
avd-name: e2e_emulator
script: node .github/workflow-scripts/maestro-android.js ${{ inputs.app-path }} ${{ inputs.app-id }} ${{ inputs.maestro-flow }} ${{ inputs.flavor }} ${{ inputs.working-directory }}
- name: Normalize APP_ID
id: normalize-app-id
shell: bash
if: always()
run: |
NORM_APP_ID=$(echo "${{ inputs.app-id }}" | tr '.' '-')
echo "app-id=$NORM_APP_ID" >> $GITHUB_OUTPUT
- name: Store tests result
uses: actions/upload-artifact@v3
if: always()
with:
name: e2e_android_${{ inputs.app-id }}_report_${{ inputs.jsengine }}
name: e2e_android_${{ steps.normalize-app-id.outputs.app-id }}_report_${{ inputs.jsengine }}_${{ inputs.flavor }}
path: |
report.xml
screen.mp4
- name: Store Logs
if: failure() && steps.run-tests.outcome == 'failure'
uses: actions/[email protected]
with:
name: maestro-logs-android-${{ inputs.app-id }}-${{ inputs.jsengine }}
name: maestro-logs-android-${{ steps.normalize-app-id.outputs.app-id }}-${{ inputs.jsengine }}-${{ inputs.flavor }}
path: /tmp/MaestroLogs
31 changes: 28 additions & 3 deletions .github/actions/maestro-ios/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ inputs:
maestro-flow:
required: true
description: the folder that contains the maestro tests
flavor:
required: true
description: Whether we are building for Debug or Release
default: Release
working-directory:
required: false
default: "."
description: The directory from which metro should be started

runs:
using: composite
steps:
Expand All @@ -29,6 +38,13 @@ runs:
with:
java-version: '17'
distribution: 'zulu'
- name: Start Metro in Debug
shell: bash
if: ${{ inputs.flavor == 'Debug' }}
run: |
cd ${{ inputs.working-directory }}
yarn start &
sleep 5 # to give metro time to load
- name: Run tests
id: run-tests
shell: bash
Expand All @@ -53,18 +69,25 @@ runs:
echo "Launch the app"
xcrun simctl launch $UDID ${{ inputs.app-id }}
if [[ ${{ inputs.flavor }} == 'Debug' ]]; then
# To give the app time to warm the metro's cache
sleep 20
fi
echo "Running tests with Maestro"
export MAESTRO_DRIVER_STARTUP_TIMEOUT=1500000 # 25 min. CI is extremely slow
# Add retries for flakyness
MAX_ATTEMPTS=3
MAX_ATTEMPTS=5
CURR_ATTEMPT=0
RESULT=1
while [[ $CURR_ATTEMPT -lt $MAX_ATTEMPTS ]] && [[ $RESULT -ne 0 ]]; do
CURR_ATTEMPT=$((CURR_ATTEMPT+1))
echo "Attempt number $CURR_ATTEMPT"
echo "Start video record using pid: video_record_${{ inputs.jsengine }}_$CURR_ATTEMPT.pid"
xcrun simctl io booted recordVideo video_record_$CURR_ATTEMPT.mov & echo $! > video_record_${{ inputs.jsengine }}_$CURR_ATTEMPT.pid
Expand All @@ -82,15 +105,17 @@ runs:
if: always()
uses: actions/[email protected]
with:
name: e2e_ios_${{ inputs.app-id }}_report_${{ inputs.jsengine }}
name: e2e_ios_${{ inputs.app-id }}_report_${{ inputs.jsengine }}_${{ inputs.flavor }}
path: |
video_record_1.mov
video_record_2.mov
video_record_3.mov
video_record_4.mov
video_record_5.mov
report.xml
- name: Store Logs
if: failure() && steps.run-tests.outcome == 'failure'
uses: actions/[email protected]
with:
name: maestro-logs-${{ inputs.app-id }}-${{ inputs.jsengine }}
name: maestro-logs-${{ inputs.app-id }}-${{ inputs.jsengine }}-${{ inputs.flavor }}
path: /tmp/MaestroLogs
3 changes: 0 additions & 3 deletions .github/actions/prepare-ios-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ description: Prepare iOS Tests
runs:
using: composite
steps:
- name: brew install xcbeautify
run: brew install xcbeautify
shell: bash
- name: Run Ruby Tests
shell: bash
run: |
Expand Down
Loading

0 comments on commit 5936634

Please sign in to comment.