mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ba5b9e4c29 |
@@ -9,3 +9,12 @@ end_of_line = lf
|
||||
insert_final_newline = true
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.gradle]
|
||||
indent_size = 4
|
||||
|
||||
[*.kts]
|
||||
indent_size = 4
|
||||
|
||||
[BUCK]
|
||||
indent_size = 4
|
||||
|
||||
@@ -35,9 +35,6 @@ module.exports = {
|
||||
// Flow handles these checks for us, so they aren't required
|
||||
'no-undef': 'off',
|
||||
'no-unreachable': 'off',
|
||||
// Throwing from function or rejecting promises with non-error values could result in unclear error stack traces and lead to harder debugging
|
||||
'prefer-promise-reject-errors': 'error',
|
||||
'no-throw-literal': 'error',
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
+8
-2
@@ -69,12 +69,18 @@ munge_underscores=true
|
||||
module.name_mapper='^react-native$' -> '<PROJECT_ROOT>/packages/react-native/index.js'
|
||||
module.name_mapper='^react-native/\(.*\)$' -> '<PROJECT_ROOT>/packages/react-native/\1'
|
||||
module.name_mapper='^@react-native/dev-middleware$' -> '<PROJECT_ROOT>/packages/dev-middleware'
|
||||
module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\|xml\|ktx\)$' -> '<PROJECT_ROOT>/packages/react-native/Libraries/Image/RelativeImageStub'
|
||||
module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\|xml\)$' -> '<PROJECT_ROOT>/packages/react-native/Libraries/Image/RelativeImageStub'
|
||||
|
||||
module.system.haste.module_ref_prefix=m#
|
||||
|
||||
react.runtime=automatic
|
||||
|
||||
suppress_type=$FlowIssue
|
||||
suppress_type=$FlowFixMe
|
||||
suppress_type=$FlowFixMeProps
|
||||
suppress_type=$FlowFixMeState
|
||||
suppress_type=$FlowFixMeEmpty
|
||||
|
||||
ban_spread_key_props=true
|
||||
|
||||
[lints]
|
||||
@@ -98,4 +104,4 @@ untyped-import
|
||||
untyped-type-import
|
||||
|
||||
[version]
|
||||
^0.289.0
|
||||
^0.275.0
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: 🔍 Debugger - Bug Report
|
||||
description: Report a bug with React Native DevTools and the New Debugger
|
||||
labels: ["Needs: Triage :mag:", "Debugging"]
|
||||
labels: ["Needs: Triage :mag:", "Debugger"]
|
||||
|
||||
body:
|
||||
- type: markdown
|
||||
|
||||
@@ -4,6 +4,9 @@ inputs:
|
||||
release-type:
|
||||
required: true
|
||||
description: The type of release we are building. It could be nightly, release or dry-run
|
||||
run-e2e-tests:
|
||||
default: 'false'
|
||||
description: If we need to build to run E2E tests. If yes, we need to build also x86.
|
||||
gradle-cache-encryption-key:
|
||||
description: "The encryption key needed to store the Gradle Configuration cache"
|
||||
runs:
|
||||
@@ -17,9 +20,6 @@ runs:
|
||||
- name: Install node dependencies
|
||||
uses: ./.github/actions/yarn-install
|
||||
- name: Set React Native Version
|
||||
# We don't want to set the version for stable branches, because this has been
|
||||
# already set from the 'create release' commits on the release branch.
|
||||
if: ${{ !endsWith(github.ref_name, '-stable') }}
|
||||
shell: bash
|
||||
run: node ./scripts/releases/set-rn-artifacts-version.js --build-type ${{ inputs.release-type }}
|
||||
- name: Setup gradle
|
||||
@@ -31,11 +31,10 @@ runs:
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: /github/home/.cache/ccache
|
||||
key: v2-ccache-android-${{ github.job }}-${{ github.ref }}-${{ hashFiles('packages/react-native/ReactAndroid/**/*.cpp', 'packages/react-native/ReactAndroid/**/*.h', 'packages/react-native/ReactCommon/**/*.cpp', 'packages/react-native/ReactAndroid/**/CMakeLists.txt', 'packages/react-native/ReactCommon/**/CMakeLists.txt') }}
|
||||
key: v1-ccache-android-${{ github.job }}-${{ github.ref }}
|
||||
restore-keys: |
|
||||
v2-ccache-android-${{ github.job }}-${{ github.ref }}-
|
||||
v2-ccache-android-${{ github.job }}-
|
||||
v2-ccache-android-
|
||||
v1-ccache-android-${{ github.job }}-
|
||||
v1-ccache-android-
|
||||
- name: Show ccache stats
|
||||
shell: bash
|
||||
run: ccache -s -v
|
||||
@@ -44,7 +43,11 @@ runs:
|
||||
run: |
|
||||
if [[ "${{ inputs.release-type }}" == "dry-run" ]]; then
|
||||
# dry-run: we only build ARM64 to save time/resources. For release/nightlies the default is to build all archs.
|
||||
export ORG_GRADLE_PROJECT_reactNativeArchitectures="arm64-v8a,x86" # x86 is required for E2E testing
|
||||
if [[ "${{ inputs.run-e2e-tests }}" == 'true' ]]; then
|
||||
export ORG_GRADLE_PROJECT_reactNativeArchitectures="arm64-v8a,x86" # x86 is required for E2E testing
|
||||
else
|
||||
export ORG_GRADLE_PROJECT_reactNativeArchitectures="arm64-v8a"
|
||||
fi
|
||||
TASKS="publishAllToMavenTempLocal build"
|
||||
elif [[ "${{ inputs.release-type }}" == "nightly" ]]; then
|
||||
# nightly: we set isSnapshot to true so artifacts are sent to the right repository on Maven Central.
|
||||
@@ -60,7 +63,7 @@ runs:
|
||||
uses: actions/cache/save@v4
|
||||
with:
|
||||
path: /github/home/.cache/ccache
|
||||
key: v2-ccache-android-${{ github.job }}-${{ github.ref }}-${{ hashFiles('packages/react-native/ReactAndroid/**/*.cpp', 'packages/react-native/ReactAndroid/**/*.h', 'packages/react-native/ReactCommon/**/*.cpp', 'packages/react-native/ReactAndroid/**/CMakeLists.txt', 'packages/react-native/ReactCommon/**/CMakeLists.txt') }}
|
||||
key: v1-ccache-android-${{ github.job }}-${{ github.ref }}
|
||||
- name: Show ccache stats
|
||||
shell: bash
|
||||
run: ccache -s -v
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
name: build-apple-slices-hermes
|
||||
description: This action builds hermesc for Apple platforms
|
||||
inputs:
|
||||
hermes-version:
|
||||
required: true
|
||||
description: The version of Hermes
|
||||
react-native-version:
|
||||
required: true
|
||||
description: The version of Hermes
|
||||
slice:
|
||||
required: true
|
||||
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
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Setup xcode
|
||||
uses: ./.github/actions/setup-xcode
|
||||
- name: Restore Hermes workspace
|
||||
uses: ./.github/actions/restore-hermes-workspace
|
||||
- name: Restore HermesC Artifact
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: hermesc-apple
|
||||
path: ./packages/react-native/sdks/hermes/build_host_hermesc
|
||||
- name: Restore Slice From Cache
|
||||
id: restore-slice-cache
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_${{ inputs.slice }}_${{ inputs.flavor }}
|
||||
key: v6-hermes-apple-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-${{ inputs.slice }}-${{ inputs.flavor }}
|
||||
- name: Build the Hermes ${{ inputs.slice }} frameworks
|
||||
shell: bash
|
||||
run: |
|
||||
cd ./packages/react-native/sdks/hermes || exit 1
|
||||
SLICE=${{ inputs.slice }}
|
||||
FLAVOR=${{ inputs.flavor }}
|
||||
FINAL_PATH=build_"$SLICE"_"$FLAVOR"
|
||||
echo "Final path for this slice is: $FINAL_PATH"
|
||||
|
||||
if [[ -d "$FINAL_PATH" ]]; then
|
||||
echo "[HERMES] Skipping! Found the requested slice at $FINAL_PATH".
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ "$ARTIFACTS_EXIST" ]]; then
|
||||
echo "[HERMES] Skipping! Artifacts exists already."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
export RELEASE_VERSION=${{ inputs.react-native-version }}
|
||||
|
||||
# HermesC is used to build hermes, so it has to be executable
|
||||
chmod +x ./build_host_hermesc/bin/hermesc
|
||||
|
||||
if [[ "$SLICE" == "macosx" ]]; then
|
||||
echo "[HERMES] Building Hermes for MacOS"
|
||||
|
||||
chmod +x ./utils/build-mac-framework.sh
|
||||
BUILD_TYPE="${{ inputs.flavor }}" ./utils/build-mac-framework.sh
|
||||
else
|
||||
echo "[HERMES] Building Hermes for iOS: $SLICE"
|
||||
|
||||
chmod +x ./utils/build-ios-framework.sh
|
||||
BUILD_TYPE="${{ inputs.flavor }}" ./utils/build-ios-framework.sh "$SLICE"
|
||||
fi
|
||||
|
||||
echo "Moving from build_$SLICE to $FINAL_PATH"
|
||||
mv build_"$SLICE" "$FINAL_PATH"
|
||||
|
||||
# check whether everything is there
|
||||
if [[ -d "$FINAL_PATH/API/hermes/hermes.framework" ]]; then
|
||||
echo "Successfully built hermes.framework for $SLICE in $FLAVOR"
|
||||
else
|
||||
echo "Failed to built hermes.framework for $SLICE in $FLAVOR"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -d "$FINAL_PATH/API/hermes/hermes.framework.dSYM" ]]; then
|
||||
echo "Successfully built hermes.framework.dSYM for $SLICE in $FLAVOR"
|
||||
else
|
||||
echo "Failed to built hermes.framework.dSYM for $SLICE in $FLAVOR"
|
||||
echo "Please try again"
|
||||
exit 1
|
||||
fi
|
||||
- name: Compress slices to preserve Symlinks
|
||||
shell: bash
|
||||
run: |
|
||||
cd ./packages/react-native/sdks/hermes
|
||||
tar -czv -f build_${{ matrix.slice }}_${{ matrix.flavor }}.tar.gz build_${{ matrix.slice }}_${{ matrix.flavor }}
|
||||
- name: Upload Artifact for Slice (${{ inputs.slice }}, ${{ inputs.flavor }}}
|
||||
uses: actions/upload-artifact@v4.3.4
|
||||
with:
|
||||
name: slice-${{ inputs.slice }}-${{ inputs.flavor }}
|
||||
path: ./packages/react-native/sdks/hermes/build_${{ inputs.slice }}_${{ inputs.flavor }}.tar.gz
|
||||
- name: Save slice cache
|
||||
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }} # To avoid that the cache explode.
|
||||
uses: actions/cache/save@v4
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_${{ inputs.slice }}_${{ inputs.flavor }}
|
||||
key: v6-hermes-apple-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-${{ inputs.SLICE }}-${{ inputs.FLAVOR }}
|
||||
@@ -0,0 +1,227 @@
|
||||
name: build-hermes-macos
|
||||
description: This action builds hermesc for Apple platforms
|
||||
inputs:
|
||||
hermes-version:
|
||||
required: true
|
||||
description: The version of Hermes
|
||||
react-native-version:
|
||||
required: true
|
||||
description: The version of React Native
|
||||
flavor:
|
||||
required: true
|
||||
description: The flavor we want to build. It can be Debug or Release
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Setup xcode
|
||||
uses: ./.github/actions/setup-xcode
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Restore Hermes workspace
|
||||
uses: ./.github/actions/restore-hermes-workspace
|
||||
- name: Restore Cached Artifacts
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
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 }}
|
||||
/tmp/hermes/hermes-runtime-darwin/hermes-ios-${{ inputs.flavor }}.tar.gz
|
||||
- name: Check if the required artifacts already exist
|
||||
id: check_if_apple_artifacts_are_there
|
||||
shell: bash
|
||||
run: |
|
||||
FLAVOR="${{ inputs.flavor }}"
|
||||
echo "Flavor is $FLAVOR"
|
||||
OSX_BIN="/tmp/hermes/osx-bin/$FLAVOR"
|
||||
DSYM="/tmp/hermes/dSYM/$FLAVOR"
|
||||
HERMES="/tmp/hermes/hermes-runtime-darwin/hermes-ios-$FLAVOR.tar.gz"
|
||||
|
||||
if [[ -d "$OSX_BIN" ]] && \
|
||||
[[ -d "$DSYM" ]] && \
|
||||
[[ -f "$HERMES" ]]; then
|
||||
|
||||
echo "Artifacts are there!"
|
||||
echo "ARTIFACTS_EXIST=true" >> $GITHUB_ENV
|
||||
echo "ARTIFACTS_EXIST=true" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
- name: Yarn- Install Dependencies
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: ./.github/actions/yarn-install
|
||||
- name: Slice cache macosx
|
||||
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-macosx-${{ inputs.flavor }}
|
||||
- name: Slice cache iphoneos
|
||||
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-iphoneos-${{ inputs.flavor }}
|
||||
- name: Slice cache iphonesimulator
|
||||
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-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
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
name: slice-catalyst-${{ inputs.flavor }}
|
||||
- name: Slice cache xros
|
||||
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-xros-${{ inputs.flavor }}
|
||||
- name: Slice cache xrsimulator
|
||||
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-xrsimulator-${{ inputs.flavor }}
|
||||
- name: Unzip slices
|
||||
shell: bash
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
run: |
|
||||
cd ./packages/react-native/sdks/hermes
|
||||
ls -l .
|
||||
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
|
||||
- name: Move back build folders
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
shell: bash
|
||||
run: |
|
||||
ls -l ./packages/react-native/sdks/hermes
|
||||
cd ./packages/react-native/sdks/hermes || exit 1
|
||||
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
|
||||
- name: Prepare destroot folder
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
shell: bash
|
||||
run: |
|
||||
cd ./packages/react-native/sdks/hermes || exit 1
|
||||
chmod +x ./utils/build-apple-framework.sh
|
||||
. ./utils/build-apple-framework.sh
|
||||
prepare_dest_root_for_ci
|
||||
- name: Create fat framework for iOS
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
shell: bash
|
||||
run: |
|
||||
cd ./packages/react-native/sdks/hermes || exit 1
|
||||
echo "[HERMES] Creating the universal framework"
|
||||
chmod +x ./utils/build-ios-framework.sh
|
||||
./utils/build-ios-framework.sh build_framework
|
||||
|
||||
chmod +x ./destroot/bin/hermesc
|
||||
- name: Package the Hermes Apple frameworks
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
shell: bash
|
||||
run: |
|
||||
BUILD_TYPE="${{ inputs.flavor }}"
|
||||
echo "Packaging Hermes Apple frameworks for $BUILD_TYPE build type"
|
||||
|
||||
TARBALL_OUTPUT_DIR=$(mktemp -d /tmp/hermes-tarball-output-XXXXXXXX)
|
||||
|
||||
TARBALL_FILENAME=$(node ./packages/react-native/scripts/hermes/get-tarball-name.js --buildType "$BUILD_TYPE")
|
||||
|
||||
echo "Packaging Hermes Apple frameworks for $BUILD_TYPE build type"
|
||||
|
||||
TARBALL_OUTPUT_PATH=$(node ./packages/react-native/scripts/hermes/create-tarball.js \
|
||||
--inputDir ./packages/react-native/sdks/hermes \
|
||||
--buildType "$BUILD_TYPE" \
|
||||
--outputDir $TARBALL_OUTPUT_DIR)
|
||||
|
||||
echo "Hermes tarball saved to $TARBALL_OUTPUT_PATH"
|
||||
|
||||
mkdir -p $HERMES_TARBALL_ARTIFACTS_DIR
|
||||
cp $TARBALL_OUTPUT_PATH $HERMES_TARBALL_ARTIFACTS_DIR/.
|
||||
|
||||
mkdir -p /tmp/hermes/osx-bin/${{ inputs.flavor }}
|
||||
cp ./packages/react-native/sdks/hermes/build_macosx/bin/* /tmp/hermes/osx-bin/${{ inputs.flavor }}
|
||||
ls -lR /tmp/hermes/osx-bin/
|
||||
- name: Create dSYM archive
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
shell: bash
|
||||
run: |
|
||||
FLAVOR=${{ inputs.flavor }}
|
||||
WORKING_DIR="/tmp/hermes_tmp/dSYM/$FLAVOR"
|
||||
|
||||
mkdir -p "$WORKING_DIR/macosx"
|
||||
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"
|
||||
|
||||
cd ./packages/react-native/sdks/hermes || exit 1
|
||||
|
||||
DSYM_FILE_PATH=API/hermes/hermes.framework.dSYM
|
||||
cp -r build_macosx/$DSYM_FILE_PATH "$WORKING_DIR/macosx/"
|
||||
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/"
|
||||
|
||||
DEST_DIR="/tmp/hermes/dSYM/$FLAVOR"
|
||||
tar -C "$WORKING_DIR" -czvf "hermes.framework.dSYM" .
|
||||
|
||||
mkdir -p "$DEST_DIR"
|
||||
mv "hermes.framework.dSYM" "$DEST_DIR"
|
||||
- name: Upload hermes dSYM artifacts
|
||||
uses: actions/upload-artifact@v4.3.4
|
||||
with:
|
||||
name: hermes-dSYM-${{ inputs.flavor }}
|
||||
path: /tmp/hermes/dSYM/${{ inputs.flavor }}
|
||||
- name: Upload hermes Runtime artifacts
|
||||
uses: actions/upload-artifact@v4.3.4
|
||||
with:
|
||||
name: hermes-darwin-bin-${{ inputs.flavor }}
|
||||
path: /tmp/hermes/hermes-runtime-darwin/hermes-ios-${{ inputs.flavor }}.tar.gz
|
||||
- name: Upload hermes osx artifacts
|
||||
uses: actions/upload-artifact@v4.3.4
|
||||
with:
|
||||
name: hermes-osx-bin-${{ inputs.flavor }}
|
||||
path: /tmp/hermes/osx-bin/${{ inputs.flavor }}
|
||||
- name: Upload Hermes Artifacts
|
||||
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 }}-${{ hashFiles('./packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}
|
||||
path: |
|
||||
/tmp/hermes/osx-bin/${{ inputs.flavor }}
|
||||
/tmp/hermes/dSYM/${{ inputs.flavor }}
|
||||
/tmp/hermes/hermes-runtime-darwin/hermes-ios-${{ inputs.flavor }}.tar.gz
|
||||
@@ -0,0 +1,39 @@
|
||||
name: build-hermesc-apple
|
||||
description: This action builds hermesc for Apple platforms
|
||||
inputs:
|
||||
hermes-version:
|
||||
required: true
|
||||
description: The version of Hermes
|
||||
react-native-version:
|
||||
required: true
|
||||
description: The version of React Native
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Setup xcode
|
||||
uses: ./.github/actions/setup-xcode
|
||||
- name: Restore Hermes workspace
|
||||
uses: ./.github/actions/restore-hermes-workspace
|
||||
- name: Hermes apple cache
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_host_hermesc
|
||||
key: v2-hermesc-apple-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}
|
||||
- name: Build HermesC Apple
|
||||
shell: bash
|
||||
run: |
|
||||
cd ./packages/react-native/sdks/hermes || exit 1
|
||||
. ./utils/build-apple-framework.sh
|
||||
build_host_hermesc_if_needed
|
||||
- name: Upload HermesC Artifact
|
||||
uses: actions/upload-artifact@v4.3.4
|
||||
with:
|
||||
name: hermesc-apple
|
||||
path: ./packages/react-native/sdks/hermes/build_host_hermesc
|
||||
- name: Cache hermesc apple
|
||||
uses: actions/cache/save@v4
|
||||
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }} # To avoid that the cache explode.
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_host_hermesc
|
||||
key: v2-hermesc-apple-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}
|
||||
enableCrossOsArchive: true
|
||||
@@ -0,0 +1,53 @@
|
||||
name: build-hermesc-linux
|
||||
description: This action builds hermesc for linux platforms
|
||||
inputs:
|
||||
hermes-version:
|
||||
required: True
|
||||
description: The version of Hermes
|
||||
react-native-version:
|
||||
required: True
|
||||
description: The version of React Native
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install -y git openssh-client build-essential \
|
||||
libreadline-dev libicu-dev jq zip python3
|
||||
|
||||
# Install cmake 3.28.3-1build7
|
||||
sudo apt-get install cmake=3.28.3-1build7
|
||||
sudo ln -sf /usr/bin/cmake /usr/local/bin/cmake
|
||||
- name: Restore Hermes workspace
|
||||
uses: ./.github/actions/restore-hermes-workspace
|
||||
- name: Linux cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
key: v1-hermes-${{ github.job }}-linux-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}
|
||||
path: |
|
||||
/tmp/hermes/linux64-bin/
|
||||
/tmp/hermes/hermes/destroot/
|
||||
- name: Set up workspace
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p /tmp/hermes/linux64-bin
|
||||
- name: Build HermesC for Linux
|
||||
shell: bash
|
||||
run: |
|
||||
if [ -f /tmp/hermes/linux64-bin/hermesc ]; then
|
||||
echo 'Skipping; Clean "/tmp/hermes/linux64-bin" to rebuild.'
|
||||
else
|
||||
cd /tmp/hermes
|
||||
cmake -S hermes -B build -DHERMES_STATIC_LINK=ON -DCMAKE_BUILD_TYPE=Release -DHERMES_ENABLE_TEST_SUITE=OFF \
|
||||
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=True -DCMAKE_CXX_FLAGS=-s -DCMAKE_C_FLAGS=-s \
|
||||
-DCMAKE_EXE_LINKER_FLAGS="-Wl,--whole-archive -lpthread -Wl,--no-whole-archive"
|
||||
cmake --build build --target hermesc -j 4
|
||||
cp /tmp/hermes/build/bin/hermesc /tmp/hermes/linux64-bin/.
|
||||
fi
|
||||
- name: Upload linux artifacts
|
||||
uses: actions/upload-artifact@v4.3.4
|
||||
with:
|
||||
name: hermes-linux-bin
|
||||
path: /tmp/hermes/linux64-bin
|
||||
@@ -0,0 +1,86 @@
|
||||
name: build-hermesc-windows
|
||||
description: This action builds hermesc for Windows platforms
|
||||
inputs:
|
||||
hermes-version:
|
||||
required: True
|
||||
description: The version of Hermes
|
||||
react-native-version:
|
||||
required: True
|
||||
description: The version of React Native
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Download Previous Artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: hermes-workspace
|
||||
path: 'D:\tmp\hermes'
|
||||
- name: Set up workspace
|
||||
shell: powershell
|
||||
run: |
|
||||
mkdir -p D:\tmp\hermes\osx-bin
|
||||
mkdir -p .\packages\react-native\sdks\hermes
|
||||
cp -r -Force D:\tmp\hermes\hermes\* .\packages\react-native\sdks\hermes\.
|
||||
cp -r -Force .\packages\react-native\sdks\hermes-engine\utils\* .\packages\react-native\sdks\hermes\.
|
||||
- name: Windows cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
key: v3-hermes-${{ github.job }}-windows-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}
|
||||
path: |
|
||||
D:\tmp\hermes\win64-bin\
|
||||
D:\tmp\hermes\hermes\icu\
|
||||
D:\tmp\hermes\hermes\deps\
|
||||
D:\tmp\hermes\hermes\build_release\
|
||||
- name: setup-msbuild
|
||||
uses: microsoft/setup-msbuild@v1.3.2
|
||||
- name: Set up workspace
|
||||
shell: powershell
|
||||
run: |
|
||||
New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\icu
|
||||
New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\deps
|
||||
New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\win64-bin
|
||||
- name: Downgrade CMake
|
||||
shell: powershell
|
||||
run: choco install cmake --version 3.31.6 --force
|
||||
- name: Build HermesC for Windows
|
||||
shell: powershell
|
||||
run: |
|
||||
if (-not(Test-Path -Path $Env:HERMES_WS_DIR\win64-bin\hermesc.exe)) {
|
||||
cd $Env:HERMES_WS_DIR\icu
|
||||
# If Invoke-WebRequest shows a progress bar, it will fail with
|
||||
# Win32 internal error "Access is denied" 0x5 occurred [...]
|
||||
$progressPreference = 'silentlyContinue'
|
||||
Invoke-WebRequest -Uri "$Env:ICU_URL" -OutFile "icu.zip"
|
||||
Expand-Archive -Path "icu.zip" -DestinationPath "."
|
||||
|
||||
cd $Env:HERMES_WS_DIR
|
||||
Copy-Item -Path "icu\bin64\icu*.dll" -Destination "deps"
|
||||
# Include MSVC++ 2015 redistributables
|
||||
Copy-Item -Path "c:\windows\system32\msvcp140.dll" -Destination "deps"
|
||||
Copy-Item -Path "c:\windows\system32\vcruntime140.dll" -Destination "deps"
|
||||
Copy-Item -Path "c:\windows\system32\vcruntime140_1.dll" -Destination "deps"
|
||||
|
||||
$Env:PATH += ";$Env:CMAKE_DIR;$Env:MSBUILD_DIR"
|
||||
$Env:ICU_ROOT = "$Env:HERMES_WS_DIR\icu"
|
||||
|
||||
cmake -S hermes -B build_release -G 'Visual Studio 17 2022' -Ax64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=True -DHERMES_ENABLE_WIN10_ICU_FALLBACK=OFF
|
||||
if (-not $?) { throw "Failed to configure Hermes" }
|
||||
echo "Running windows build..."
|
||||
cd build_release
|
||||
cmake --build . --target hermesc --config Release
|
||||
if (-not $?) { throw "Failed to build Hermes" }
|
||||
|
||||
echo "Copying hermesc.exe to win64-bin"
|
||||
cd $Env:HERMES_WS_DIR
|
||||
Copy-Item -Path "build_release\bin\Release\hermesc.exe" -Destination "win64-bin"
|
||||
# Include Windows runtime dependencies
|
||||
Copy-Item -Path "deps\*" -Destination "win64-bin"
|
||||
}
|
||||
else {
|
||||
Write-Host "Skipping; Clean c:\tmp\hermes\win64-bin to rebuild."
|
||||
}
|
||||
- name: Upload windows artifacts
|
||||
uses: actions/upload-artifact@v4.3.4
|
||||
with:
|
||||
name: hermes-win64-bin
|
||||
path: D:\tmp\hermes\win64-bin\
|
||||
@@ -4,6 +4,9 @@ inputs:
|
||||
release-type:
|
||||
required: true
|
||||
description: The type of release we are building. It could be nightly, release or dry-run
|
||||
hermes-ws-dir:
|
||||
required: 'true'
|
||||
description: The workspace for hermes
|
||||
gha-npm-token:
|
||||
required: false
|
||||
description: The GHA npm token, required only to publish to npm
|
||||
@@ -17,6 +20,87 @@ runs:
|
||||
- name: Setup git safe folders
|
||||
shell: bash
|
||||
run: git config --global --add safe.directory '*'
|
||||
- name: Create /tmp/hermes/osx-bin directory
|
||||
shell: bash
|
||||
run: mkdir -p /tmp/hermes/osx-bin
|
||||
- name: Download osx-bin release artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: hermes-osx-bin-Release
|
||||
path: /tmp/hermes/osx-bin/Release
|
||||
- name: Download osx-bin debug artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: hermes-osx-bin-Debug
|
||||
path: /tmp/hermes/osx-bin/Debug
|
||||
- name: Download darwin-bin release artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: hermes-darwin-bin-Release
|
||||
path: /tmp/hermes/hermes-runtime-darwin
|
||||
- name: Download darwin-bin debug artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: hermes-darwin-bin-Debug
|
||||
path: /tmp/hermes/hermes-runtime-darwin
|
||||
- name: Download hermes dSYM debug artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: hermes-dSYM-Debug
|
||||
path: /tmp/hermes/dSYM/Debug
|
||||
- name: Download hermes dSYM release vartifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: hermes-dSYM-Release
|
||||
path: /tmp/hermes/dSYM/Release
|
||||
- name: Download windows-bin artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: hermes-win64-bin
|
||||
path: /tmp/hermes/win64-bin
|
||||
- name: Download linux-bin artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: hermes-linux-bin
|
||||
path: /tmp/hermes/linux64-bin
|
||||
- name: Show /tmp/hermes directory
|
||||
shell: bash
|
||||
run: ls -lR /tmp/hermes
|
||||
- name: Copy Hermes binaries
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p ./packages/react-native/sdks/hermesc ./packages/react-native/sdks/hermesc/osx-bin ./packages/react-native/sdks/hermesc/win64-bin ./packages/react-native/sdks/hermesc/linux64-bin
|
||||
|
||||
# When build_hermes_macos runs as a matrix, it outputs
|
||||
if [[ -d ${{ inputs.hermes-ws-dir }}/osx-bin/Release ]]; then
|
||||
cp -r ${{ inputs.hermes-ws-dir }}/osx-bin/Release/* ./packages/react-native/sdks/hermesc/osx-bin/.
|
||||
elif [[ -d ${{ inputs.hermes-ws-dir }}/osx-bin/Debug ]]; then
|
||||
cp -r ${{ inputs.hermes-ws-dir }}/osx-bin/Debug/* ./packages/react-native/sdks/hermesc/osx-bin/.
|
||||
else
|
||||
ls ${{ inputs.hermes-ws-dir }}/osx-bin || echo "hermesc macOS artifacts directory missing."
|
||||
echo "Could not locate macOS hermesc binary."; exit 1;
|
||||
fi
|
||||
|
||||
# Sometimes, GHA creates artifacts with lowercase Debug/Release. Make sure that if it happen, we uppercase them.
|
||||
if [[ -f "${{ inputs.hermes-ws-dir }}/hermes-runtime-darwin/hermes-ios-debug.tar.gz" ]]; then
|
||||
mv "${{ inputs.hermes-ws-dir }}/hermes-runtime-darwin/hermes-ios-debug.tar.gz" "${{ inputs.hermes-ws-dir }}/hermes-runtime-darwin/hermes-ios-Debug.tar.gz"
|
||||
fi
|
||||
|
||||
if [[ -f "${{ inputs.hermes-ws-dir }}/hermes-runtime-darwin/hermes-ios-release.tar.gz" ]]; then
|
||||
mv "${{ inputs.hermes-ws-dir }}/hermes-runtime-darwin/hermes-ios-release.tar.gz" "${{ inputs.hermes-ws-dir }}/hermes-runtime-darwin/hermes-ios-Release.tar.gz"
|
||||
fi
|
||||
|
||||
cp -r ${{ inputs.hermes-ws-dir }}/win64-bin/* ./packages/react-native/sdks/hermesc/win64-bin/.
|
||||
cp -r ${{ inputs.hermes-ws-dir }}/linux64-bin/* ./packages/react-native/sdks/hermesc/linux64-bin/.
|
||||
|
||||
# Make sure the hermesc files are actually executable.
|
||||
chmod -R +x packages/react-native/sdks/hermesc/*
|
||||
|
||||
mkdir -p ./packages/react-native/ReactAndroid/external-artifacts/artifacts/
|
||||
cp ${{ inputs.hermes-ws-dir }}/hermes-runtime-darwin/hermes-ios-Debug.tar.gz ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-ios-debug.tar.gz
|
||||
cp ${{ inputs.hermes-ws-dir }}/hermes-runtime-darwin/hermes-ios-Release.tar.gz ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-ios-release.tar.gz
|
||||
cp ${{ inputs.hermes-ws-dir }}/dSYM/Debug/hermes.framework.dSYM ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-framework-dSYM-debug.tar.gz
|
||||
cp ${{ inputs.hermes-ws-dir }}/dSYM/Release/hermes.framework.dSYM ./packages/react-native/ReactAndroid/external-artifacts/artifacts/hermes-framework-dSYM-release.tar.gz
|
||||
- name: Download ReactNativeDependencies
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
@@ -32,12 +116,12 @@ runs:
|
||||
- name: Print Artifacts Directory
|
||||
shell: bash
|
||||
run: ls -lR ./packages/react-native/ReactAndroid/external-artifacts/artifacts/
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Setup gradle
|
||||
uses: ./.github/actions/setup-gradle
|
||||
with:
|
||||
cache-encryption-key: ${{ inputs.gradle-cache-encryption-key }}
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Install dependencies
|
||||
uses: ./.github/actions/yarn-install
|
||||
- name: Build packages
|
||||
|
||||
@@ -14,8 +14,6 @@ inputs:
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Yarn install
|
||||
uses: ./.github/actions/yarn-install
|
||||
- name: Configure Git
|
||||
|
||||
@@ -35,8 +35,6 @@ runs:
|
||||
with:
|
||||
java-version: '17'
|
||||
distribution: 'zulu'
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Run yarn install
|
||||
uses: ./.github/actions/yarn-install
|
||||
- name: Start Metro in Debug
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
name: prepare-hermes-workspace
|
||||
description: This action prepares the hermes workspace with the right hermes and react-native versions.
|
||||
inputs:
|
||||
hermes-ws-dir:
|
||||
required: true
|
||||
description: The hermes dir we need to use to setup the workspace
|
||||
hermes-version-file:
|
||||
required: true
|
||||
description: the path to the file that will contain the hermes version
|
||||
outputs:
|
||||
hermes-version:
|
||||
description: the version of Hermes tied to this run
|
||||
value: ${{ steps.hermes-version.outputs.VERSION }}
|
||||
react-native-version:
|
||||
description: the version of React Native tied to this run
|
||||
value: ${{ steps.react-native-version.outputs.VERSION }}
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
|
||||
- name: Setup hermes version
|
||||
shell: bash
|
||||
id: hermes-version
|
||||
run: |
|
||||
mkdir -p "/tmp/hermes" "/tmp/hermes/download" "/tmp/hermes/hermes"
|
||||
|
||||
if [ -f "${{ inputs.hermes-version-file }}" ]; then
|
||||
echo "Hermes Version file found! Using this version for the build:"
|
||||
echo "VERSION=$(cat ${{ inputs.hermes-version-file }})" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "Hermes Version file not found!!!"
|
||||
echo "Using the last commit from main for the build:"
|
||||
HERMES_TAG_SHA=$(git ls-remote https://github.com/facebook/hermes main | cut -f 1 | tr -d '[:space:]')
|
||||
echo "VERSION=$HERMES_TAG_SHA" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
echo "Hermes commit is $HERMES_TAG_SHA"
|
||||
|
||||
- name: Get react-native version
|
||||
shell: bash
|
||||
id: react-native-version
|
||||
run: |
|
||||
VERSION=$(cat packages/react-native/package.json | jq -r '.version')
|
||||
# Save the react native version we are building in an output variable so we can use that file as part of the cache key.
|
||||
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
|
||||
echo "React Native Version is $VERSION"
|
||||
|
||||
- name: Cache hermes workspace
|
||||
id: restore-hermes
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: |
|
||||
/tmp/hermes/download/
|
||||
/tmp/hermes/hermes/
|
||||
key: v1-hermes-${{ steps.hermes-version.outputs.version }}
|
||||
enableCrossOsArchive: true
|
||||
|
||||
# It happened while testing that a cache was created from the right folders
|
||||
# but those folders where empty. Thus, the next check ensures that we can work with those caches.
|
||||
- name: Check if cache was meaningful
|
||||
id: meaningful-cache
|
||||
shell: bash
|
||||
run: |
|
||||
if [[ -d /tmp/hermes/hermes ]] && [[ -n "$(ls -A /tmp/hermes/hermes)" ]]; then
|
||||
echo "Found a good hermes cache"
|
||||
echo "HERMES_CACHED=true" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
- name: Yarn- Install Dependencies
|
||||
if: ${{ steps.meaningful-cache.outputs.HERMES_CACHED != 'true' }}
|
||||
uses: ./.github/actions/yarn-install
|
||||
|
||||
- name: Download Hermes tarball
|
||||
if: ${{ steps.meaningful-cache.outputs.HERMES_CACHED != 'true' }}
|
||||
shell: bash
|
||||
run: |
|
||||
node packages/react-native/scripts/hermes/prepare-hermes-for-build ${{ github.event.pull_request.html_url }}
|
||||
cp packages/react-native/sdks/download/* ${{ inputs.hermes-ws-dir }}/download/.
|
||||
cp -r packages/react-native/sdks/hermes/* ${{ inputs.hermes-ws-dir }}/hermes/.
|
||||
|
||||
echo ${{ steps.hermes-version.outputs.version }}
|
||||
|
||||
- name: Upload Hermes artifact
|
||||
uses: actions/upload-artifact@v4.3.4
|
||||
with:
|
||||
name: hermes-workspace
|
||||
path: |
|
||||
/tmp/hermes/download/
|
||||
/tmp/hermes/hermes/
|
||||
|
||||
- name: Cache hermes workspace
|
||||
uses: actions/cache/save@v4
|
||||
if: ${{ github.ref == 'refs/heads/main' }} # To avoid that the cache explode.
|
||||
with:
|
||||
path: |
|
||||
/tmp/hermes/download/
|
||||
/tmp/hermes/hermes/
|
||||
key: v1-hermes-${{ steps.hermes-version.outputs.version }}
|
||||
enableCrossOsArchive: true
|
||||
@@ -0,0 +1,16 @@
|
||||
name: restore-hermes-workspace
|
||||
description: "Restore hermes workspace that has been created in Prepare Hermes Workspace"
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Download Previous Artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: hermes-workspace
|
||||
path: /tmp/hermes
|
||||
- name: Set up workspace
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p $HERMES_OSXBIN_ARTIFACTS_DIR ./packages/react-native/sdks/hermes
|
||||
cp -r $HERMES_WS_DIR/hermes/* ./packages/react-native/sdks/hermes/.
|
||||
cp -r ./packages/react-native/sdks/hermes-engine/utils ./packages/react-native/sdks/hermes/.
|
||||
@@ -1,83 +0,0 @@
|
||||
name: Run Fantom Tests
|
||||
inputs:
|
||||
release-type:
|
||||
required: true
|
||||
description: The type of release we are building. It could be nightly, release or dry-run
|
||||
gradle-cache-encryption-key:
|
||||
description: "The encryption key needed to store the Gradle Configuration cache"
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install -y git cmake openssl libssl-dev clang
|
||||
- name: Setup git safe folders
|
||||
shell: bash
|
||||
run: git config --global --add safe.directory '*'
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Install node dependencies
|
||||
uses: ./.github/actions/yarn-install
|
||||
- name: Setup gradle
|
||||
uses: ./.github/actions/setup-gradle
|
||||
with:
|
||||
cache-read-only: "false"
|
||||
cache-encryption-key: ${{ inputs.gradle-cache-encryption-key }}
|
||||
- name: Restore Fantom ccache
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: /github/home/.cache/ccache
|
||||
key: v2-ccache-fantom-${{ github.job }}-${{ github.ref }}-${{ hashFiles(
|
||||
'packages/react-native/ReactAndroid/**/*.cpp',
|
||||
'packages/react-native/ReactAndroid/**/*.h',
|
||||
'packages/react-native/ReactAndroid/**/CMakeLists.txt',
|
||||
'packages/react-native/ReactCommon/**/*.cpp',
|
||||
'packages/react-native/ReactCommon/**/*.h',
|
||||
'packages/react-native/ReactCommon/**/CMakeLists.txt',
|
||||
'private/react-native-fantom/tester/**/*.cpp',
|
||||
'private/react-native-fantom/tester/**/*.h',
|
||||
'private/react-native-fantom/tester/**/CMakeLists.txt'
|
||||
) }}
|
||||
restore-keys: |
|
||||
v2-ccache-fantom-${{ github.job }}-${{ github.ref }}-
|
||||
v2-ccache-fantom-${{ github.job }}-
|
||||
v2-ccache-fantom-
|
||||
- name: Show ccache stats
|
||||
shell: bash
|
||||
run: ccache -s -v
|
||||
- name: Run Fantom Tests
|
||||
shell: bash
|
||||
run: yarn fantom
|
||||
env:
|
||||
CC: clang
|
||||
CXX: clang++
|
||||
- name: Save Fantom ccache
|
||||
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }}
|
||||
uses: actions/cache/save@v4
|
||||
with:
|
||||
path: /github/home/.cache/ccache
|
||||
key: v2-ccache-fantom-${{ github.job }}-${{ github.ref }}-${{ hashFiles(
|
||||
'packages/react-native/ReactAndroid/**/*.cpp',
|
||||
'packages/react-native/ReactAndroid/**/*.h',
|
||||
'packages/react-native/ReactAndroid/**/CMakeLists.txt',
|
||||
'packages/react-native/ReactCommon/**/*.cpp',
|
||||
'packages/react-native/ReactCommon/**/*.h',
|
||||
'packages/react-native/ReactCommon/**/CMakeLists.txt',
|
||||
'private/react-native-fantom/tester/**/*.cpp',
|
||||
'private/react-native-fantom/tester/**/*.h',
|
||||
'private/react-native-fantom/tester/**/CMakeLists.txt'
|
||||
) }}
|
||||
- name: Show ccache stats
|
||||
shell: bash
|
||||
run: ccache -s -v
|
||||
- name: Upload test results
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@v4.3.4
|
||||
with:
|
||||
name: run-fantom-tests-results
|
||||
compression-level: 1
|
||||
path: |
|
||||
private/react-native-fantom/build/reports
|
||||
@@ -0,0 +1,32 @@
|
||||
name: setup-xcode-build-cache
|
||||
description: Add caching to iOS jobs to speed up builds
|
||||
inputs:
|
||||
hermes-version:
|
||||
description: The version of hermes
|
||||
required: true
|
||||
flavor:
|
||||
description: The flavor that is going to be built
|
||||
default: Debug
|
||||
use-frameworks:
|
||||
description: Whether we are bulding with DynamicFrameworks or StaticLibraries
|
||||
default: StaticLibraries
|
||||
ruby-version:
|
||||
description: The ruby version we are going to use
|
||||
default: 2.6.10
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: See commands.yml with_xcodebuild_cache
|
||||
shell: bash
|
||||
run: echo "See commands.yml with_xcodebuild_cache"
|
||||
- name: Cache podfile lock
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: packages/rn-tester/Podfile.lock
|
||||
key: v13-podfilelock-${{ github.job }}-NewArch-${{ inputs.flavor }}-${{ inputs.use-frameworks }}-${{ inputs.ruby-version }}-${{ hashfiles('packages/rn-tester/Podfile') }}-${{ inputs.hermes-version }}
|
||||
- name: Cache cocoapods
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: packages/rn-tester/Pods
|
||||
key: v15-cocoapods-${{ github.job }}-NewArch-${{ inputs.flavor }}-${{ inputs.use-frameworks }}-${{ inputs.ruby-version }}-${{ hashfiles('packages/rn-tester/Podfile.lock') }}-${{ hashfiles('packages/rn-tester/Podfile') }}-${{ inputs.hermes-version}}
|
||||
@@ -5,10 +5,6 @@ inputs:
|
||||
description: 'The xcode version to use'
|
||||
required: false
|
||||
default: '16.2.0'
|
||||
platform:
|
||||
description: 'The platform to use. Valid values are: ios, ios-simulator, macos, mac-catalyst, tvos, tvos-simulator, xros, xros-simulator'
|
||||
required: false
|
||||
default: 'macos'
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
@@ -16,21 +12,3 @@ runs:
|
||||
uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd
|
||||
with:
|
||||
xcode-version: ${{ inputs.xcode-version }}
|
||||
- name: Setup Platform ${{ inputs.platform }}
|
||||
if: ${{ inputs.platform != 'macos' && inputs.platform != 'mac-catalyst' }}
|
||||
shell: bash
|
||||
run: |
|
||||
# https://github.com/actions/runner-images/issues/12541
|
||||
sudo xcodebuild -runFirstLaunch
|
||||
sudo xcrun simctl list
|
||||
|
||||
# Install platform based on the platform
|
||||
if [[ "${{ inputs.platform }}" == "xros" || "${{ inputs.platform }}" == "xros-simulator" ]]; then
|
||||
sudo xcodebuild -downloadPlatform visionOS
|
||||
elif [[ "${{ inputs.platform }}" == "tvos" || "${{ inputs.platform }}" == "tvos-simulator" ]]; then
|
||||
sudo xcodebuild -downloadPlatform tvOS
|
||||
else
|
||||
sudo xcodebuild -downloadPlatform iOS
|
||||
fi
|
||||
|
||||
sudo xcodebuild -runFirstLaunch
|
||||
|
||||
@@ -10,27 +10,36 @@ inputs:
|
||||
flavor:
|
||||
description: The flavor of the build. Must be one of "Debug", "Release".
|
||||
default: Debug
|
||||
hermes-version:
|
||||
description: The version of hermes
|
||||
required: true
|
||||
react-native-version:
|
||||
description: The version of react-native
|
||||
required: true
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Setup xcode
|
||||
uses: ./.github/actions/setup-xcode
|
||||
with:
|
||||
platform: ios
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Run yarn install
|
||||
- name: Create Hermes folder
|
||||
shell: bash
|
||||
run: mkdir -p "$HERMES_WS_DIR"
|
||||
- name: Download Hermes
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: hermes-darwin-bin-${{ inputs.flavor }}
|
||||
path: /tmp/hermes/hermes-runtime-darwin/
|
||||
- name: Print Downloaded hermes
|
||||
shell: bash
|
||||
run: ls -lR "$HERMES_WS_DIR"
|
||||
- name: Run yarn
|
||||
uses: ./.github/actions/yarn-install
|
||||
- name: Setup ruby
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: ${{ inputs.ruby-version }}
|
||||
- name: Set nightly Hermes versions
|
||||
shell: bash
|
||||
run: |
|
||||
node ./scripts/releases/use-hermes-nightly.js
|
||||
- name: Run yarn install again, with the correct hermes version
|
||||
uses: ./.github/actions/yarn-install
|
||||
- name: Download ReactNativeDependencies
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
@@ -57,6 +66,20 @@ runs:
|
||||
args+=(--frameworks dynamic)
|
||||
fi
|
||||
|
||||
# Tarball is restored with capital flavors suffix, but somehow the tarball name from JS at line 96 returns as lowercased.
|
||||
# Let's ensure that the tarballs have the right names
|
||||
|
||||
if [[ -f "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Debug.tar.gz" ]]; then
|
||||
mv "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Debug.tar.gz" "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-debug.tar.gz"
|
||||
fi
|
||||
|
||||
if [[ -f "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Release.tar.gz" ]]; then
|
||||
mv "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-Release.tar.gz" "$HERMES_WS_DIR/hermes-runtime-darwin/hermes-ios-release.tar.gz"
|
||||
fi
|
||||
|
||||
BUILD_TYPE="${{ inputs.flavor }}"
|
||||
TARBALL_FILENAME=$(node ../../packages/react-native/scripts/hermes/get-tarball-name.js --buildType "$BUILD_TYPE")
|
||||
export HERMES_ENGINE_TARBALL_PATH="$HERMES_WS_DIR/hermes-runtime-darwin/$TARBALL_FILENAME"
|
||||
export RCT_USE_LOCAL_RN_DEP="/tmp/third-party/ReactNativeDependencies${{ inputs.flavor }}.xcframework.tar.gz"
|
||||
export RCT_TESTONLY_RNCORE_TARBALL_PATH="/tmp/ReactCore/ReactCore${{ inputs.flavor }}.xcframework.tar.gz"
|
||||
|
||||
|
||||
@@ -10,9 +10,18 @@ inputs:
|
||||
run-unit-tests:
|
||||
description: whether unit tests should run or not.
|
||||
default: "false"
|
||||
hermes-tarball-artifacts-dir:
|
||||
description: The directory where the hermes tarball artifacts are stored
|
||||
default: /tmp/hermes/hermes-runtime-darwin
|
||||
flavor:
|
||||
description: The flavor of the build. Must be one of "Debug", "Release".
|
||||
default: Debug
|
||||
hermes-version:
|
||||
description: The version of hermes
|
||||
required: true
|
||||
react-native-version:
|
||||
description: The version of react-native
|
||||
required: true
|
||||
run-e2e-tests:
|
||||
description: Whether we want to run E2E tests or not
|
||||
required: false
|
||||
@@ -23,25 +32,60 @@ runs:
|
||||
steps:
|
||||
- name: Setup xcode
|
||||
uses: ./.github/actions/setup-xcode
|
||||
with:
|
||||
platform: ios
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Run yarn
|
||||
uses: ./.github/actions/yarn-install
|
||||
- name: Download Hermes
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: hermes-darwin-bin-${{ inputs.flavor }}
|
||||
path: ${{ inputs.hermes-tarball-artifacts-dir }}
|
||||
- name: Setup ruby
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: ${{ inputs.ruby-version }}
|
||||
- name: Set nightly Hermes versions
|
||||
shell: bash
|
||||
run: |
|
||||
node ./scripts/releases/use-hermes-nightly.js
|
||||
- name: Run yarn install again, with the correct hermes version
|
||||
uses: ./.github/actions/yarn-install
|
||||
- name: Prepare IOS Tests
|
||||
if: ${{ inputs.run-unit-tests == 'true' }}
|
||||
uses: ./.github/actions/prepare-ios-tests
|
||||
- name: Set HERMES_ENGINE_TARBALL_PATH envvar if Hermes tarball is present
|
||||
shell: bash
|
||||
run: |
|
||||
HERMES_TARBALL_ARTIFACTS_DIR=${{ inputs.hermes-tarball-artifacts-dir }}
|
||||
if [ ! -d $HERMES_TARBALL_ARTIFACTS_DIR ]; then
|
||||
echo "Hermes tarball artifacts dir not present ($HERMES_TARBALL_ARTIFACTS_DIR). Build Hermes from source."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
TARBALL_FILENAME=$(node ./packages/react-native/scripts/hermes/get-tarball-name.js --buildType "${{ inputs.flavor }}")
|
||||
TARBALL_PATH=$HERMES_TARBALL_ARTIFACTS_DIR/$TARBALL_FILENAME
|
||||
|
||||
echo "Looking for $TARBALL_FILENAME in $HERMES_TARBALL_ARTIFACTS_DIR"
|
||||
echo "$TARBALL_PATH"
|
||||
|
||||
if [ ! -f $TARBALL_PATH ]; then
|
||||
echo "Hermes tarball not present ($TARBALL_PATH). Build Hermes from source."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Found Hermes tarball at $TARBALL_PATH"
|
||||
echo "HERMES_ENGINE_TARBALL_PATH=$TARBALL_PATH" >> $GITHUB_ENV
|
||||
- name: Print Hermes version
|
||||
shell: bash
|
||||
run: |
|
||||
HERMES_TARBALL_ARTIFACTS_DIR=${{ inputs.hermes-tarball-artifacts-dir }}
|
||||
TARBALL_FILENAME=$(node ./packages/react-native/scripts/hermes/get-tarball-name.js --buildType "${{ inputs.flavor }}")
|
||||
TARBALL_PATH=$HERMES_TARBALL_ARTIFACTS_DIR/$TARBALL_FILENAME
|
||||
if [[ -e $TARBALL_PATH ]]; then
|
||||
tar -xf $TARBALL_PATH
|
||||
echo 'print(HermesInternal?.getRuntimeProperties?.()["OSS Release Version"])' > test.js
|
||||
chmod +x ./destroot/bin/hermes
|
||||
./destroot/bin/hermes test.js
|
||||
rm test.js
|
||||
rm -rf destroot
|
||||
else
|
||||
echo 'No Hermes tarball found.'
|
||||
fi
|
||||
- name: Download ReactNativeDependencies
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
@@ -58,9 +102,17 @@ runs:
|
||||
- name: Print ReactCore folder
|
||||
shell: bash
|
||||
run: ls -lR /tmp/ReactCore
|
||||
- name: Setup xcode build cache
|
||||
uses: ./.github/actions/setup-xcode-build-cache
|
||||
with:
|
||||
hermes-version: ${{ inputs.hermes-version }}
|
||||
use-frameworks: ${{ inputs.use-frameworks }}
|
||||
flavor: ${{ inputs.flavor }}
|
||||
ruby-version: ${{ inputs.ruby-version }}
|
||||
- name: Install CocoaPods dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
export HERMES_ENGINE_TARBALL_PATH=$HERMES_ENGINE_TARBALL_PATH
|
||||
export RCT_USE_LOCAL_RN_DEP="/tmp/third-party/ReactNativeDependencies${{ inputs.flavor }}.xcframework.tar.gz"
|
||||
export RCT_TESTONLY_RNCORE_TARBALL_PATH="/tmp/ReactCore/ReactCore${{ inputs.flavor }}.xcframework.tar.gz"
|
||||
|
||||
@@ -71,7 +123,7 @@ runs:
|
||||
cd packages/rn-tester
|
||||
|
||||
bundle install
|
||||
bundle exec pod update hermes-engine --no-repo-update
|
||||
bundle exec pod install
|
||||
- name: Build RNTester
|
||||
shell: bash
|
||||
run: |
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
name: test-library-on-nightly
|
||||
description: Tests a library on a nightly
|
||||
inputs:
|
||||
library-npm-package:
|
||||
description: The library npm package to add
|
||||
required: true
|
||||
platform:
|
||||
description: whether we want to build for iOS or Android
|
||||
required: true
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Create new app
|
||||
shell: bash
|
||||
run: |
|
||||
cd /tmp
|
||||
npx @react-native-community/cli init RNApp --skip-install --version nightly
|
||||
- name: Add library
|
||||
shell: bash
|
||||
run: |
|
||||
cd /tmp/RNApp
|
||||
yarn add ${{ inputs.library-npm-package }}
|
||||
|
||||
# iOS
|
||||
- name: Setup xcode
|
||||
if: ${{ inputs.platform == 'ios' }}
|
||||
uses: ./.github/actions/setup-xcode
|
||||
- name: Build iOS
|
||||
shell: bash
|
||||
if: ${{ inputs.platform == 'ios' }}
|
||||
run: |
|
||||
cd /tmp/RNApp/ios
|
||||
bundle install
|
||||
bundle exec pod install
|
||||
xcodebuild build \
|
||||
-workspace RNApp.xcworkspace \
|
||||
-scheme RNApp \
|
||||
-sdk iphonesimulator
|
||||
|
||||
# Android
|
||||
- name: Setup Java for Android
|
||||
if: ${{ inputs.platform == 'android' }}
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
java-version: '17'
|
||||
distribution: 'zulu'
|
||||
- name: Build Android
|
||||
shell: bash
|
||||
if: ${{ inputs.platform == 'android' }}
|
||||
run: |
|
||||
cd /tmp/RNApp/android
|
||||
./gradlew assembleDebug
|
||||
@@ -2,6 +2,8 @@ name: yarn-install
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Install dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
|
||||
@@ -121,7 +121,7 @@ describe('Create Draft Release', () => {
|
||||
});
|
||||
|
||||
describe('#_computeBody', () => {
|
||||
it('computes body for release when no hermes versions are passed', async () => {
|
||||
it('computes body for release', async () => {
|
||||
const version = '0.77.1';
|
||||
const changelog = `## v${version}
|
||||
### Breaking Changes
|
||||
@@ -134,83 +134,20 @@ describe('Create Draft Release', () => {
|
||||
#### iOS
|
||||
- [PR #3436](https://github.com/facebook/react-native/pull/3436) - Some other change
|
||||
- [PR #3437](https://github.com/facebook/react-native/pull/3437) - Some other change`;
|
||||
const body = _computeBody(changelog, version);
|
||||
const body = _computeBody(version, changelog);
|
||||
|
||||
expect(body).toEqual(`${changelog}
|
||||
|
||||
---
|
||||
|
||||
Hermes dSYMS:
|
||||
- [Debug](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${version}/hermes-ios-${version}-hermes-framework-dSYM-debug.tar.gz)
|
||||
- [Release](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${version}/hermes-ios-${version}-hermes-framework-dSYM-release.tar.gz)
|
||||
|
||||
Hermes V1 dSYMS:
|
||||
- [Debug](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${version}/hermes-ios-${version}-hermes-framework-dSYM-debug.tar.gz)
|
||||
- [Release](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${version}/hermes-ios-${version}-hermes-framework-dSYM-release.tar.gz)
|
||||
- [Debug](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-hermes-framework-dSYM-debug.tar.gz)
|
||||
- [Release](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-hermes-framework-dSYM-release.tar.gz)
|
||||
|
||||
ReactNativeDependencies dSYMs:
|
||||
- [Debug](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-reactnative-dependencies-dSYM-debug.tar.gz)
|
||||
- [Release](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-reactnative-dependencies-dSYM-release.tar.gz)
|
||||
|
||||
ReactNative Core dSYMs:
|
||||
- [Debug](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-reactnative-core-debug.tar.gz)
|
||||
- [Release](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-reactnative-core-release.tar.gz)
|
||||
|
||||
---
|
||||
|
||||
You can file issues or pick requests against this release [here](https://github.com/reactwg/react-native-releases/issues/new/choose).
|
||||
|
||||
---
|
||||
|
||||
To help you upgrade to this version, you can use the [Upgrade Helper](https://react-native-community.github.io/upgrade-helper/) ⚛️.
|
||||
|
||||
---
|
||||
|
||||
View the whole changelog in the [CHANGELOG.md file](https://github.com/facebook/react-native/blob/main/CHANGELOG.md).`);
|
||||
});
|
||||
|
||||
it('computes body for release when hermes versions are passed', async () => {
|
||||
const version = '0.77.1';
|
||||
const hermesVersion = '0.15.0';
|
||||
const hermesV1Version = '250829098.0.2';
|
||||
const changelog = `## v${version}
|
||||
### Breaking Changes
|
||||
- [PR #9012](https://github.com/facebook/react-native/pull/9012) - Some other change
|
||||
|
||||
#### Android
|
||||
- [PR #3456](https://github.com/facebook/react-native/pull/3456) - Some other change
|
||||
- [PR #3457](https://github.com/facebook/react-native/pull/3457) - Some other change
|
||||
|
||||
#### iOS
|
||||
- [PR #3436](https://github.com/facebook/react-native/pull/3436) - Some other change
|
||||
- [PR #3437](https://github.com/facebook/react-native/pull/3437) - Some other change`;
|
||||
const body = _computeBody(
|
||||
changelog,
|
||||
version,
|
||||
hermesVersion,
|
||||
hermesV1Version,
|
||||
);
|
||||
|
||||
expect(body).toEqual(`${changelog}
|
||||
|
||||
---
|
||||
|
||||
Hermes dSYMS:
|
||||
- [Debug](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${hermesVersion}/hermes-ios-${hermesVersion}-hermes-framework-dSYM-debug.tar.gz)
|
||||
- [Release](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${hermesVersion}/hermes-ios-${hermesVersion}-hermes-framework-dSYM-release.tar.gz)
|
||||
|
||||
Hermes V1 dSYMS:
|
||||
- [Debug](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${hermesV1Version}/hermes-ios-${hermesV1Version}-hermes-framework-dSYM-debug.tar.gz)
|
||||
- [Release](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${hermesV1Version}/hermes-ios-${hermesV1Version}-hermes-framework-dSYM-release.tar.gz)
|
||||
|
||||
ReactNativeDependencies dSYMs:
|
||||
- [Debug](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-reactnative-dependencies-dSYM-debug.tar.gz)
|
||||
- [Release](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-reactnative-dependencies-dSYM-release.tar.gz)
|
||||
|
||||
ReactNative Core dSYMs:
|
||||
- [Debug](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-reactnative-core-debug.tar.gz)
|
||||
- [Release](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-reactnative-core-release.tar.gz)
|
||||
|
||||
---
|
||||
|
||||
You can file issues or pick requests against this release [here](https://github.com/reactwg/react-native-releases/issues/new/choose).
|
||||
@@ -251,7 +188,6 @@ View the whole changelog in the [CHANGELOG.md file](https://github.com/facebook/
|
||||
status: 201,
|
||||
json: () =>
|
||||
Promise.resolve({
|
||||
id: 1,
|
||||
html_url:
|
||||
'https://github.com/facebook/react-native/releases/tag/v0.77.1',
|
||||
}),
|
||||
@@ -272,11 +208,9 @@ View the whole changelog in the [CHANGELOG.md file](https://github.com/facebook/
|
||||
body: fetchBody,
|
||||
},
|
||||
);
|
||||
expect(response).toEqual({
|
||||
id: 1,
|
||||
html_url:
|
||||
'https://github.com/facebook/react-native/releases/tag/v0.77.1',
|
||||
});
|
||||
expect(response).toEqual(
|
||||
'https://github.com/facebook/react-native/releases/tag/v0.77.1',
|
||||
);
|
||||
});
|
||||
|
||||
it('creates a draft release for prerelease on GitHub', async () => {
|
||||
@@ -304,7 +238,6 @@ View the whole changelog in the [CHANGELOG.md file](https://github.com/facebook/
|
||||
status: 201,
|
||||
json: () =>
|
||||
Promise.resolve({
|
||||
id: 1,
|
||||
html_url:
|
||||
'https://github.com/facebook/react-native/releases/tag/v0.77.1',
|
||||
}),
|
||||
@@ -325,11 +258,9 @@ View the whole changelog in the [CHANGELOG.md file](https://github.com/facebook/
|
||||
body: fetchBody,
|
||||
},
|
||||
);
|
||||
expect(response).toEqual({
|
||||
id: 1,
|
||||
html_url:
|
||||
'https://github.com/facebook/react-native/releases/tag/v0.77.1',
|
||||
});
|
||||
expect(response).toEqual(
|
||||
'https://github.com/facebook/react-native/releases/tag/v0.77.1',
|
||||
);
|
||||
});
|
||||
|
||||
it('throws if the post failes', async () => {
|
||||
|
||||
@@ -0,0 +1,189 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
const {
|
||||
prepareFailurePayload,
|
||||
sendMessageToDiscord,
|
||||
} = require('../notifyDiscord');
|
||||
|
||||
describe('prepareFailurePayload', () => {
|
||||
it('should handle undefined failures', () => {
|
||||
const message = prepareFailurePayload(undefined);
|
||||
expect(message).toEqual({
|
||||
content:
|
||||
'⚠️ **React Native Nightly Integration Failures** ⚠️\n\nNo failures to report.',
|
||||
});
|
||||
});
|
||||
|
||||
it('should handle empty failures array', () => {
|
||||
const message = prepareFailurePayload([]);
|
||||
expect(message).toEqual({
|
||||
content:
|
||||
'⚠️ **React Native Nightly Integration Failures** ⚠️\n\nNo failures to report.',
|
||||
});
|
||||
});
|
||||
|
||||
it('should format a single failure correctly', () => {
|
||||
const failures = [
|
||||
{
|
||||
library: 'react-native-reanimated',
|
||||
platform: 'iOS',
|
||||
},
|
||||
];
|
||||
|
||||
const message = prepareFailurePayload(failures);
|
||||
expect(message).toEqual({
|
||||
content:
|
||||
'⚠️ **React Native Nightly Integration Failures** ⚠️\n\nThe integration of libraries with React Native nightly failed for the following libraries:\n\n❌ [iOS] react-native-reanimated',
|
||||
});
|
||||
});
|
||||
|
||||
it('should sort multiple failures by platform and library name', () => {
|
||||
const failures = [
|
||||
{
|
||||
library: 'react-native-reanimated',
|
||||
platform: 'iOS',
|
||||
},
|
||||
{
|
||||
library: 'react-native-gesture-handler',
|
||||
platform: 'Android',
|
||||
},
|
||||
{
|
||||
library: 'react-native-screens',
|
||||
platform: 'iOS',
|
||||
},
|
||||
{
|
||||
library: 'react-native-svg',
|
||||
platform: 'Android',
|
||||
},
|
||||
];
|
||||
|
||||
const message = prepareFailurePayload(failures);
|
||||
|
||||
// The failures should be sorted: first Android (alphabetically), then iOS
|
||||
// Within each platform, libraries should be sorted alphabetically
|
||||
expect(message).toEqual({
|
||||
content:
|
||||
'⚠️ **React Native Nightly Integration Failures** ⚠️\n\nThe integration of libraries with React Native nightly failed for the following libraries:\n\n❌ [Android] react-native-gesture-handler\n❌ [Android] react-native-svg\n❌ [iOS] react-native-reanimated\n❌ [iOS] react-native-screens',
|
||||
});
|
||||
});
|
||||
|
||||
it('should handle failures with missing properties', () => {
|
||||
const failures = [
|
||||
{
|
||||
// Missing library
|
||||
platform: 'iOS',
|
||||
},
|
||||
{
|
||||
library: 'react-native-gesture-handler',
|
||||
// Missing platform
|
||||
},
|
||||
{
|
||||
// Both missing
|
||||
},
|
||||
];
|
||||
|
||||
const message = prepareFailurePayload(failures);
|
||||
|
||||
expect(message).toEqual({
|
||||
content:
|
||||
'⚠️ **React Native Nightly Integration Failures** ⚠️\n\nThe integration of libraries with React Native nightly failed for the following libraries:\n\n❌ [iOS] Unknown\n❌ [Unknown] react-native-gesture-handler\n❌ [Unknown] Unknown',
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('sendMessageToDiscord', () => {
|
||||
// Store the original fetch function
|
||||
const originalFetch = global.fetch;
|
||||
|
||||
// Setup and teardown for each test
|
||||
beforeEach(() => {
|
||||
// Mock the global fetch function
|
||||
global.fetch = jest.fn();
|
||||
// Silence console logs during tests
|
||||
jest.spyOn(console, 'log').mockImplementation(() => {});
|
||||
jest.spyOn(console, 'error').mockImplementation(() => {});
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
// Restore the original fetch function
|
||||
global.fetch = originalFetch;
|
||||
// Restore console functions
|
||||
jest.restoreAllMocks();
|
||||
});
|
||||
|
||||
it('should throw an error if webhook URL is missing', async () => {
|
||||
await expect(sendMessageToDiscord(null, {})).rejects.toThrow(
|
||||
'Discord webhook URL is missing',
|
||||
);
|
||||
});
|
||||
|
||||
it('should send a message successfully', async () => {
|
||||
// Mock a successful response
|
||||
global.fetch.mockResolvedValueOnce({
|
||||
ok: true,
|
||||
status: 200,
|
||||
});
|
||||
|
||||
const webhook = 'https://discord.com/api/webhooks/123/abc';
|
||||
const message = {content: 'Test message'};
|
||||
|
||||
await expect(sendMessageToDiscord(webhook, message)).resolves.not.toThrow();
|
||||
|
||||
// Verify fetch was called with the right arguments
|
||||
expect(global.fetch).toHaveBeenCalledWith(webhook, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify(message),
|
||||
});
|
||||
|
||||
// Verify console.log was called
|
||||
expect(console.log).toHaveBeenCalledWith(
|
||||
'Successfully sent message to Discord',
|
||||
);
|
||||
});
|
||||
|
||||
it('should throw an error if the response is not ok', async () => {
|
||||
// Mock a failed response
|
||||
global.fetch.mockResolvedValueOnce({
|
||||
ok: false,
|
||||
status: 400,
|
||||
text: jest.fn().mockResolvedValueOnce('Bad Request'),
|
||||
});
|
||||
|
||||
const webhook = 'https://discord.com/api/webhooks/123/abc';
|
||||
const message = {content: 'Test message'};
|
||||
|
||||
await expect(sendMessageToDiscord(webhook, message)).rejects.toThrow(
|
||||
'HTTP status code: 400',
|
||||
);
|
||||
|
||||
// Verify console.error was called
|
||||
expect(console.error).toHaveBeenCalledWith(
|
||||
'Failed to send message to Discord: 400 Bad Request',
|
||||
);
|
||||
});
|
||||
|
||||
it('should throw an error if fetch fails', async () => {
|
||||
// Mock a network error
|
||||
const networkError = new Error('Network error');
|
||||
global.fetch.mockRejectedValueOnce(networkError);
|
||||
|
||||
const webhook = 'https://discord.com/api/webhooks/123/abc';
|
||||
const message = {content: 'Test message'};
|
||||
|
||||
await expect(sendMessageToDiscord(webhook, message)).rejects.toThrow(
|
||||
'Network error',
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -117,13 +117,13 @@ describe('#verifyPublishedTemplate', () => {
|
||||
it('will timeout if npm does not update package version after a set number of retries', async () => {
|
||||
const RETRIES = 2;
|
||||
|
||||
(await verifyPublishedTemplate('0.77.0', true, RETRIES),
|
||||
await verifyPublishedTemplate('0.77.0', true, RETRIES),
|
||||
expect(mockVerifyPublishedPackage).toHaveBeenCalledWith(
|
||||
'@react-native-community/template',
|
||||
'0.77.0',
|
||||
'latest',
|
||||
2,
|
||||
));
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -83,13 +83,13 @@ describe('#verifyReleaseOnNPM', () => {
|
||||
it('will timeout if npm does not update package version after a set number of retries', async () => {
|
||||
const RETRIES = 2;
|
||||
|
||||
(await verifyReleaseOnNpm('0.77.0', true, RETRIES),
|
||||
await verifyReleaseOnNpm('0.77.0', true, RETRIES),
|
||||
expect(mockVerifyPublishedPackage).toHaveBeenCalledWith(
|
||||
'react-native',
|
||||
'0.77.0',
|
||||
'latest',
|
||||
2,
|
||||
));
|
||||
);
|
||||
});
|
||||
|
||||
it('will timeout if npm does not update latest tag after a set number of retries', async () => {
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const {
|
||||
prepareFailurePayload,
|
||||
sendMessageToDiscord,
|
||||
} = require('./notifyDiscord');
|
||||
|
||||
function readOutcomes() {
|
||||
const baseDir = '/tmp';
|
||||
let outcomes = [];
|
||||
fs.readdirSync(baseDir).forEach(file => {
|
||||
const fullPath = path.join(baseDir, file);
|
||||
if (fullPath.endsWith('outcome') && fs.statSync(fullPath).isDirectory) {
|
||||
fs.readdirSync(fullPath).forEach(subFile => {
|
||||
const subFullPath = path.join(fullPath, subFile);
|
||||
if (subFullPath.endsWith('outcome')) {
|
||||
const [library, status] = String(fs.readFileSync(subFullPath, 'utf8'))
|
||||
.trim()
|
||||
.split(':');
|
||||
const platform = subFile.includes('android') ? 'Android' : 'iOS';
|
||||
console.log(
|
||||
`[${platform}] ${library} completed with status ${status}`,
|
||||
);
|
||||
outcomes.push({
|
||||
library: library.trim(),
|
||||
platform,
|
||||
status: status.trim(),
|
||||
});
|
||||
}
|
||||
});
|
||||
} else if (fullPath.endsWith('outcome')) {
|
||||
const [library, status] = String(fs.readFileSync(fullPath, 'utf8'))
|
||||
.trim()
|
||||
.split(':');
|
||||
const platform = file.includes('android') ? 'Android' : 'iOS';
|
||||
console.log(`[${platform}] ${library} completed with status ${status}`);
|
||||
outcomes.push({
|
||||
library: library.trim(),
|
||||
platform,
|
||||
status: status.trim(),
|
||||
});
|
||||
}
|
||||
});
|
||||
return outcomes;
|
||||
}
|
||||
|
||||
function printFailures(outcomes) {
|
||||
console.log('Printing failures...');
|
||||
let failedLibraries = [];
|
||||
outcomes.forEach(entry => {
|
||||
if (entry.status !== 'success') {
|
||||
console.log(
|
||||
`❌ [${entry.platform}] ${entry.library} failed with status ${entry.status}`,
|
||||
);
|
||||
failedLibraries.push({
|
||||
library: entry.library,
|
||||
platform: entry.platform,
|
||||
});
|
||||
}
|
||||
});
|
||||
return failedLibraries;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends a message to Discord with the list of failures.
|
||||
* @param {string} webHook - The Discord webhook URL
|
||||
* @param {Array<Object>} failures - List of failures to report
|
||||
* @returns {Promise<void>} - A promise that resolves when the message is sent
|
||||
*/
|
||||
async function notifyDiscord(webHook, failures) {
|
||||
if (!webHook) {
|
||||
console.error('Discord webhook URL is missing');
|
||||
return;
|
||||
}
|
||||
|
||||
if (!failures || failures.length === 0) {
|
||||
console.log('No failures to report to Discord');
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
// Use the prepareFailurePayload function to format the message
|
||||
const message = prepareFailurePayload(failures);
|
||||
|
||||
// Use the sendMessageToDiscord function to send the message
|
||||
await sendMessageToDiscord(webHook, message);
|
||||
} catch (error) {
|
||||
console.error('Error in notifyDiscord function:', error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
async function collectResults(discordWebHook) {
|
||||
const outcomes = readOutcomes();
|
||||
const failures = printFailures(outcomes);
|
||||
|
||||
if (failures.length > 0) {
|
||||
if (discordWebHook) {
|
||||
console.log('Sending to discord');
|
||||
await notifyDiscord(discordWebHook, failures);
|
||||
} else {
|
||||
console.log('Web hook not set');
|
||||
}
|
||||
process.exit(1);
|
||||
}
|
||||
console.log('✅ All tests passed!');
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
collectResults,
|
||||
notifyDiscord,
|
||||
};
|
||||
@@ -40,29 +40,19 @@ function _extractChangelog(version) {
|
||||
return changelog.slice(changelogStarts, changelogEnds).join('\n').trim();
|
||||
}
|
||||
|
||||
function _computeBody(changelog, version, hermesVersion, hermesV1Version) {
|
||||
hermesVersion = hermesVersion ?? version;
|
||||
hermesV1Version = hermesV1Version ?? version;
|
||||
function _computeBody(version, changelog) {
|
||||
return `${changelog}
|
||||
|
||||
---
|
||||
|
||||
Hermes dSYMS:
|
||||
- [Debug](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${hermesVersion}/hermes-ios-${hermesVersion}-hermes-framework-dSYM-debug.tar.gz)
|
||||
- [Release](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${hermesVersion}/hermes-ios-${hermesVersion}-hermes-framework-dSYM-release.tar.gz)
|
||||
|
||||
Hermes V1 dSYMS:
|
||||
- [Debug](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${hermesV1Version}/hermes-ios-${hermesV1Version}-hermes-framework-dSYM-debug.tar.gz)
|
||||
- [Release](https://repo1.maven.org/maven2/com/facebook/hermes/hermes-ios/${hermesV1Version}/hermes-ios-${hermesV1Version}-hermes-framework-dSYM-release.tar.gz)
|
||||
- [Debug](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-hermes-framework-dSYM-debug.tar.gz)
|
||||
- [Release](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-hermes-framework-dSYM-release.tar.gz)
|
||||
|
||||
ReactNativeDependencies dSYMs:
|
||||
- [Debug](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-reactnative-dependencies-dSYM-debug.tar.gz)
|
||||
- [Release](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-reactnative-dependencies-dSYM-release.tar.gz)
|
||||
|
||||
ReactNative Core dSYMs:
|
||||
- [Debug](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-reactnative-core-debug.tar.gz)
|
||||
- [Release](https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/${version}/react-native-artifacts-${version}-reactnative-core-release.tar.gz)
|
||||
|
||||
---
|
||||
|
||||
You can file issues or pick requests against this release [here](https://github.com/reactwg/react-native-releases/issues/new/choose).
|
||||
@@ -111,11 +101,7 @@ async function _createDraftReleaseOnGitHub(version, body, latest, token) {
|
||||
}
|
||||
|
||||
const data = await response.json();
|
||||
const {html_url, id} = data;
|
||||
return {
|
||||
html_url,
|
||||
id,
|
||||
};
|
||||
return data.html_url;
|
||||
}
|
||||
|
||||
function moveToChangelogBranch(version) {
|
||||
@@ -123,13 +109,7 @@ function moveToChangelogBranch(version) {
|
||||
run(`git checkout -b changelog/v${version}`);
|
||||
}
|
||||
|
||||
async function createDraftRelease(
|
||||
version,
|
||||
latest,
|
||||
token,
|
||||
hermesVersion,
|
||||
hermesV1Version,
|
||||
) {
|
||||
async function createDraftRelease(version, latest, token) {
|
||||
if (version.startsWith('v')) {
|
||||
version = version.substring(1);
|
||||
}
|
||||
@@ -137,15 +117,14 @@ async function createDraftRelease(
|
||||
_verifyTagExists(version);
|
||||
moveToChangelogBranch(version);
|
||||
const changelog = _extractChangelog(version);
|
||||
const body = _computeBody(changelog, version, hermesVersion, hermesV1Version);
|
||||
const body = _computeBody(version, changelog);
|
||||
const release = await _createDraftReleaseOnGitHub(
|
||||
version,
|
||||
body,
|
||||
latest,
|
||||
token,
|
||||
);
|
||||
log(`Created draft release: ${release.html_url}, ID ${release.id}`);
|
||||
return release;
|
||||
log(`Created draft release: ${release}`);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
||||
@@ -25,31 +25,6 @@ function extractUsersFromScheduleAndDate(schedule, userMap, date) {
|
||||
return [user1, user2];
|
||||
}
|
||||
|
||||
/**
|
||||
* You can invoke this script by doing:
|
||||
* ```
|
||||
* node .github/workflow-scripts/extractIssueOncalls.js $DATA
|
||||
* ```
|
||||
*
|
||||
* the $DATA is stored in the github secrets as ONCALL_SCHEDULE variable.
|
||||
* The format of the data is:
|
||||
* ```
|
||||
* {
|
||||
* \"userMap\": {
|
||||
* \"discord_handle1\": \"discord_id1\",
|
||||
* \"discord_handle2\": \"discord_id2\",
|
||||
* ...
|
||||
* },
|
||||
* \"schedule\": {
|
||||
* \"2025-07-29\": [\"discord_handle1\", \"discord_handle2\"],
|
||||
* \"2025-08-05\": [\"discord_handle3\", \"discord_handle4\"],
|
||||
* ...
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* When uploading the secret, make sure that the JSON strings are escaped!
|
||||
* The script will fail otherwise, because GitHub will remove the `"` characters.
|
||||
*/
|
||||
function main() {
|
||||
const configuration = process.argv[2];
|
||||
const {userMap, schedule} = JSON.parse(configuration);
|
||||
|
||||
@@ -87,11 +87,11 @@ async function launchAppOnSimulator(appId, udid, isDebug) {
|
||||
|
||||
function startVideoRecording(jsengine, currentAttempt) {
|
||||
console.log(
|
||||
`Start video record using pid: video_record_${currentAttempt}.pid`,
|
||||
`Start video record using pid: video_record_${jsengine}_${currentAttempt}.pid`,
|
||||
);
|
||||
|
||||
const recordingArgs =
|
||||
`simctl io booted recordVideo video_record_${currentAttempt}.mov`.split(
|
||||
`simctl io booted recordVideo video_record_${jsengine}_${currentAttempt}.mov`.split(
|
||||
' ',
|
||||
);
|
||||
const recordingProcess = childProcess.spawn('xcrun', recordingArgs, {
|
||||
@@ -162,7 +162,7 @@ async function main() {
|
||||
console.info(`WORKING_DIRECTORY: ${WORKING_DIRECTORY}`);
|
||||
console.info('==============================\n');
|
||||
|
||||
const simulatorName = 'iPhone 16 Pro';
|
||||
const simulatorName = 'iPhone 15 Pro';
|
||||
launchSimulator(simulatorName);
|
||||
installAppOnSimulator(APP_PATH);
|
||||
const udid = extractSimulatorUDID();
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
/**
|
||||
* Sends a message to Discord using the webhook URL.
|
||||
* @param {string} webHook - The Discord webhook URL
|
||||
* @param {Object} message - The message to send
|
||||
* @returns {Promise<void>} - A promise that resolves when the message is sent
|
||||
*/
|
||||
async function sendMessageToDiscord(webHook, message) {
|
||||
if (!webHook) {
|
||||
throw new Error('Discord webhook URL is missing');
|
||||
}
|
||||
|
||||
// Send the request using fetch
|
||||
const response = await fetch(webHook, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify(message),
|
||||
});
|
||||
|
||||
// Handle the response
|
||||
if (response.ok) {
|
||||
console.log('Successfully sent message to Discord');
|
||||
return;
|
||||
} else {
|
||||
const errorText = await response.text();
|
||||
console.error(
|
||||
`Failed to send message to Discord: ${response.status} ${errorText}`,
|
||||
);
|
||||
throw new Error(`HTTP status code: ${response.status}`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepares a formatted Discord message payload from a list of failures.
|
||||
* @param {Array<Object>} failures - List of failures to format
|
||||
* @returns {Object} - The formatted Discord message payload
|
||||
*/
|
||||
function prepareFailurePayload(failures) {
|
||||
if (!failures || failures.length === 0) {
|
||||
return {
|
||||
content:
|
||||
'⚠️ **React Native Nightly Integration Failures** ⚠️\n\nNo failures to report.',
|
||||
};
|
||||
}
|
||||
|
||||
// Sort failures by platform and then by library name
|
||||
const sortedFailures = [...failures].sort((a, b) => {
|
||||
// First sort by platform
|
||||
const platformA = a.platform || 'Unknown';
|
||||
const platformB = b.platform || 'Unknown';
|
||||
|
||||
if (platformA !== platformB) {
|
||||
return platformA.localeCompare(platformB);
|
||||
}
|
||||
|
||||
// Then sort by library name
|
||||
const libraryA = a.library || 'Unknown';
|
||||
const libraryB = b.library || 'Unknown';
|
||||
return libraryA.localeCompare(libraryB);
|
||||
});
|
||||
|
||||
// Format the failures into a message
|
||||
const formattedFailures = sortedFailures
|
||||
.map(failure => {
|
||||
const library = failure.library || 'Unknown';
|
||||
const platform = failure.platform || 'Unknown';
|
||||
return `❌ [${platform}] ${library}`;
|
||||
})
|
||||
.join('\n');
|
||||
|
||||
return {
|
||||
content: `⚠️ **React Native Nightly Integration Failures** ⚠️\n\nThe integration of libraries with React Native nightly failed for the following libraries:\n\n${formattedFailures}`,
|
||||
};
|
||||
}
|
||||
|
||||
// Export the functions using CommonJS syntax
|
||||
module.exports = {
|
||||
prepareFailurePayload,
|
||||
sendMessageToDiscord,
|
||||
};
|
||||
@@ -21,7 +21,7 @@ jobs:
|
||||
- name: Setup xcode
|
||||
uses: ./.github/actions/setup-xcode
|
||||
with:
|
||||
platform: 'ios'
|
||||
xcode-version: '16.2.0'
|
||||
- name: Extract branch name
|
||||
run: |
|
||||
TAG="${{ github.ref_name }}";
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
# This jobs runs every day 2 hours after the nightly job and its purpose is to report
|
||||
# a failure in case the nightly failed to be published. We are going to hook this to an internal automation.
|
||||
name: Check Nightlies
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
# nightly build @ 4:15 AM UTC
|
||||
schedule:
|
||||
- cron: '15 4 * * *'
|
||||
|
||||
jobs:
|
||||
check-nightly:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'facebook/react-native'
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Check nightly
|
||||
run: |
|
||||
TODAY=$(date "+%Y%m%d")
|
||||
echo "Checking nightly for $TODAY"
|
||||
NIGHTLY="$(npm view react-native | grep $TODAY)"
|
||||
if [[ -z $NIGHTLY ]]; then
|
||||
echo 'Nightly job failed.'
|
||||
exit 1
|
||||
else
|
||||
echo 'Nightly Worked, All Good!'
|
||||
fi
|
||||
|
||||
test-libraries:
|
||||
uses: ./.github/workflows/test-libraries-on-nightlies.yml
|
||||
needs: check-nightly
|
||||
secrets:
|
||||
discord_webhook_url: ${{ secrets.NIGHTLY_DISCORD_WEBHOOK }}
|
||||
@@ -2,15 +2,6 @@ name: Create Draft Release
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
hermesVersion:
|
||||
required: false
|
||||
type: string
|
||||
description: The version of Hermes to use for this release (eg. 0.15.0). If not specified, it will use React Native Version
|
||||
hermesV1Version:
|
||||
required: false
|
||||
type: string
|
||||
description: The version of Hermes V1 to use for this release (eg. 250829098.0.2). If not specified, it will use React Native Version
|
||||
|
||||
jobs:
|
||||
create-draft-release:
|
||||
@@ -30,24 +21,9 @@ jobs:
|
||||
git config --local user.name "React Native Bot"
|
||||
- name: Create draft release
|
||||
uses: actions/github-script@v6
|
||||
id: create-draft-release
|
||||
with:
|
||||
script: |
|
||||
const {createDraftRelease} = require('./.github/workflow-scripts/createDraftRelease.js');
|
||||
const version = '${{ github.ref_name }}';
|
||||
const {isLatest} = require('./.github/workflow-scripts/publishTemplate.js');
|
||||
return (await createDraftRelease(version, isLatest(), '${{secrets.REACT_NATIVE_BOT_GITHUB_TOKEN}}', ${{ inputs.hermesVersion }}, ${{ inputs.hermesV1Version }})).id;
|
||||
result-encoding: string
|
||||
- name: Upload release assets for DotSlash
|
||||
uses: actions/github-script@v6
|
||||
env:
|
||||
RELEASE_ID: ${{ steps.create-draft-release.outputs.result }}
|
||||
with:
|
||||
script: |
|
||||
const {uploadReleaseAssetsForDotSlashFiles} = require('./scripts/releases/upload-release-assets-for-dotslash.js');
|
||||
const version = '${{ github.ref_name }}';
|
||||
await uploadReleaseAssetsForDotSlashFiles({
|
||||
version,
|
||||
token: '${{secrets.REACT_NATIVE_BOT_GITHUB_TOKEN}}',
|
||||
releaseId: process.env.RELEASE_ID,
|
||||
});
|
||||
await createDraftRelease(version, isLatest(), '${{secrets.REACT_NATIVE_BOT_GITHUB_TOKEN}}');
|
||||
|
||||
@@ -19,7 +19,6 @@ on:
|
||||
|
||||
jobs:
|
||||
create_release:
|
||||
if: github.repository == 'facebook/react-native'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
|
||||
@@ -27,6 +27,10 @@ jobs:
|
||||
ONCALL2=$(echo $ONCALLS | cut -d ' ' -f 2)
|
||||
echo "oncall1=$ONCALL1" >> $GITHUB_ENV
|
||||
echo "oncall2=$ONCALL2" >> $GITHUB_ENV
|
||||
- name: Print oncalls
|
||||
run: |
|
||||
echo "oncall1: ${{ env.oncall1 }}"
|
||||
echo "oncall2: ${{ env.oncall2 }}"
|
||||
- name: Monitor New Issues
|
||||
uses: react-native-community/repo-monitor@v1.0.1
|
||||
with:
|
||||
|
||||
@@ -21,21 +21,130 @@ jobs:
|
||||
echo "Setting release type to nightly"
|
||||
echo "RELEASE_TYPE=nightly" >> $GITHUB_OUTPUT
|
||||
|
||||
prepare_hermes_workspace:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
HERMES_VERSION_FILE: packages/react-native/sdks/.hermesversion
|
||||
outputs:
|
||||
react-native-version: ${{ steps.prepare-hermes-workspace.outputs.react-native-version }}
|
||||
hermes-version: ${{ steps.prepare-hermes-workspace.outputs.hermes-version }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Prepare Hermes Workspace
|
||||
id: prepare-hermes-workspace
|
||||
uses: ./.github/actions/prepare-hermes-workspace
|
||||
with:
|
||||
hermes-ws-dir: ${{ env.HERMES_WS_DIR }}
|
||||
hermes-version-file: ${{ env.HERMES_VERSION_FILE }}
|
||||
|
||||
build_hermesc_apple:
|
||||
runs-on: macos-14
|
||||
needs: prepare_hermes_workspace
|
||||
env:
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Build HermesC Apple
|
||||
uses: ./.github/actions/build-hermesc-apple
|
||||
with:
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.output.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.output.react-native-version }}
|
||||
|
||||
build_apple_slices_hermes:
|
||||
runs-on: macos-14
|
||||
needs: [build_hermesc_apple, prepare_hermes_workspace]
|
||||
env:
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
|
||||
HERMES_OSXBIN_ARTIFACTS_DIR: /tmp/hermes/osx-bin
|
||||
IOS_DEPLOYMENT_TARGET: "15.1"
|
||||
XROS_DEPLOYMENT_TARGET: "1.0"
|
||||
MAC_DEPLOYMENT_TARGET: "10.15"
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
flavor: [Debug, Release]
|
||||
slice: [macosx, iphoneos, iphonesimulator, appletvos, appletvsimulator, catalyst, xros, xrsimulator]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Build Slice
|
||||
uses: ./.github/actions/build-apple-slices-hermes
|
||||
with:
|
||||
flavor: ${{ matrix.flavor }}
|
||||
slice: ${{ matrix.slice}}
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
|
||||
build_hermes_macos:
|
||||
runs-on: macos-14
|
||||
needs: [build_apple_slices_hermes, prepare_hermes_workspace]
|
||||
env:
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
|
||||
continue-on-error: true
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
flavor: [Debug, Release]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Build Hermes MacOS
|
||||
uses: ./.github/actions/build-hermes-macos
|
||||
with:
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
flavor: ${{ matrix.flavor }}
|
||||
|
||||
prebuild_apple_dependencies:
|
||||
if: github.repository == 'facebook/react-native'
|
||||
uses: ./.github/workflows/prebuild-ios-dependencies.yml
|
||||
secrets: inherit
|
||||
|
||||
prebuild_react_native_core:
|
||||
uses: ./.github/workflows/prebuild-ios-core.yml
|
||||
with:
|
||||
use-hermes-nightly: true
|
||||
secrets: inherit
|
||||
needs: [prebuild_apple_dependencies]
|
||||
needs: [prebuild_apple_dependencies, build_hermes_macos]
|
||||
|
||||
build_hermesc_linux:
|
||||
runs-on: ubuntu-latest
|
||||
needs: prepare_hermes_workspace
|
||||
env:
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Build HermesC Linux
|
||||
uses: ./.github/actions/build-hermesc-linux
|
||||
with:
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
|
||||
build_hermesc_windows:
|
||||
runs-on: windows-2025
|
||||
needs: prepare_hermes_workspace
|
||||
env:
|
||||
HERMES_WS_DIR: 'D:\tmp\hermes'
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: 'D:\tmp\hermes\hermes-runtime-darwin'
|
||||
HERMES_OSXBIN_ARTIFACTS_DIR: 'D:\tmp\hermes\osx-bin'
|
||||
ICU_URL: "https://github.com/unicode-org/icu/releases/download/release-64-2/icu4c-64_2-Win64-MSVC2017.zip"
|
||||
MSBUILD_DIR: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin'
|
||||
CMAKE_DIR: 'C:\Program Files\CMake\bin'
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Build HermesC Windows
|
||||
uses: ./.github/actions/build-hermesc-windows
|
||||
with:
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
|
||||
build_android:
|
||||
runs-on: 8-core-ubuntu
|
||||
if: github.repository == 'facebook/react-native'
|
||||
needs: [set_release_type]
|
||||
container:
|
||||
image: reactnativecommunity/react-native-android:latest
|
||||
@@ -60,6 +169,10 @@ jobs:
|
||||
needs:
|
||||
[
|
||||
set_release_type,
|
||||
prepare_hermes_workspace,
|
||||
build_hermes_macos,
|
||||
build_hermesc_linux,
|
||||
build_hermesc_windows,
|
||||
build_android,
|
||||
prebuild_apple_dependencies,
|
||||
prebuild_react_native_core,
|
||||
@@ -72,6 +185,7 @@ jobs:
|
||||
# By default we only build ARM64 to save time/resources. For release/nightlies, we override this value to build all archs.
|
||||
ORG_GRADLE_PROJECT_reactNativeArchitectures: "arm64-v8a"
|
||||
env:
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
GHA_NPM_TOKEN: ${{ secrets.GHA_NPM_TOKEN }}
|
||||
ORG_GRADLE_PROJECT_SIGNING_PWD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_PWD }}
|
||||
ORG_GRADLE_PROJECT_SIGNING_KEY: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_KEY }}
|
||||
@@ -83,6 +197,7 @@ jobs:
|
||||
- name: Build and Publish NPM Package
|
||||
uses: ./.github/actions/build-npm-package
|
||||
with:
|
||||
hermes-ws-dir: ${{ env.HERMES_WS_DIR }}
|
||||
release-type: ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
|
||||
gha-npm-token: ${{ env.GHA_NPM_TOKEN }}
|
||||
gradle-cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
|
||||
|
||||
@@ -2,16 +2,11 @@ name: Prebuild iOS Dependencies
|
||||
|
||||
on:
|
||||
workflow_call: # this directive allow us to call this workflow from other workflows
|
||||
inputs:
|
||||
use-hermes-nightly:
|
||||
description: 'Whether to use the hermes nightly build or read the version from the versions.properties file'
|
||||
type: boolean
|
||||
required: false
|
||||
default: false
|
||||
|
||||
|
||||
jobs:
|
||||
build-rn-slice:
|
||||
runs-on: macos-15
|
||||
runs-on: macos-14
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
@@ -28,7 +23,7 @@ jobs:
|
||||
id: restore-ios-slice
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
key: v3-ios-core-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/*.js', 'packages/react-native/scripts/ios-prebuild.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
|
||||
key: v3-ios-core-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/setup.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
|
||||
path: packages/react-native/
|
||||
- name: Setup node.js
|
||||
if: steps.restore-ios-slice.outputs.cache-hit != 'true'
|
||||
@@ -37,20 +32,39 @@ jobs:
|
||||
if: steps.restore-ios-slice.outputs.cache-hit != 'true'
|
||||
uses: ./.github/actions/setup-xcode
|
||||
with:
|
||||
platform: ${{ matrix.slice }}
|
||||
xcode-version: '16.2.0'
|
||||
- name: Yarn Install
|
||||
if: steps.restore-ios-slice.outputs.cache-hit != 'true'
|
||||
uses: ./.github/actions/yarn-install
|
||||
- name: Set Hermes version
|
||||
- name: Download Hermes
|
||||
if: steps.restore-ios-slice.outputs.cache-hit != 'true'
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: hermes-darwin-bin-${{ matrix.flavor }}
|
||||
path: /tmp/hermes/hermes-runtime-darwin
|
||||
- name: Extract Hermes
|
||||
if: steps.restore-ios-slice.outputs.cache-hit != 'true'
|
||||
shell: bash
|
||||
run: |
|
||||
if [ "${{ inputs.use-hermes-nightly }}" == "true" ]; then
|
||||
HERMES_VERSION="nightly"
|
||||
else
|
||||
HERMES_VERSION=$(sed -n 's/^HERMES_VERSION_NAME=//p' packages/react-native/sdks/hermes-engine/version.properties)
|
||||
HERMES_TARBALL_ARTIFACTS_DIR=/tmp/hermes/hermes-runtime-darwin
|
||||
if [ ! -d $HERMES_TARBALL_ARTIFACTS_DIR ]; then
|
||||
echo "Hermes tarball artifacts dir not present ($HERMES_TARBALL_ARTIFACTS_DIR)."
|
||||
exit 0
|
||||
fi
|
||||
echo "Using Hermes version: $HERMES_VERSION"
|
||||
echo "HERMES_VERSION=$HERMES_VERSION" >> $GITHUB_ENV
|
||||
|
||||
TARBALL_FILENAME=$(node ./packages/react-native/scripts/hermes/get-tarball-name.js --buildType "${{ matrix.flavor }}")
|
||||
TARBALL_PATH=$HERMES_TARBALL_ARTIFACTS_DIR/$TARBALL_FILENAME
|
||||
|
||||
echo "Looking for $TARBALL_FILENAME in $HERMES_TARBALL_ARTIFACTS_DIR"
|
||||
echo "$TARBALL_PATH"
|
||||
|
||||
if [ ! -f $TARBALL_PATH ]; then
|
||||
echo "Hermes tarball not present ($TARBALL_PATH). Build Hermes from source."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Found Hermes tarball at $TARBALL_PATH"
|
||||
echo "HERMES_ENGINE_TARBALL_PATH=$TARBALL_PATH" >> $GITHUB_ENV
|
||||
- name: Download ReactNativeDependencies
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
@@ -103,13 +117,13 @@ jobs:
|
||||
uses: actions/cache/save@v4
|
||||
if: ${{ github.ref == 'refs/heads/main' }} # To avoid that the cache explode
|
||||
with:
|
||||
key: v3-ios-core-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/*.js', 'packages/react-native/scripts/ios-prebuild.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
|
||||
key: v3-ios-core-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/setup.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
|
||||
path: |
|
||||
packages/react-native/.build/output/spm/${{ matrix.flavor }}/Build/Products
|
||||
packages/react-native/.build/headers
|
||||
|
||||
compose-xcframework:
|
||||
runs-on: macos-15
|
||||
runs-on: macos-14
|
||||
needs: [build-rn-slice]
|
||||
strategy:
|
||||
fail-fast: false
|
||||
@@ -126,7 +140,7 @@ jobs:
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: packages/react-native/.build/output/xcframeworks
|
||||
key: v2-ios-core-xcframework-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/*.js', 'packages/react-native/scripts/ios-prebuild.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
|
||||
key: v2-ios-core-xcframework-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/setup.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
|
||||
- name: Setup node.js
|
||||
if: steps.restore-ios-xcframework.outputs.cache-hit != 'true'
|
||||
uses: ./.github/actions/setup-node
|
||||
@@ -195,4 +209,4 @@ jobs:
|
||||
path: |
|
||||
packages/react-native/.build/output/xcframeworks/ReactCore${{matrix.flavor}}.xcframework.tar.gz
|
||||
packages/react-native/.build/output/xcframeworks/ReactCore${{matrix.flavor}}.framework.dSYM.tar.gz
|
||||
key: v2-ios-core-xcframework-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/*.js', 'packages/react-native/scripts/ios-prebuild.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
|
||||
key: v2-ios-core-xcframework-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/setup.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
|
||||
|
||||
@@ -7,7 +7,7 @@ on:
|
||||
jobs:
|
||||
prepare_workspace:
|
||||
name: Prepare workspace
|
||||
runs-on: macos-15
|
||||
runs-on: macos-14
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
@@ -18,7 +18,7 @@ jobs:
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: packages/react-native/third-party/
|
||||
key: v3-ios-dependencies-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }}
|
||||
key: v2-ios-dependencies-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }}
|
||||
enableCrossOsArchive: true
|
||||
- name: Yarn Install
|
||||
if: steps.restore-ios-prebuilds.outputs.cache-hit != 'true'
|
||||
@@ -40,13 +40,13 @@ jobs:
|
||||
uses: actions/cache/save@v4
|
||||
if: ${{ github.ref == 'refs/heads/main' }} # To avoid that the cache explode
|
||||
with:
|
||||
key: v3-ios-dependencies-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }}
|
||||
key: v2-ios-dependencies-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }}
|
||||
enableCrossOsArchive: true
|
||||
path: packages/react-native/third-party/
|
||||
|
||||
build-apple-slices:
|
||||
name: Build Apple Slice
|
||||
runs-on: macos-15
|
||||
runs-on: macos-14
|
||||
needs: [prepare_workspace]
|
||||
strategy:
|
||||
fail-fast: false
|
||||
@@ -65,17 +65,16 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Setup xcode
|
||||
uses: ./.github/actions/setup-xcode
|
||||
with:
|
||||
xcode-version: '16.1'
|
||||
- name: Restore slice folder
|
||||
id: restore-slice-folder
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: packages/react-native/third-party/.build/Build/Products
|
||||
key: v3-ios-dependencies-slice-folder-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }}
|
||||
- name: Setup xcode
|
||||
if: steps.restore-slice-folder.outputs.cache-hit != 'true'
|
||||
uses: ./.github/actions/setup-xcode
|
||||
with:
|
||||
platform: ${{ matrix.slice }}
|
||||
key: v2-ios-dependencies-slice-folder-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }}
|
||||
- name: Yarn Install
|
||||
if: steps.restore-slice-folder.outputs.cache-hit != 'true'
|
||||
uses: ./.github/actions/yarn-install
|
||||
@@ -86,8 +85,15 @@ jobs:
|
||||
name: ios-prebuilds-workspace
|
||||
path: packages/react-native/third-party/
|
||||
- name: Print third-party folder structure
|
||||
if: steps.restore-slice-folder.outputs.cache-hit != 'true'
|
||||
run: ls -lR packages/react-native/third-party
|
||||
- name: Install VisionOS
|
||||
if: ${{ steps.restore-slice-folder.outputs.cache-hit != 'true' && (matrix.slice == 'xros' || matrix.slice == 'xros-simulator') }}
|
||||
run: |
|
||||
# https://github.com/actions/runner-images/issues/10559
|
||||
sudo xcodebuild -runFirstLaunch
|
||||
sudo xcrun simctl list
|
||||
sudo xcodebuild -downloadPlatform visionOS
|
||||
sudo xcodebuild -runFirstLaunch
|
||||
- name: Build slice ${{ matrix.slice }} for ${{ matrix.flavor }}
|
||||
if: steps.restore-slice-folder.outputs.cache-hit != 'true'
|
||||
run: node scripts/releases/prepare-ios-prebuilds.js -b -p ${{ matrix.slice }} -r ${{ matrix.flavor }}
|
||||
@@ -101,14 +107,14 @@ jobs:
|
||||
uses: actions/cache/save@v4
|
||||
if: ${{ github.ref == 'refs/heads/main' }} # To avoid that the cache explode
|
||||
with:
|
||||
key: v3-ios-dependencies-slice-folder-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }}
|
||||
key: v2-ios-dependencies-slice-folder-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }}
|
||||
enableCrossOsArchive: true
|
||||
path: |
|
||||
packages/react-native/third-party/.build/Build/Products
|
||||
|
||||
create-xcframework:
|
||||
name: Prepare XCFramework
|
||||
runs-on: macos-15
|
||||
runs-on: macos-14
|
||||
needs: [build-apple-slices]
|
||||
strategy:
|
||||
fail-fast: false
|
||||
@@ -132,7 +138,7 @@ jobs:
|
||||
with:
|
||||
path: |
|
||||
packages/react-native/third-party/
|
||||
key: v3-ios-dependencies-xcframework-${{ matrix.flavor }}-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }}
|
||||
key: v2-ios-dependencies-xcframework-${{ matrix.flavor }}-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }}
|
||||
# If cache hit, we already have our binary. We don't need to do anything.
|
||||
- name: Yarn Install
|
||||
if: steps.restore-xcframework.outputs.cache-hit != 'true'
|
||||
@@ -173,9 +179,8 @@ jobs:
|
||||
- name: Compress and Rename dSYM
|
||||
if: steps.restore-xcframework.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
cd packages/react-native/third-party/Symbols/
|
||||
tar -cz -f ../ReactNativeDependencies${{ matrix.flavor }}.framework.dSYM.tar.gz .
|
||||
mv ../ReactNativeDependencies${{ matrix.flavor }}.framework.dSYM.tar.gz ./ReactNativeDependencies${{ matrix.flavor }}.framework.dSYM.tar.gz
|
||||
tar -cz -f packages/react-native/third-party/Symbols/ReactNativeDependencies${{ matrix.flavor }}.framework.dSYM.tar.gz \
|
||||
packages/react-native/third-party/Symbols/ReactNativeDependencies.framework.dSYM
|
||||
- name: Upload XCFramework Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
@@ -194,4 +199,4 @@ jobs:
|
||||
path: |
|
||||
packages/react-native/third-party/ReactNativeDependencies${{ matrix.flavor }}.xcframework.tar.gz
|
||||
packages/react-native/third-party/ReactNativeDependencies${{ matrix.flavor }}.framework.dSYM.tar.gz
|
||||
key: v3-ios-dependencies-xcframework-${{ matrix.flavor }}-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }}
|
||||
key: v2-ios-dependencies-xcframework-${{ matrix.flavor }}-${{ hashfiles('scripts/releases/ios-prebuild/configuration.js') }}
|
||||
|
||||
@@ -9,7 +9,6 @@ on:
|
||||
jobs:
|
||||
publish_bumped_packages:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'facebook/react-native'
|
||||
env:
|
||||
GHA_NPM_TOKEN: ${{ secrets.GHA_NPM_TOKEN }}
|
||||
steps:
|
||||
|
||||
@@ -19,43 +19,136 @@ jobs:
|
||||
echo "Setting release type to release"
|
||||
echo "RELEASE_TYPE=release" >> $GITHUB_OUTPUT
|
||||
|
||||
set_hermes_versions:
|
||||
prepare_hermes_workspace:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'facebook/react-native'
|
||||
env:
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
HERMES_VERSION_FILE: packages/react-native/sdks/.hermesversion
|
||||
outputs:
|
||||
HERMES_VERSION: ${{ steps.set_hermes_versions.outputs.HERMES_VERSION }}
|
||||
HERMES_V1_VERSION: ${{ steps.set_hermes_versions.outputs.HERMES_V1_VERSION }}
|
||||
react-native-version: ${{ steps.prepare-hermes-workspace.outputs.react-native-version }}
|
||||
hermes-version: ${{ steps.prepare-hermes-workspace.outputs.hermes-version }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- id: set_hermes_versions
|
||||
run: |
|
||||
echo "Setting hermes versions to latest"
|
||||
hermes_version=$(grep -oE 'HERMES_VERSION_NAME=([0-9]+\.[0-9]+\.[0-9]+)' packages/react-native/sdks/hermes-engine/version.properties | cut -d'=' -f2)
|
||||
hermes_v1_version=$(grep -oE 'HERMES_V1_VERSION_NAME=([0-9]+\.[0-9]+\.[0-9]+)' packages/react-native/sdks/hermes-engine/version.properties | cut -d'=' -f2)
|
||||
- name: Prepare Hermes Workspace
|
||||
id: prepare-hermes-workspace
|
||||
uses: ./.github/actions/prepare-hermes-workspace
|
||||
with:
|
||||
hermes-ws-dir: ${{ env.HERMES_WS_DIR }}
|
||||
hermes-version-file: ${{ env.HERMES_VERSION_FILE }}
|
||||
|
||||
echo "HERMES_VERSION=$hermes_version" >> $GITHUB_OUTPUT
|
||||
echo "HERMES_V1_VERSION=$hermes_v1_version" >> $GITHUB_OUTPUT
|
||||
- name: Print hermes versions
|
||||
run: |
|
||||
echo "HERMES_VERSION=${{ steps.set_hermes_versions.outputs.HERMES_VERSION }}"
|
||||
echo "HERMES_V1_VERSION=${{ steps.set_hermes_versions.outputs.HERMES_V1_VERSION }}"
|
||||
build_hermesc_apple:
|
||||
runs-on: macos-14
|
||||
needs: prepare_hermes_workspace
|
||||
env:
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Build HermesC Apple
|
||||
uses: ./.github/actions/build-hermesc-apple
|
||||
with:
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.output.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.output.react-native-version }}
|
||||
build_apple_slices_hermes:
|
||||
runs-on: macos-14
|
||||
needs: [build_hermesc_apple, prepare_hermes_workspace]
|
||||
env:
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
|
||||
HERMES_OSXBIN_ARTIFACTS_DIR: /tmp/hermes/osx-bin
|
||||
IOS_DEPLOYMENT_TARGET: "15.1"
|
||||
XROS_DEPLOYMENT_TARGET: "1.0"
|
||||
MAC_DEPLOYMENT_TARGET: "10.15"
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
flavor: [Debug, Release]
|
||||
slice: [macosx, iphoneos, iphonesimulator, appletvos, appletvsimulator, catalyst, xros, xrsimulator]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Build Slice
|
||||
uses: ./.github/actions/build-apple-slices-hermes
|
||||
with:
|
||||
flavor: ${{ matrix.flavor }}
|
||||
slice: ${{ matrix.slice}}
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
|
||||
build_hermes_macos:
|
||||
runs-on: macos-14
|
||||
needs: [build_apple_slices_hermes, prepare_hermes_workspace]
|
||||
env:
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
|
||||
continue-on-error: true
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
flavor: [Debug, Release]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Build Hermes MacOS
|
||||
uses: ./.github/actions/build-hermes-macos
|
||||
with:
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
flavor: ${{ matrix.flavor }}
|
||||
|
||||
prebuild_apple_dependencies:
|
||||
if: github.repository == 'facebook/react-native'
|
||||
uses: ./.github/workflows/prebuild-ios-dependencies.yml
|
||||
secrets: inherit
|
||||
|
||||
prebuild_react_native_core:
|
||||
uses: ./.github/workflows/prebuild-ios-core.yml
|
||||
secrets: inherit
|
||||
needs: [prebuild_apple_dependencies]
|
||||
needs: [prebuild_apple_dependencies, build_hermes_macos]
|
||||
|
||||
build_hermesc_linux:
|
||||
runs-on: ubuntu-latest
|
||||
needs: prepare_hermes_workspace
|
||||
env:
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Build HermesC Linux
|
||||
uses: ./.github/actions/build-hermesc-linux
|
||||
with:
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
|
||||
build_hermesc_windows:
|
||||
runs-on: windows-2025
|
||||
needs: prepare_hermes_workspace
|
||||
env:
|
||||
HERMES_WS_DIR: 'D:\tmp\hermes'
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: 'D:\tmp\hermes\hermes-runtime-darwin'
|
||||
HERMES_OSXBIN_ARTIFACTS_DIR: 'D:\tmp\hermes\osx-bin'
|
||||
ICU_URL: "https://github.com/unicode-org/icu/releases/download/release-64-2/icu4c-64_2-Win64-MSVC2017.zip"
|
||||
MSBUILD_DIR: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin'
|
||||
CMAKE_DIR: 'C:\Program Files\CMake\bin'
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Build HermesC Windows
|
||||
uses: ./.github/actions/build-hermesc-windows
|
||||
with:
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
|
||||
build_npm_package:
|
||||
runs-on: 8-core-ubuntu
|
||||
needs:
|
||||
[
|
||||
set_release_type,
|
||||
prepare_hermes_workspace,
|
||||
build_hermes_macos,
|
||||
build_hermesc_linux,
|
||||
build_hermesc_windows,
|
||||
prebuild_apple_dependencies,
|
||||
prebuild_react_native_core,
|
||||
]
|
||||
@@ -67,6 +160,7 @@ jobs:
|
||||
# By default we only build ARM64 to save time/resources. For release/nightlies, we override this value to build all archs.
|
||||
ORG_GRADLE_PROJECT_reactNativeArchitectures: "arm64-v8a"
|
||||
env:
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
GHA_NPM_TOKEN: ${{ secrets.GHA_NPM_TOKEN }}
|
||||
ORG_GRADLE_PROJECT_SIGNING_PWD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_PWD }}
|
||||
ORG_GRADLE_PROJECT_SIGNING_KEY: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_KEY }}
|
||||
@@ -82,6 +176,7 @@ jobs:
|
||||
- name: Build and Publish NPM Package
|
||||
uses: ./.github/actions/build-npm-package
|
||||
with:
|
||||
hermes-ws-dir: ${{ env.HERMES_WS_DIR }}
|
||||
release-type: ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
|
||||
gha-npm-token: ${{ env.GHA_NPM_TOKEN }}
|
||||
gradle-cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
|
||||
@@ -139,9 +234,6 @@ jobs:
|
||||
secrets: inherit
|
||||
|
||||
create_draft_release:
|
||||
needs: [generate_changelog, set_hermes_versions]
|
||||
needs: generate_changelog
|
||||
uses: ./.github/workflows/create-draft-release.yml
|
||||
secrets: inherit
|
||||
with:
|
||||
hermesVersion: ${{ needs.set_hermes_versions.outputs.HERMES_VERSION }}
|
||||
hermesV1Version: ${{ needs.set_hermes_versions.outputs.HERMES_V1_VERSION }}
|
||||
|
||||
@@ -9,7 +9,6 @@ on:
|
||||
jobs:
|
||||
rerun:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'facebook/react-native'
|
||||
steps:
|
||||
- name: rerun ${{ inputs.run_id }}
|
||||
env:
|
||||
|
||||
+170
-51
@@ -2,6 +2,11 @@ name: Test All
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
run-e2e-tests:
|
||||
description: Whether to run E2E tests or not
|
||||
type: boolean
|
||||
default: false
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
@@ -11,7 +16,6 @@ on:
|
||||
jobs:
|
||||
set_release_type:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'facebook/react-native'
|
||||
outputs:
|
||||
RELEASE_TYPE: ${{ steps.set_release_type.outputs.RELEASE_TYPE }}
|
||||
env:
|
||||
@@ -33,22 +37,101 @@ jobs:
|
||||
|
||||
echo "Should I run E2E tests? ${{ inputs.run-e2e-tests }}"
|
||||
|
||||
prepare_hermes_workspace:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
HERMES_VERSION_FILE: packages/react-native/sdks/.hermesversion
|
||||
outputs:
|
||||
react-native-version: ${{ steps.prepare-hermes-workspace.outputs.react-native-version }}
|
||||
hermes-version: ${{ steps.prepare-hermes-workspace.outputs.hermes-version }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Prepare Hermes Workspace
|
||||
id: prepare-hermes-workspace
|
||||
uses: ./.github/actions/prepare-hermes-workspace
|
||||
with:
|
||||
hermes-ws-dir: ${{ env.HERMES_WS_DIR }}
|
||||
hermes-version-file: ${{ env.HERMES_VERSION_FILE }}
|
||||
|
||||
build_hermesc_apple:
|
||||
runs-on: macos-14
|
||||
needs: prepare_hermes_workspace
|
||||
env:
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Build HermesC Apple
|
||||
uses: ./.github/actions/build-hermesc-apple
|
||||
with:
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
|
||||
build_apple_slices_hermes:
|
||||
runs-on: macos-14
|
||||
needs: [build_hermesc_apple, prepare_hermes_workspace]
|
||||
env:
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
|
||||
HERMES_OSXBIN_ARTIFACTS_DIR: /tmp/hermes/osx-bin
|
||||
IOS_DEPLOYMENT_TARGET: "15.1"
|
||||
XROS_DEPLOYMENT_TARGET: "1.0"
|
||||
MAC_DEPLOYMENT_TARGET: "10.15"
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
flavor: [Debug, Release]
|
||||
slice: [macosx, iphoneos, iphonesimulator, appletvos, appletvsimulator, catalyst, xros, xrsimulator]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Build Slice
|
||||
uses: ./.github/actions/build-apple-slices-hermes
|
||||
with:
|
||||
flavor: ${{ matrix.flavor }}
|
||||
slice: ${{ matrix.slice}}
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
|
||||
build_hermes_macos:
|
||||
runs-on: macos-14
|
||||
needs: [build_apple_slices_hermes, prepare_hermes_workspace]
|
||||
env:
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
|
||||
continue-on-error: true
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
flavor: [Debug, Release]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Build Hermes MacOS
|
||||
uses: ./.github/actions/build-hermes-macos
|
||||
with:
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
flavor: ${{ matrix.flavor }}
|
||||
|
||||
prebuild_apple_dependencies:
|
||||
if: github.repository == 'facebook/react-native'
|
||||
uses: ./.github/workflows/prebuild-ios-dependencies.yml
|
||||
secrets: inherit
|
||||
|
||||
prebuild_react_native_core:
|
||||
uses: ./.github/workflows/prebuild-ios-core.yml
|
||||
with:
|
||||
use-hermes-nightly: ${{ !endsWith(github.ref_name, '-stable') }}
|
||||
secrets: inherit
|
||||
needs: [prebuild_apple_dependencies]
|
||||
needs: [prebuild_apple_dependencies, build_hermes_macos]
|
||||
|
||||
test_ios_rntester_ruby_3_2_0:
|
||||
runs-on: macos-15
|
||||
runs-on: macos-14
|
||||
needs:
|
||||
[prebuild_apple_dependencies, prebuild_react_native_core]
|
||||
[build_apple_slices_hermes, prepare_hermes_workspace, build_hermes_macos, prebuild_apple_dependencies, prebuild_react_native_core]
|
||||
env:
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
@@ -56,12 +139,17 @@ jobs:
|
||||
uses: ./.github/actions/test-ios-rntester
|
||||
with:
|
||||
ruby-version: "3.2.0"
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
flavor: Debug
|
||||
|
||||
test_ios_rntester:
|
||||
runs-on: macos-15-large
|
||||
runs-on: macos-14-large
|
||||
needs:
|
||||
[prebuild_apple_dependencies, prebuild_react_native_core]
|
||||
[build_apple_slices_hermes, prepare_hermes_workspace, build_hermes_macos, prebuild_apple_dependencies, prebuild_react_native_core]
|
||||
env:
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
|
||||
continue-on-error: true
|
||||
strategy:
|
||||
fail-fast: false
|
||||
@@ -75,12 +163,18 @@ jobs:
|
||||
uses: ./.github/actions/test-ios-rntester
|
||||
with:
|
||||
use-frameworks: ${{ matrix.frameworks }}
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
flavor: ${{ matrix.flavor }}
|
||||
|
||||
test_e2e_ios_rntester:
|
||||
runs-on: macos-15-large
|
||||
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') || inputs.run-e2e-tests }}
|
||||
runs-on: macos-14-large
|
||||
needs:
|
||||
[test_ios_rntester]
|
||||
env:
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
@@ -99,8 +193,6 @@ jobs:
|
||||
run: ls -lR /tmp/RNTesterBuild
|
||||
- name: Setup xcode
|
||||
uses: ./.github/actions/setup-xcode
|
||||
with:
|
||||
platform: ios
|
||||
- name: Run E2E Tests
|
||||
uses: ./.github/actions/maestro-ios
|
||||
with:
|
||||
@@ -110,8 +202,12 @@ jobs:
|
||||
flavor: ${{ matrix.flavor }}
|
||||
|
||||
test_e2e_ios_templateapp:
|
||||
runs-on: macos-15-large
|
||||
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') || inputs.run-e2e-tests }}
|
||||
runs-on: macos-14-large
|
||||
needs: [build_npm_package, prebuild_apple_dependencies]
|
||||
env:
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
@@ -121,8 +217,6 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup xcode
|
||||
uses: ./.github/actions/setup-xcode
|
||||
with:
|
||||
platform: ios
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Run yarn
|
||||
@@ -131,6 +225,11 @@ jobs:
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: 2.6.10
|
||||
- name: Download Hermes
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: hermes-darwin-bin-${{matrix.flavor}}
|
||||
path: /tmp/react-native-tmp
|
||||
- name: Download React Native Package
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
@@ -154,16 +253,14 @@ jobs:
|
||||
- name: Print ReactCore folder
|
||||
shell: bash
|
||||
run: ls -lR /tmp/ReactCore
|
||||
- name: Configure git
|
||||
shell: bash
|
||||
run: |
|
||||
git config --global user.email "react-native-bot@meta.com"
|
||||
git config --global user.name "React Native Bot"
|
||||
- name: Prepare artifacts
|
||||
run: |
|
||||
REACT_NATIVE_PKG=$(find /tmp/react-native-tmp -type f -name "*.tgz")
|
||||
echo "React Native tgs is $REACT_NATIVE_PKG"
|
||||
|
||||
HERMES_PATH=$(find /tmp/react-native-tmp -type f -name "*.tar.gz")
|
||||
echo "Hermes path is $HERMES_PATH"
|
||||
|
||||
# For stable branches, we want to use the stable branch of the template
|
||||
# In all the other cases, we want to use "main"
|
||||
BRANCH=${{ github.ref_name }}
|
||||
@@ -178,9 +275,8 @@ jobs:
|
||||
NEW_ARCH_ENABLED=1
|
||||
|
||||
export RCT_USE_LOCAL_RN_DEP=/tmp/third-party/ReactNativeDependencies${{ matrix.flavor }}.xcframework.tar.gz
|
||||
# Disable prebuilds for now, as they are causing issues with E2E tests for 0.82-stable branch
|
||||
# export RCT_TESTONLY_RNCORE_TARBALL_PATH="/tmp/ReactCore/ReactCore${{ matrix.flavor }}.xcframework.tar.gz"
|
||||
RCT_NEW_ARCH_ENABLED=$NEW_ARCH_ENABLED bundle exec pod install
|
||||
export RCT_TESTONLY_RNCORE_TARBALL_PATH="/tmp/ReactCore/ReactCore${{ matrix.flavor }}.xcframework.tar.gz"
|
||||
HERMES_ENGINE_TARBALL_PATH=$HERMES_PATH RCT_NEW_ARCH_ENABLED=$NEW_ARCH_ENABLED bundle exec pod install
|
||||
|
||||
xcodebuild \
|
||||
-scheme "RNTestProject" \
|
||||
@@ -199,6 +295,7 @@ jobs:
|
||||
working-directory: /tmp/RNTestProject
|
||||
|
||||
test_e2e_android_templateapp:
|
||||
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') || inputs.run-e2e-tests }}
|
||||
runs-on: 4-core-ubuntu
|
||||
needs: build_npm_package
|
||||
strategy:
|
||||
@@ -266,24 +363,39 @@ jobs:
|
||||
flavor: ${{ matrix.flavor }}
|
||||
working-directory: /tmp/RNTestProject
|
||||
|
||||
run_fantom_tests:
|
||||
runs-on: 8-core-ubuntu
|
||||
needs: [set_release_type]
|
||||
container:
|
||||
image: reactnativecommunity/react-native-android:latest
|
||||
env:
|
||||
TERM: "dumb"
|
||||
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
|
||||
ORG_GRADLE_PROJECT_SIGNING_PWD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_PWD }}
|
||||
ORG_GRADLE_PROJECT_SIGNING_KEY: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_KEY }}
|
||||
build_hermesc_linux:
|
||||
runs-on: ubuntu-latest
|
||||
needs: prepare_hermes_workspace
|
||||
env:
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Build and Test Fantom
|
||||
uses: ./.github/actions/run-fantom-tests
|
||||
- name: Build HermesC Linux
|
||||
uses: ./.github/actions/build-hermesc-linux
|
||||
with:
|
||||
release-type: ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
|
||||
gradle-cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
|
||||
build_hermesc_windows:
|
||||
runs-on: windows-2025
|
||||
needs: prepare_hermes_workspace
|
||||
env:
|
||||
HERMES_WS_DIR: 'D:\tmp\hermes'
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: 'D:\tmp\hermes\hermes-runtime-darwin'
|
||||
HERMES_OSXBIN_ARTIFACTS_DIR: 'D:\tmp\hermes\osx-bin'
|
||||
ICU_URL: "https://github.com/unicode-org/icu/releases/download/release-64-2/icu4c-64_2-Win64-MSVC2017.zip"
|
||||
MSBUILD_DIR: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin'
|
||||
CMAKE_DIR: 'C:\Program Files\CMake\bin'
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Build HermesC Windows
|
||||
uses: ./.github/actions/build-hermesc-windows
|
||||
with:
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
|
||||
build_android:
|
||||
runs-on: 8-core-ubuntu
|
||||
@@ -302,9 +414,11 @@ jobs:
|
||||
uses: ./.github/actions/build-android
|
||||
with:
|
||||
release-type: ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
|
||||
run-e2e-tests: ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') || inputs.run-e2e-tests }}
|
||||
gradle-cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
|
||||
|
||||
test_e2e_android_rntester:
|
||||
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, 'stable') || inputs.run-e2e-tests }}
|
||||
runs-on: 4-core-ubuntu
|
||||
needs: [build_android]
|
||||
strategy:
|
||||
@@ -339,6 +453,10 @@ jobs:
|
||||
needs:
|
||||
[
|
||||
set_release_type,
|
||||
prepare_hermes_workspace,
|
||||
build_hermes_macos,
|
||||
build_hermesc_linux,
|
||||
build_hermesc_windows,
|
||||
build_android,
|
||||
prebuild_apple_dependencies,
|
||||
prebuild_react_native_core,
|
||||
@@ -348,12 +466,15 @@ jobs:
|
||||
env:
|
||||
TERM: "dumb"
|
||||
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
|
||||
env:
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Build NPM Package
|
||||
uses: ./.github/actions/build-npm-package
|
||||
with:
|
||||
hermes-ws-dir: ${{ env.HERMES_WS_DIR }}
|
||||
release-type: ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
|
||||
gradle-cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
|
||||
|
||||
@@ -396,12 +517,6 @@ jobs:
|
||||
cache-encryption-key: ${{ secrets.GRADLE_CACHE_ENCRYPTION_KEY }}
|
||||
- name: Run yarn install
|
||||
uses: ./.github/actions/yarn-install
|
||||
- name: Set nightly Hermes versions
|
||||
shell: bash
|
||||
run: |
|
||||
node ./scripts/releases/use-hermes-nightly.js
|
||||
- name: Run yarn install again, with the correct hermes version
|
||||
uses: ./.github/actions/yarn-install
|
||||
- name: Prepare the Helloworld application
|
||||
shell: bash
|
||||
run: node ./scripts/e2e/init-project-e2e.js --useHelloWorld --pathToLocalReactNative "$GITHUB_WORKSPACE/build/$(cat build/react-native-package-version)"
|
||||
@@ -422,10 +537,11 @@ jobs:
|
||||
compression-level: 0
|
||||
|
||||
test_ios_helloworld_with_ruby_3_2_0:
|
||||
runs-on: macos-15
|
||||
needs: [prebuild_apple_dependencies, prebuild_react_native_core]
|
||||
runs-on: macos-14
|
||||
needs: [prepare_hermes_workspace, build_hermes_macos, prebuild_apple_dependencies, prebuild_react_native_core] # prepare_hermes_workspace must be there because we need its reference to retrieve a couple of outputs
|
||||
env:
|
||||
PROJECT_NAME: iOSTemplateProject
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
YARN_ENABLE_IMMUTABLE_INSTALLS: false
|
||||
steps:
|
||||
- name: Checkout
|
||||
@@ -434,10 +550,12 @@ jobs:
|
||||
with:
|
||||
ruby-version: 3.2.0
|
||||
flavor: Debug
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
|
||||
test_ios_helloworld:
|
||||
runs-on: macos-15
|
||||
needs: [prebuild_apple_dependencies, prebuild_react_native_core]
|
||||
runs-on: macos-14
|
||||
needs: [prepare_hermes_workspace, build_hermes_macos, prebuild_apple_dependencies, prebuild_react_native_core] # prepare_hermes_workspace must be there because we need its reference to retrieve a couple of outputs
|
||||
strategy:
|
||||
matrix:
|
||||
flavor: [Debug, Release]
|
||||
@@ -448,6 +566,7 @@ jobs:
|
||||
use_frameworks: StaticLibraries
|
||||
env:
|
||||
PROJECT_NAME: iOSTemplateProject
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
YARN_ENABLE_IMMUTABLE_INSTALLS: false
|
||||
steps:
|
||||
- name: Checkout
|
||||
@@ -456,14 +575,15 @@ jobs:
|
||||
with:
|
||||
flavor: ${{ matrix.flavor }}
|
||||
use-frameworks: ${{ matrix.use_frameworks }}
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
|
||||
test_js:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'facebook/react-native'
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node-version: ["24.4.1", "22", "20.19.4"]
|
||||
node-version: ["24", "22"]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
@@ -474,7 +594,6 @@ jobs:
|
||||
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'facebook/react-native'
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
steps:
|
||||
@@ -497,7 +616,7 @@ jobs:
|
||||
rerun-failed-jobs:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [test_e2e_ios_rntester, test_e2e_android_rntester, test_e2e_ios_templateapp, test_e2e_android_templateapp]
|
||||
if: ${{ github.ref == 'refs/heads/main' && always() }}
|
||||
if: always()
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
name: Test Libraries on Nightlies
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
secrets:
|
||||
discord_webhook_url:
|
||||
required: true
|
||||
|
||||
|
||||
# We use the matrix.library entry to specify the dependency we want to use
|
||||
# The key is used directly as the <pkg> in the `yarn add <pkg>` command.
|
||||
jobs:
|
||||
runner-setup:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
runners: '{"ios":"macos-14-large", "android": "ubuntu-latest"}'
|
||||
steps:
|
||||
- run: echo no-op
|
||||
|
||||
test-library-on-nightly:
|
||||
name: "[${{ matrix.platform }}] ${{ matrix.library }}"
|
||||
needs: runner-setup
|
||||
runs-on: ${{ fromJSON(needs.runner-setup.outputs.runners)[matrix.platform] }}
|
||||
continue-on-error: true
|
||||
strategy:
|
||||
matrix:
|
||||
library: [
|
||||
"react-native-async-storage",
|
||||
"react-native-blob-util",
|
||||
"@react-native-clipboard/clipboard",
|
||||
"@react-native-community/datetimepicker",
|
||||
"react-native-gesture-handler",
|
||||
"react-native-image-picker",
|
||||
"react-native-linear-gradient",
|
||||
"@react-native-masked-view/masked-view",
|
||||
# "react-native-maps", React Native Maps with the New Arch support has a complex cocoapods setup for iOS. It needs a dedicated workflow.
|
||||
"@react-native-community/netinfo",
|
||||
"react-native-reanimated@nightly react-native-worklets@nightly", #reanimated requires worklet to be explicitly installed as a separate package
|
||||
"react-native-svg",
|
||||
"react-native-video",
|
||||
"react-native-webview",
|
||||
"react-native-mmkv",
|
||||
"react-native-screens",
|
||||
"react-native-pager-view",
|
||||
"@react-native-community/slider",
|
||||
# additional OSS libs used internally
|
||||
"scandit-react-native-datacapture-barcode scandit-react-native-datacapture-core",
|
||||
"react-native-contacts",
|
||||
"react-native-device-info",
|
||||
"react-native-email-link",
|
||||
"@dr.pogodin/react-native-fs",
|
||||
"react-native-permissions",
|
||||
"react-native-vector-icons",
|
||||
"react-native-masked-view",
|
||||
"@react-native-community/image-editor",
|
||||
]
|
||||
platform: [ios, android]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Set up Node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Test ${{ matrix.library }}
|
||||
id: run-test
|
||||
uses: ./.github/actions/test-library-on-nightly
|
||||
with:
|
||||
library-npm-package: ${{ matrix.library }}
|
||||
platform: ${{ matrix.platform}}
|
||||
- name: Save outcome
|
||||
id: save-outcome
|
||||
if: always()
|
||||
run: |
|
||||
LIB_FOLDER=$(echo "${{matrix.library}}" | tr ' ' '_' | tr '/' '_')
|
||||
echo "${{matrix.library}}: ${{steps.run-test.outcome}}" > "/tmp/$LIB_FOLDER-${{ matrix.platform }}-outcome"
|
||||
echo "lib_folder=$LIB_FOLDER" >> $GITHUB_OUTPUT
|
||||
- name: Upload Artifact
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ steps.save-outcome.outputs.lib_folder }}-${{ matrix.platform }}-outcome
|
||||
path: /tmp/${{ steps.save-outcome.outputs.lib_folder }}-${{ matrix.platform }}-outcome
|
||||
|
||||
|
||||
collect-results:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [test-library-on-nightly]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Restore outcomes
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
pattern: '*-outcome'
|
||||
path: /tmp
|
||||
- name: Collect failures
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: |
|
||||
const {collectResults} = require('./.github/workflow-scripts/collectNightlyOutcomes.js');
|
||||
await collectResults('${{secrets.discord_webhook_url}}');
|
||||
@@ -1,49 +0,0 @@
|
||||
name: Validate DotSlash Artifacts
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
release:
|
||||
types: [published]
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- packages/debugger-shell/bin/react-native-devtools
|
||||
- "scripts/releases/**"
|
||||
- package.json
|
||||
- yarn.lock
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- packages/debugger-shell/bin/react-native-devtools
|
||||
- "scripts/releases/**"
|
||||
- package.json
|
||||
- yarn.lock
|
||||
# Same time as the nightly build: 2:15 AM UTC
|
||||
schedule:
|
||||
- cron: "15 2 * * *"
|
||||
|
||||
jobs:
|
||||
validate-dotslash-artifacts:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'facebook/react-native'
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
fetch-tags: true
|
||||
- name: Install dependencies
|
||||
uses: ./.github/actions/yarn-install
|
||||
- name: Configure Git
|
||||
shell: bash
|
||||
run: |
|
||||
git config --local user.email "bot@reactnative.dev"
|
||||
git config --local user.name "React Native Bot"
|
||||
- name: Validate DotSlash artifacts
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: |
|
||||
const {validateDotSlashArtifacts} = require('./scripts/releases/validate-dotslash-artifacts.js');
|
||||
await validateDotSlashArtifacts();
|
||||
+1
-2
@@ -43,6 +43,7 @@ project.xcworkspace
|
||||
/private/helloworld/android/app/build/
|
||||
/private/helloworld/android/build/
|
||||
/packages/react-native-popup-menu-android/android/build/
|
||||
/packages/react-native-test-library/android/build/
|
||||
|
||||
# Buck
|
||||
.buckd
|
||||
@@ -133,7 +134,6 @@ vendor/
|
||||
# Swift Package build folder
|
||||
/packages/react-native/.build
|
||||
/packages/react-native/.swiftpm
|
||||
/packages/react-native/React/includes/
|
||||
|
||||
# @react-native/codegen
|
||||
/packages/react-native/React/FBReactNativeSpec/
|
||||
@@ -171,7 +171,6 @@ fix_*.patch
|
||||
|
||||
# Jest Integration
|
||||
/private/react-native-fantom/build/
|
||||
/private/react-native-fantom/.out/
|
||||
/private/react-native-fantom/tester/build/
|
||||
|
||||
# [Experimental] Generated TS type definitions
|
||||
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"arrowParens": "avoid",
|
||||
"bracketSameLine": true,
|
||||
"bracketSpacing": false,
|
||||
"requirePragma": true,
|
||||
"singleQuote": true,
|
||||
"trailingComma": "all",
|
||||
"endOfLine": "lf",
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["*.code-workspace"],
|
||||
"options": {
|
||||
"parser": "json"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": [
|
||||
"*.js",
|
||||
"*.js.flow"
|
||||
],
|
||||
"options": {
|
||||
"parser": "hermes"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": [
|
||||
"**/__docs__/*.md"
|
||||
],
|
||||
"options": {
|
||||
"parser": "markdown",
|
||||
"proseWrap": "always",
|
||||
"requirePragma": false
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
let plugins = ['prettier-plugin-hermes-parser'];
|
||||
try {
|
||||
plugins = require('./.prettier-plugins.fb.js');
|
||||
} catch {}
|
||||
|
||||
module.exports = {
|
||||
arrowParens: 'avoid',
|
||||
bracketSameLine: true,
|
||||
bracketSpacing: false,
|
||||
requirePragma: true,
|
||||
singleQuote: true,
|
||||
trailingComma: 'all',
|
||||
endOfLine: 'lf',
|
||||
plugins,
|
||||
overrides: [
|
||||
{
|
||||
files: ['*.code-workspace'],
|
||||
options: {
|
||||
parser: 'json',
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['*.js', '*.js.flow'],
|
||||
options: {
|
||||
parser: 'hermes',
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['**/__docs__/*.md'],
|
||||
options: {
|
||||
parser: 'markdown',
|
||||
proseWrap: 'always',
|
||||
requirePragma: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -1,36 +1,5 @@
|
||||
# Changelog (pre 0.80)
|
||||
|
||||
## v0.79.7
|
||||
|
||||
### Fixed
|
||||
|
||||
#### Android specific
|
||||
|
||||
- **Layout:** Make missing parent view state in updateLayout a soft error ([56ad8d9bfd](https://github.com/facebook/react-native/commit/56ad8d9bfd08ea70bc6f5726a2b4a6afb6d2d7c2) by [@javache](https://github.com/javache))
|
||||
- **Layout:** Make missing parent view state in updateLayout a soft error ([f2e47d8dab](https://github.com/facebook/react-native/commit/f2e47d8dabcd61621ea81c86cd1e2488948c4229) by [@cipolleschi](https://github.com/cipolleschi))
|
||||
|
||||
## v0.79.6
|
||||
|
||||
### Added
|
||||
|
||||
#### Android specific
|
||||
|
||||
- **RNGP** Add support for `exclusiveEnterpriseRepository` ([df5ac988ce](https://github.com/facebook/react-native/commit/df5ac988cec936c430d41b0fcc15181dc06e46a1) by [@cortinico](https://github.com/cortinico))
|
||||
|
||||
#### iOS specific
|
||||
|
||||
- **Cocoapods:** Add the ENTERPRISE_REPOSITORY env var to let user consume artifacts from their personal maven mirror ([a74d930c93](https://github.com/facebook/react-native/commit/a74d930c93ffae8c02142e8cc016a4c390a5f784) by [@cipolleschi](https://github.com/cipolleschi))
|
||||
|
||||
### Fixed
|
||||
|
||||
- **Codegen:** Add missing Babel dependencies ([bf2c3af93b](https://github.com/facebook/react-native/commit/bf2c3af93b146943cb35866fa9badcd188e63f5b) by [@tido64](https://github.com/tido64))
|
||||
|
||||
#### Android specific
|
||||
|
||||
- **Legacy Arch:** Fix Legacy arch crashing or freezing upon reload ([db600b2e9e](https://github.com/facebook/react-native/commit/db600b2e9e87863cad6dd5ce262dc1f793bcaeb0) by [@robhogan](https://github.com/robhogan))
|
||||
- **Modal:** Fix Modal first frame being rendered on top-left corner ([5a315f8d6b](https://github.com/facebook/react-native/commit/5a315f8d6b0ea54442c7ef94b7346b0c73fd0b4c) by [@cortinico](https://github.com/cortinico))
|
||||
- **TurboModule:** Fix emitting event from turbo module crashes on 32bit android ([43bc43e5e8](https://github.com/facebook/react-native/commit/43bc43e5e85519d2924c4fc80765e66d0c48b1a9) by [@vladimirivanoviliev](https://github.com/vladimirivanoviliev))
|
||||
|
||||
## v0.79.5
|
||||
|
||||
### Fixed
|
||||
@@ -553,37 +522,6 @@ ChuiHW))
|
||||
- **Style:** Fixed `centerContent` losing taps and causing jitter ([fe7e97a2fd](https://github.com/facebook/react-native/commit/fe7e97a2fd272db0d9d9aa7d0561337a7c8e2c30) by [@gaearon](https://github.com/gaearon))
|
||||
- **Xcode:** Properly escape paths in Xcode build script used when bundling an app. ([2fee13094b](https://github.com/facebook/react-native/commit/2fee13094b3d384c071978776fd8b7cff0b6530f) by [@kraenhansen](https://github.com/kraenhansen))
|
||||
|
||||
# Changelog
|
||||
## v0.77.3
|
||||
|
||||
### Added
|
||||
|
||||
#### Android specific
|
||||
|
||||
- **Gradle**: RNGP - Add support for `exclusiveEnterpriseRepository` to specify an internal Maven mirror. ([6cb8dc37c7](https://github.com/facebook/react-native/commit/6cb8dc37c74995cba3f9f0a845919f305de53c3d) by [@cortinico](https://github.com/cortinico))
|
||||
|
||||
### Changed
|
||||
|
||||
- **Metro**: Bump Metro minimum version from `^0.81.3` to `^0.81.5`. ([dfa81638dd](https://github.com/facebook/react-native/commit/dfa81638dd17e46f70f10b25c4f4fd9f370a4b0e) by [@robhogan](https://github.com/robhogan))
|
||||
|
||||
### Fixed
|
||||
|
||||
- **Timers**: Align timer IDs and timer function argument error handling with web standards. ([480a4642e5](https://github.com/facebook/react-native/commit/480a4642e5a644becf1c477d3d239f9b57efff3a) by [@kitten](https://github.com/kitten))
|
||||
|
||||
#### Android specific
|
||||
|
||||
- **Modal**: Fix Modal first frame being rendered on top-left corner. ([b950fa2afb](https://github.com/facebook/react-native/commit/b950fa2afb20e2213ff6c733cb1c2465b90406ef) by [@cortinico](https://github.com/cortinico))
|
||||
- **layout**: Fix wrong `borderBottomEndRadius` on RTL. ([68d6ada448](https://github.com/facebook/react-native/commit/68d6ada44893701b6006a6b1753131c7e880a30a) by [@riteshshukla04](https://github.com/riteshshukla04))
|
||||
- **Modal**: Fix `FLAG_SECURE` not respected in Modal dialog. ([7e029b0dcf](https://github.com/facebook/react-native/commit/7e029b0dcf6d1a6455a8a6343457b70e353d0ff6) by [@mateoguzmana](https://github.com/mateoguzmana))
|
||||
- **lifecylcle**: Legacy arch: fix #50274, Fast Refresh sometimes breaks after full refresh. ([c43952ac22](https://github.com/facebook/react-native/commit/c43952ac22b2356be3130c906329f61e246082cb) by [@robhogan](https://github.com/robhogan))
|
||||
|
||||
#### iOS specific
|
||||
|
||||
- **Interop Layer**: Fixed adding child views to a native view using the interop layer. ([d53a60dd23](https://github.com/facebook/react-native/commit/d53a60dd23c5df8afca058a867c50df8b61f62e2) by [@chrfalch](https://github.com/chrfalch))
|
||||
- **Debugger**: Restore "Paused in debugger" overlay icon. ([f30c46efbd](https://github.com/facebook/react-native/commit/f30c46efbd964d367f678181589865a3faa931cd) by [@robhogan](https://github.com/robhogan))
|
||||
- **layout**: Layout direction changes are now honored on bundle reload. ([36f29beac4](https://github.com/facebook/react-native/commit/36f29beac47259768612bf56e5d9acfa4b94ab1a) by [@chrsmys](https://github.com/chrsmys))
|
||||
- **file reads**: Fix crash caused by `[RCTFileRequestHanlder invalidate]`. ([789ed7d5ad](https://github.com/facebook/react-native/commit/789ed7d5ad75ad4c20ecd1eb19d1fc18275fc500) by [@zhouzh1](https://github.com/zhouzh1))
|
||||
|
||||
## v0.77.2
|
||||
|
||||
### Added
|
||||
|
||||
+289
-520
File diff suppressed because it is too large
Load Diff
@@ -17,13 +17,10 @@
|
||||
<img src="https://img.shields.io/npm/v/react-native?color=brightgreen&label=npm%20package" alt="Current npm package version." />
|
||||
</a>
|
||||
<a href="https://reactnative.dev/docs/contributing">
|
||||
<img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs are welcome!" />
|
||||
<img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs welcome!" />
|
||||
</a>
|
||||
<a href="https://twitter.com/intent/follow?screen_name=reactnative">
|
||||
<img src="https://img.shields.io/twitter/follow/reactnative.svg?label=Follow%20@reactnative" alt="Follow @reactnative on X" />
|
||||
</a>
|
||||
<a href="https://bsky.app/profile/reactnative.dev">
|
||||
<img src="https://img.shields.io/badge/Bluesky-0285FF?logo=bluesky&logoColor=fff" alt="Follow @reactnative.dev on Bluesky" />
|
||||
<img src="https://img.shields.io/twitter/follow/reactnative.svg?label=Follow%20@reactnative" alt="Follow @reactnative" />
|
||||
</a>
|
||||
</p>
|
||||
|
||||
|
||||
+14
-61
@@ -13,7 +13,6 @@ plugins {
|
||||
alias(libs.plugins.kotlin.android) apply false
|
||||
alias(libs.plugins.binary.compatibility.validator) apply true
|
||||
alias(libs.plugins.android.test) apply false
|
||||
alias(libs.plugins.ktfmt) apply true
|
||||
}
|
||||
|
||||
val reactAndroidProperties = java.util.Properties()
|
||||
@@ -26,12 +25,10 @@ fun getListReactAndroidProperty(name: String) = reactAndroidProperties.getProper
|
||||
|
||||
apiValidation {
|
||||
ignoredPackages.addAll(
|
||||
getListReactAndroidProperty("binaryCompatibilityValidator.ignoredPackages")
|
||||
)
|
||||
getListReactAndroidProperty("binaryCompatibilityValidator.ignoredPackages"))
|
||||
ignoredClasses.addAll(getListReactAndroidProperty("binaryCompatibilityValidator.ignoredClasses"))
|
||||
nonPublicMarkers.addAll(
|
||||
getListReactAndroidProperty("binaryCompatibilityValidator.nonPublicMarkers")
|
||||
)
|
||||
getListReactAndroidProperty("binaryCompatibilityValidator.nonPublicMarkers"))
|
||||
validationDisabled =
|
||||
reactAndroidProperties
|
||||
.getProperty("binaryCompatibilityValidator.validationDisabled")
|
||||
@@ -39,9 +36,8 @@ apiValidation {
|
||||
}
|
||||
|
||||
version =
|
||||
if (
|
||||
project.hasProperty("isSnapshot") && (project.property("isSnapshot") as? String).toBoolean()
|
||||
) {
|
||||
if (project.hasProperty("isSnapshot") &&
|
||||
(project.property("isSnapshot") as? String).toBoolean()) {
|
||||
"${reactAndroidProperties.getProperty("VERSION_NAME")}-SNAPSHOT"
|
||||
} else {
|
||||
reactAndroidProperties.getProperty("VERSION_NAME")
|
||||
@@ -69,10 +65,8 @@ tasks.register("clean", Delete::class.java) {
|
||||
description = "Remove all the build files and intermediate build outputs"
|
||||
dependsOn(gradle.includedBuild("gradle-plugin").task(":clean"))
|
||||
subprojects.forEach {
|
||||
if (
|
||||
it.project.plugins.hasPlugin("com.android.library") ||
|
||||
it.project.plugins.hasPlugin("com.android.application")
|
||||
) {
|
||||
if (it.project.plugins.hasPlugin("com.android.library") ||
|
||||
it.project.plugins.hasPlugin("com.android.application")) {
|
||||
dependsOn(it.tasks.named("clean"))
|
||||
}
|
||||
}
|
||||
@@ -82,13 +76,10 @@ tasks.register("clean", Delete::class.java) {
|
||||
delete(rootProject.file("./packages/react-native/sdks/download/"))
|
||||
delete(rootProject.file("./packages/react-native/sdks/hermes/"))
|
||||
delete(
|
||||
rootProject.file("./packages/react-native/ReactAndroid/src/main/jni/prebuilt/lib/arm64-v8a/")
|
||||
)
|
||||
rootProject.file("./packages/react-native/ReactAndroid/src/main/jni/prebuilt/lib/arm64-v8a/"))
|
||||
delete(
|
||||
rootProject.file(
|
||||
"./packages/react-native/ReactAndroid/src/main/jni/prebuilt/lib/armeabi-v7a/"
|
||||
)
|
||||
)
|
||||
"./packages/react-native/ReactAndroid/src/main/jni/prebuilt/lib/armeabi-v7a/"))
|
||||
delete(rootProject.file("./packages/react-native/ReactAndroid/src/main/jni/prebuilt/lib/x86/"))
|
||||
delete(rootProject.file("./packages/react-native/ReactAndroid/src/main/jni/prebuilt/lib/x86_64/"))
|
||||
delete(rootProject.file("./packages/react-native-codegen/lib"))
|
||||
@@ -104,6 +95,9 @@ tasks.register("build") {
|
||||
tasks.register("publishAllToMavenTempLocal") {
|
||||
description = "Publish all the artifacts to be available inside a Maven Local repository on /tmp."
|
||||
dependsOn(":packages:react-native:ReactAndroid:publishAllPublicationsToMavenTempLocalRepository")
|
||||
// We don't publish the external-artifacts to Maven Local as ci is using it via workspace.
|
||||
dependsOn(
|
||||
":packages:react-native:ReactAndroid:hermes-engine:publishAllPublicationsToMavenTempLocalRepository")
|
||||
}
|
||||
|
||||
tasks.register("publishAndroidToSonatype") {
|
||||
@@ -124,56 +118,15 @@ if (project.findProperty("react.internal.useHermesNightly")?.toString()?.toBoole
|
||||
|
||||
That's fine for local development, but you should not commit this change.
|
||||
********************************************************************************
|
||||
"""
|
||||
.trimIndent()
|
||||
)
|
||||
"""
|
||||
.trimIndent())
|
||||
allprojects {
|
||||
configurations.all {
|
||||
resolutionStrategy.dependencySubstitution {
|
||||
substitute(project(":packages:react-native:ReactAndroid:hermes-engine"))
|
||||
.using(module("com.facebook.hermes:hermes-android:0.+"))
|
||||
.using(module("com.facebook.react:hermes-android:0.+"))
|
||||
.because("Users opted to use hermes from nightly")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ktfmt {
|
||||
blockIndent.set(2)
|
||||
continuationIndent.set(4)
|
||||
maxWidth.set(100)
|
||||
removeUnusedImports.set(false)
|
||||
manageTrailingCommas.set(false)
|
||||
}
|
||||
|
||||
// Configure ktfmt tasks to include gradle-plugin
|
||||
listOf("ktfmtCheck", "ktfmtFormat").forEach { taskName ->
|
||||
tasks.named(taskName) { dependsOn(gradle.includedBuild("gradle-plugin").task(":$taskName")) }
|
||||
}
|
||||
|
||||
allprojects {
|
||||
// Apply exclusions for specific files that should not be formatted
|
||||
val excludePatterns =
|
||||
listOf(
|
||||
"**/build/**",
|
||||
"**/hermes-engine/**",
|
||||
"**/internal/featureflags/**",
|
||||
"**/systeminfo/ReactNativeVersion.kt",
|
||||
)
|
||||
listOf(
|
||||
com.ncorti.ktfmt.gradle.tasks.KtfmtCheckTask::class,
|
||||
com.ncorti.ktfmt.gradle.tasks.KtfmtFormatTask::class,
|
||||
)
|
||||
.forEach { tasks.withType(it) { exclude(excludePatterns) } }
|
||||
|
||||
// Disable the problematic ktfmt script tasks due to symbolic link issues in subprojects
|
||||
afterEvaluate {
|
||||
listOf("ktfmtCheckScripts", "ktfmtFormatScripts").forEach {
|
||||
tasks.findByName(it)?.enabled = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// We intentionally disable the `ktfmtCheck` tasks as the formatting is primarly handled inside
|
||||
// fbsource
|
||||
allprojects { tasks.withType<com.ncorti.ktfmt.gradle.tasks.KtfmtCheckTask>() { enabled = false } }
|
||||
|
||||
Vendored
+16
-19
@@ -3057,30 +3057,30 @@ type util$InspectOptions = {
|
||||
};
|
||||
|
||||
declare type util$ParseArgsOption =
|
||||
| $ReadOnly<{|
|
||||
| {|
|
||||
type: 'boolean',
|
||||
multiple?: false,
|
||||
short?: string,
|
||||
default?: boolean,
|
||||
|}>
|
||||
| $ReadOnly<{|
|
||||
|}
|
||||
| {|
|
||||
type: 'boolean',
|
||||
multiple: true,
|
||||
short?: string,
|
||||
default?: Array<boolean>,
|
||||
|}>
|
||||
| $ReadOnly<{|
|
||||
|}
|
||||
| {|
|
||||
type: 'string',
|
||||
multiple?: false,
|
||||
short?: string,
|
||||
default?: string,
|
||||
|}>
|
||||
| $ReadOnly<{|
|
||||
|}
|
||||
| {|
|
||||
type: 'string',
|
||||
multiple: true,
|
||||
short?: string,
|
||||
default?: Array<string>,
|
||||
|}>;
|
||||
|};
|
||||
|
||||
type util$ParseArgsOptionToValue<TOption> = TOption['type'] extends 'boolean'
|
||||
? TOption['multiple'] extends true
|
||||
@@ -3137,7 +3137,7 @@ declare module 'util' {
|
||||
declare function stripVTControlCharacters(str: string): string;
|
||||
|
||||
declare function parseArgs<
|
||||
TOptions: {+[string]: util$ParseArgsOption} = {||},
|
||||
TOptions: {[string]: util$ParseArgsOption} = {||},
|
||||
>(config: {|
|
||||
args?: Array<string>,
|
||||
options?: TOptions,
|
||||
@@ -3995,16 +3995,13 @@ declare class Process extends events$EventEmitter {
|
||||
initgroups?: (user: number | string, extra_group: number | string) => void;
|
||||
kill(pid: number, signal?: string | number): void;
|
||||
mainModule: Object;
|
||||
memoryUsage: {
|
||||
(): {
|
||||
arrayBuffers: number,
|
||||
rss: number,
|
||||
heapTotal: number,
|
||||
heapUsed: number,
|
||||
external: number,
|
||||
...
|
||||
},
|
||||
rss: () => number,
|
||||
memoryUsage(): {
|
||||
arrayBuffers: number,
|
||||
rss: number,
|
||||
heapTotal: number,
|
||||
heapUsed: number,
|
||||
external: number,
|
||||
...
|
||||
};
|
||||
nextTick: <T>(cb: (...T) => mixed, ...T) => void;
|
||||
pid: number;
|
||||
|
||||
-46
@@ -1,46 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow strict-local
|
||||
* @format
|
||||
*/
|
||||
|
||||
declare module '@expo/spawn-async' {
|
||||
type SpawnOptions = {
|
||||
cwd?: string,
|
||||
env?: Object,
|
||||
argv0?: string,
|
||||
stdio?: string | Array<any>,
|
||||
detached?: boolean,
|
||||
uid?: number,
|
||||
gid?: number,
|
||||
shell?: boolean | string,
|
||||
windowsVerbatimArguments?: boolean,
|
||||
windowsHide?: boolean,
|
||||
encoding?: string,
|
||||
ignoreStdio?: boolean,
|
||||
};
|
||||
|
||||
declare class SpawnPromise<T> extends Promise<T> {
|
||||
child: child_process$ChildProcess;
|
||||
}
|
||||
type SpawnResult = {
|
||||
pid?: number,
|
||||
output: string[],
|
||||
stdout: string,
|
||||
stderr: string,
|
||||
status: number | null,
|
||||
signal: string | null,
|
||||
};
|
||||
|
||||
declare function spawnAsync(
|
||||
command: string,
|
||||
args?: $ReadOnlyArray<string>,
|
||||
options?: SpawnOptions,
|
||||
): SpawnPromise<SpawnResult>;
|
||||
|
||||
declare module.exports: typeof spawnAsync;
|
||||
}
|
||||
-61
@@ -1,61 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow strict-local
|
||||
* @format
|
||||
*/
|
||||
|
||||
// Partial types for Octokit based on the usage in react-native-github
|
||||
declare module '@octokit/rest' {
|
||||
declare class Octokit {
|
||||
constructor(options?: {auth?: string, ...}): this;
|
||||
|
||||
repos: $ReadOnly<{
|
||||
listReleaseAssets: (
|
||||
params: $ReadOnly<{
|
||||
owner: string,
|
||||
repo: string,
|
||||
release_id: string,
|
||||
}>,
|
||||
) => Promise<{
|
||||
data: Array<{
|
||||
id: string,
|
||||
name: string,
|
||||
...
|
||||
}>,
|
||||
...
|
||||
}>,
|
||||
uploadReleaseAsset: (
|
||||
params: $ReadOnly<{
|
||||
owner: string,
|
||||
repo: string,
|
||||
release_id: string,
|
||||
name: string,
|
||||
data: Buffer,
|
||||
headers: $ReadOnly<{
|
||||
'content-type': string,
|
||||
...
|
||||
}>,
|
||||
...
|
||||
}>,
|
||||
) => Promise<{
|
||||
data: {
|
||||
browser_download_url: string,
|
||||
...
|
||||
},
|
||||
...
|
||||
}>,
|
||||
deleteReleaseAsset: (params: {
|
||||
owner: string,
|
||||
repo: string,
|
||||
asset_id: string,
|
||||
...
|
||||
}) => Promise<mixed>,
|
||||
}>;
|
||||
}
|
||||
|
||||
declare export {Octokit};
|
||||
}
|
||||
Vendored
-13
@@ -1,13 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow strict-local
|
||||
* @format
|
||||
*/
|
||||
|
||||
declare module 'fb-dotslash' {
|
||||
declare module.exports: string;
|
||||
}
|
||||
-421
@@ -1,421 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow strict-local
|
||||
* @format
|
||||
*/
|
||||
|
||||
declare module 'jsonc-parser' {
|
||||
/**
|
||||
* Creates a JSON scanner on the given text.
|
||||
* If ignoreTrivia is set, whitespaces or comments are ignored.
|
||||
*/
|
||||
declare export const createScanner: (
|
||||
text: string,
|
||||
ignoreTrivia?: boolean,
|
||||
) => JSONScanner;
|
||||
export type ScanError = number;
|
||||
export type SyntaxKind = number;
|
||||
/**
|
||||
* The scanner object, representing a JSON scanner at a position in the input string.
|
||||
*/
|
||||
export type JSONScanner = $ReadOnly<{
|
||||
/**
|
||||
* Sets the scan position to a new offset. A call to 'scan' is needed to get the first token.
|
||||
*/
|
||||
setPosition(pos: number): void,
|
||||
/**
|
||||
* Read the next token. Returns the token code.
|
||||
*/
|
||||
scan(): SyntaxKind,
|
||||
/**
|
||||
* Returns the zero-based current scan position, which is after the last read token.
|
||||
*/
|
||||
getPosition(): number,
|
||||
/**
|
||||
* Returns the last read token.
|
||||
*/
|
||||
getToken(): SyntaxKind,
|
||||
/**
|
||||
* Returns the last read token value. The value for strings is the decoded string content. For numbers it's of type number, for boolean it's true or false.
|
||||
*/
|
||||
getTokenValue(): string,
|
||||
/**
|
||||
* The zero-based start offset of the last read token.
|
||||
*/
|
||||
getTokenOffset(): number,
|
||||
/**
|
||||
* The length of the last read token.
|
||||
*/
|
||||
getTokenLength(): number,
|
||||
/**
|
||||
* The zero-based start line number of the last read token.
|
||||
*/
|
||||
getTokenStartLine(): number,
|
||||
/**
|
||||
* The zero-based start character (column) of the last read token.
|
||||
*/
|
||||
getTokenStartCharacter(): number,
|
||||
/**
|
||||
* An error code of the last scan.
|
||||
*/
|
||||
getTokenError(): ScanError,
|
||||
}>;
|
||||
/**
|
||||
* For a given offset, evaluate the location in the JSON document. Each segment in the location path is either a property name or an array index.
|
||||
*/
|
||||
declare export const getLocation: (
|
||||
text: string,
|
||||
position: number,
|
||||
) => Location;
|
||||
/**
|
||||
* Parses the given text and returns the object the JSON content represents. On invalid input, the parser tries to be as fault tolerant as possible, but still return a result.
|
||||
* Therefore, always check the errors list to find out if the input was valid.
|
||||
*/
|
||||
declare export const parse: (
|
||||
text: string,
|
||||
errors?: ParseError[],
|
||||
options?: ParseOptions,
|
||||
) => any;
|
||||
/**
|
||||
* Parses the given text and returns a tree representation the JSON content. On invalid input, the parser tries to be as fault tolerant as possible, but still return a result.
|
||||
*/
|
||||
declare export const parseTree: (
|
||||
text: string,
|
||||
errors?: ParseError[],
|
||||
options?: ParseOptions,
|
||||
) => Node | void;
|
||||
/**
|
||||
* Finds the node at the given path in a JSON DOM.
|
||||
*/
|
||||
declare export const findNodeAtLocation: (
|
||||
root: Node,
|
||||
path: JSONPath,
|
||||
) => Node | void;
|
||||
/**
|
||||
* Finds the innermost node at the given offset. If includeRightBound is set, also finds nodes that end at the given offset.
|
||||
*/
|
||||
declare export const findNodeAtOffset: (
|
||||
root: Node,
|
||||
offset: number,
|
||||
includeRightBound?: boolean,
|
||||
) => Node | void;
|
||||
/**
|
||||
* Gets the JSON path of the given JSON DOM node
|
||||
*/
|
||||
declare export const getNodePath: (node: Node) => JSONPath;
|
||||
/**
|
||||
* Evaluates the JavaScript object of the given JSON DOM node
|
||||
*/
|
||||
declare export const getNodeValue: (node: Node) => any;
|
||||
/**
|
||||
* Parses the given text and invokes the visitor functions for each object, array and literal reached.
|
||||
*/
|
||||
declare export const visit: (
|
||||
text: string,
|
||||
visitor: JSONVisitor,
|
||||
options?: ParseOptions,
|
||||
) => any;
|
||||
/**
|
||||
* Takes JSON with JavaScript-style comments and remove
|
||||
* them. Optionally replaces every none-newline character
|
||||
* of comments with a replaceCharacter
|
||||
*/
|
||||
declare export const stripComments: (
|
||||
text: string,
|
||||
replaceCh?: string,
|
||||
) => string;
|
||||
export type ParseError = {
|
||||
error: ParseErrorCode,
|
||||
offset: number,
|
||||
length: number,
|
||||
};
|
||||
export type ParseErrorCode = number;
|
||||
declare export function printParseErrorCode(
|
||||
code: ParseErrorCode,
|
||||
):
|
||||
| 'InvalidSymbol'
|
||||
| 'InvalidNumberFormat'
|
||||
| 'PropertyNameExpected'
|
||||
| 'ValueExpected'
|
||||
| 'ColonExpected'
|
||||
| 'CommaExpected'
|
||||
| 'CloseBraceExpected'
|
||||
| 'CloseBracketExpected'
|
||||
| 'EndOfFileExpected'
|
||||
| 'InvalidCommentToken'
|
||||
| 'UnexpectedEndOfComment'
|
||||
| 'UnexpectedEndOfString'
|
||||
| 'UnexpectedEndOfNumber'
|
||||
| 'InvalidUnicode'
|
||||
| 'InvalidEscapeCharacter'
|
||||
| 'InvalidCharacter'
|
||||
| '<unknown ParseErrorCode>';
|
||||
export type NodeType =
|
||||
| 'object'
|
||||
| 'array'
|
||||
| 'property'
|
||||
| 'string'
|
||||
| 'number'
|
||||
| 'boolean'
|
||||
| 'null';
|
||||
export type Node = {
|
||||
type: NodeType,
|
||||
value?: any,
|
||||
offset: number,
|
||||
length: number,
|
||||
colonOffset?: number,
|
||||
parent?: Node,
|
||||
children?: Node[],
|
||||
};
|
||||
/**
|
||||
* A {@linkcode JSONPath} segment. Either a string representing an object property name
|
||||
* or a number (starting at 0) for array indices.
|
||||
*/
|
||||
export type Segment = string | number;
|
||||
export type JSONPath = Segment[];
|
||||
export type Location = {
|
||||
/**
|
||||
* The previous property key or literal value (string, number, boolean or null) or undefined.
|
||||
*/
|
||||
previousNode?: Node,
|
||||
/**
|
||||
* The path describing the location in the JSON document. The path consists of a sequence of strings
|
||||
* representing an object property or numbers for array indices.
|
||||
*/
|
||||
path: JSONPath,
|
||||
/**
|
||||
* Matches the locations path against a pattern consisting of strings (for properties) and numbers (for array indices).
|
||||
* '*' will match a single segment of any property name or index.
|
||||
* '**' will match a sequence of segments of any property name or index, or no segment.
|
||||
*/
|
||||
matches: (patterns: JSONPath) => boolean,
|
||||
/**
|
||||
* If set, the location's offset is at a property key.
|
||||
*/
|
||||
isAtPropertyKey: boolean,
|
||||
};
|
||||
export type ParseOptions = {
|
||||
disallowComments?: boolean,
|
||||
allowTrailingComma?: boolean,
|
||||
allowEmptyContent?: boolean,
|
||||
};
|
||||
/**
|
||||
* Visitor called by {@linkcode visit} when parsing JSON.
|
||||
*
|
||||
* The visitor functions have the following common parameters:
|
||||
* - `offset`: Global offset within the JSON document, starting at 0
|
||||
* - `startLine`: Line number, starting at 0
|
||||
* - `startCharacter`: Start character (column) within the current line, starting at 0
|
||||
*
|
||||
* Additionally some functions have a `pathSupplier` parameter which can be used to obtain the
|
||||
* current `JSONPath` within the document.
|
||||
*/
|
||||
export type JSONVisitor = {
|
||||
/**
|
||||
* Invoked when an open brace is encountered and an object is started. The offset and length represent the location of the open brace.
|
||||
*/
|
||||
onObjectBegin?: (
|
||||
offset: number,
|
||||
length: number,
|
||||
startLine: number,
|
||||
startCharacter: number,
|
||||
pathSupplier: () => JSONPath,
|
||||
) => void,
|
||||
/**
|
||||
* Invoked when a property is encountered. The offset and length represent the location of the property name.
|
||||
* The `JSONPath` created by the `pathSupplier` refers to the enclosing JSON object, it does not include the
|
||||
* property name yet.
|
||||
*/
|
||||
onObjectProperty?: (
|
||||
property: string,
|
||||
offset: number,
|
||||
length: number,
|
||||
startLine: number,
|
||||
startCharacter: number,
|
||||
pathSupplier: () => JSONPath,
|
||||
) => void,
|
||||
/**
|
||||
* Invoked when a closing brace is encountered and an object is completed. The offset and length represent the location of the closing brace.
|
||||
*/
|
||||
onObjectEnd?: (
|
||||
offset: number,
|
||||
length: number,
|
||||
startLine: number,
|
||||
startCharacter: number,
|
||||
) => void,
|
||||
/**
|
||||
* Invoked when an open bracket is encountered. The offset and length represent the location of the open bracket.
|
||||
*/
|
||||
onArrayBegin?: (
|
||||
offset: number,
|
||||
length: number,
|
||||
startLine: number,
|
||||
startCharacter: number,
|
||||
pathSupplier: () => JSONPath,
|
||||
) => void,
|
||||
/**
|
||||
* Invoked when a closing bracket is encountered. The offset and length represent the location of the closing bracket.
|
||||
*/
|
||||
onArrayEnd?: (
|
||||
offset: number,
|
||||
length: number,
|
||||
startLine: number,
|
||||
startCharacter: number,
|
||||
) => void,
|
||||
/**
|
||||
* Invoked when a literal value is encountered. The offset and length represent the location of the literal value.
|
||||
*/
|
||||
onLiteralValue?: (
|
||||
value: any,
|
||||
offset: number,
|
||||
length: number,
|
||||
startLine: number,
|
||||
startCharacter: number,
|
||||
pathSupplier: () => JSONPath,
|
||||
) => void,
|
||||
/**
|
||||
* Invoked when a comma or colon separator is encountered. The offset and length represent the location of the separator.
|
||||
*/
|
||||
onSeparator?: (
|
||||
character: string,
|
||||
offset: number,
|
||||
length: number,
|
||||
startLine: number,
|
||||
startCharacter: number,
|
||||
) => void,
|
||||
/**
|
||||
* When comments are allowed, invoked when a line or block comment is encountered. The offset and length represent the location of the comment.
|
||||
*/
|
||||
onComment?: (
|
||||
offset: number,
|
||||
length: number,
|
||||
startLine: number,
|
||||
startCharacter: number,
|
||||
) => void,
|
||||
/**
|
||||
* Invoked on an error.
|
||||
*/
|
||||
onError?: (
|
||||
error: ParseErrorCode,
|
||||
offset: number,
|
||||
length: number,
|
||||
startLine: number,
|
||||
startCharacter: number,
|
||||
) => void,
|
||||
};
|
||||
/**
|
||||
* An edit result describes a textual edit operation. It is the result of a {@linkcode format} and {@linkcode modify} operation.
|
||||
* It consist of one or more edits describing insertions, replacements or removals of text segments.
|
||||
* * The offsets of the edits refer to the original state of the document.
|
||||
* * No two edits change or remove the same range of text in the original document.
|
||||
* * Multiple edits can have the same offset if they are multiple inserts, or an insert followed by a remove or replace.
|
||||
* * The order in the array defines which edit is applied first.
|
||||
* To apply an edit result use {@linkcode applyEdits}.
|
||||
* In general multiple EditResults must not be concatenated because they might impact each other, producing incorrect or malformed JSON data.
|
||||
*/
|
||||
export type EditResult = Edit[];
|
||||
/**
|
||||
* Represents a text modification
|
||||
*/
|
||||
export type Edit = {
|
||||
/**
|
||||
* The start offset of the modification.
|
||||
*/
|
||||
offset: number,
|
||||
/**
|
||||
* The length of the modification. Must not be negative. Empty length represents an *insert*.
|
||||
*/
|
||||
length: number,
|
||||
/**
|
||||
* The new content. Empty content represents a *remove*.
|
||||
*/
|
||||
content: string,
|
||||
};
|
||||
/**
|
||||
* A text range in the document
|
||||
*/
|
||||
export type Range = {
|
||||
/**
|
||||
* The start offset of the range.
|
||||
*/
|
||||
offset: number,
|
||||
/**
|
||||
* The length of the range. Must not be negative.
|
||||
*/
|
||||
length: number,
|
||||
};
|
||||
/**
|
||||
* Options used by {@linkcode format} when computing the formatting edit operations
|
||||
*/
|
||||
export type FormattingOptions = $ReadOnly<{
|
||||
/**
|
||||
* If indentation is based on spaces (`insertSpaces` = true), the number of spaces that make an indent.
|
||||
*/
|
||||
tabSize?: number,
|
||||
/**
|
||||
* Is indentation based on spaces?
|
||||
*/
|
||||
insertSpaces?: boolean,
|
||||
/**
|
||||
* The default 'end of line' character. If not set, '\n' is used as default.
|
||||
*/
|
||||
eol?: string,
|
||||
}>;
|
||||
/**
|
||||
* Computes the edit operations needed to format a JSON document.
|
||||
*
|
||||
* @param documentText The input text
|
||||
* @param range The range to format or `undefined` to format the full content
|
||||
* @param options The formatting options
|
||||
* @returns The edit operations describing the formatting changes to the original document following the format described in {@linkcode EditResult}.
|
||||
* To apply the edit operations to the input, use {@linkcode applyEdits}.
|
||||
*/
|
||||
declare export function format(
|
||||
documentText: string,
|
||||
range: Range | void,
|
||||
options: FormattingOptions,
|
||||
): EditResult;
|
||||
/**
|
||||
* Options used by {@linkcode modify} when computing the modification edit operations
|
||||
*/
|
||||
export type ModificationOptions = {
|
||||
/**
|
||||
* Formatting options.
|
||||
*/
|
||||
formattingOptions: FormattingOptions,
|
||||
/**
|
||||
* Optional function to define the insertion index given an existing list of properties.
|
||||
*/
|
||||
getInsertionIndex?: (properties: string[]) => number,
|
||||
};
|
||||
/**
|
||||
* Computes the edit operations needed to modify a value in the JSON document.
|
||||
*
|
||||
* @param documentText The input text
|
||||
* @param path The path of the value to change. The path represents either to the document root, a property or an array item.
|
||||
* If the path points to an non-existing property or item, it will be created.
|
||||
* @param value The new value for the specified property or item. If the value is undefined,
|
||||
* the property or item will be removed.
|
||||
* @param options Options
|
||||
* @returns The edit operations describing the changes to the original document, following the format described in {@linkcode EditResult}.
|
||||
* To apply the edit operations to the input, use {@linkcode applyEdits}.
|
||||
*/
|
||||
declare export function modify(
|
||||
text: string,
|
||||
path: JSONPath,
|
||||
value: any,
|
||||
options: ModificationOptions,
|
||||
): EditResult;
|
||||
/**
|
||||
* Applies edits to an input string.
|
||||
* @param text The input text
|
||||
* @param edits Edit operations following the format described in {@linkcode EditResult}.
|
||||
* @returns The text with the applied edits.
|
||||
* @throws An error if the edit operations are not well-formed as described in {@linkcode EditResult}.
|
||||
*/
|
||||
declare export function applyEdits(text: string, edits: EditResult): string;
|
||||
}
|
||||
@@ -91,19 +91,7 @@ declare module 'tinybench' {
|
||||
beforeEach?: (this: Task) => void | Promise<void>,
|
||||
};
|
||||
|
||||
// This is defined as an interface in tinybench but we define it as an object
|
||||
// to catch problems like `overriddenDuration` being misspelled.
|
||||
export type FnReturnedObject = {
|
||||
overriddenDuration?: number,
|
||||
};
|
||||
|
||||
// This type is defined as returning `unknown` instead of `void` in tinybench,
|
||||
// but we type it this way to avoid mistakes (we can make breaking changes
|
||||
// in our definition that they can't).
|
||||
export type Fn = () =>
|
||||
| Promise<void | FnReturnedObject>
|
||||
| void
|
||||
| FnReturnedObject;
|
||||
export type Fn = () => Promise<mixed> | mixed;
|
||||
|
||||
declare export class Bench extends EventTarget {
|
||||
concurrency: null | 'task' | 'bench';
|
||||
Vendored
+2
-2
@@ -21,7 +21,7 @@ declare type ws$PerMessageDeflateOptions = {
|
||||
maxPayload?: number,
|
||||
};
|
||||
|
||||
/* $FlowFixMe[incompatible-type] - Found with Flow v0.143.1 upgrade
|
||||
/* $FlowFixMe[incompatible-extend] - Found with Flow v0.143.1 upgrade
|
||||
* "on" definition failing with string is incompatible with string literal */
|
||||
declare class ws$WebSocketServer extends events$EventEmitter {
|
||||
/**
|
||||
@@ -141,7 +141,7 @@ declare type ws$UnexpectedResponseListener = (
|
||||
) => mixed;
|
||||
declare type ws$UpgradeListener = (response: http$IncomingMessage<>) => mixed;
|
||||
|
||||
/* $FlowFixMe[incompatible-type] - Found with Flow v0.143.1 upgrade
|
||||
/* $FlowFixMe[incompatible-extend] - Found with Flow v0.143.1 upgrade
|
||||
* "on" definition failing with string is incompatible with string literal */
|
||||
declare class ws$WebSocket extends events$EventEmitter {
|
||||
static Server: typeof ws$WebSocketServer;
|
||||
|
||||
@@ -4,13 +4,6 @@ org.gradle.caching=true
|
||||
|
||||
android.useAndroidX=true
|
||||
|
||||
# Those 2 properties are needed to make our project compatible with
|
||||
# AGP 9.0.0 for the time being. Ideally we should not opt-out of
|
||||
# builtInKotlin and newDsl once AGP 9.0.0 hits stable.
|
||||
# More on this: https://developer.android.com/build/releases/agp-preview#android-gradle-plugin-built-in-kotlin
|
||||
android.builtInKotlin=false
|
||||
android.newDsl=false
|
||||
|
||||
# Use this property to specify which architecture you want to build.
|
||||
# You can also override it from the CLI using
|
||||
# ./gradlew <task> -PreactNativeArchitectures=x86_64
|
||||
@@ -19,6 +12,3 @@ reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
|
||||
# Controls whether to use Hermes from nightly builds. This will speed up builds
|
||||
# but should NOT be turned on for CI or release builds.
|
||||
react.internal.useHermesNightly=false
|
||||
|
||||
# Controls whether to use Hermes 1.0. Clean and rebuild when changing.
|
||||
hermesV1Enabled=false
|
||||
|
||||
Vendored
BIN
Binary file not shown.
+1
-1
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright © 2015 the original authors.
|
||||
# Copyright © 2015-2021 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -86,7 +86,7 @@ module.exports = {
|
||||
globalPrefix: '',
|
||||
hermesParser: true,
|
||||
hot: false,
|
||||
// $FlowFixMe[incompatible-type] TODO: Remove when `inlineRequires` has been removed from metro-babel-transformer in OSS
|
||||
// $FlowFixMe[incompatible-call] TODO: Remove when `inlineRequires` has been removed from metro-babel-transformer in OSS
|
||||
inlineRequires: true,
|
||||
minify: false,
|
||||
platform: '',
|
||||
@@ -111,7 +111,7 @@ module.exports = {
|
||||
|
||||
return generate(
|
||||
ast,
|
||||
// $FlowFixMe[incompatible-type] Error found when improving flow typing for libs
|
||||
// $FlowFixMe[prop-missing] Error found when improving flow typing for libs
|
||||
{
|
||||
code: true,
|
||||
comments: false,
|
||||
|
||||
+21
-29
@@ -19,8 +19,6 @@
|
||||
"featureflags": "yarn --cwd packages/react-native featureflags",
|
||||
"js-api-diff": "node ./scripts/js-api/diff-api-snapshot",
|
||||
"lint-ci": "./.github/workflow-scripts/analyze_code.sh && yarn shellcheck",
|
||||
"lint-kotlin-check": "./gradlew ktfmtCheck",
|
||||
"lint-kotlin": "./gradlew ktfmtFormat",
|
||||
"lint-markdown": "markdownlint-cli2 2>&1",
|
||||
"lint": "eslint --max-warnings 0 .",
|
||||
"prettier": "prettier --write \"./**/*.{js,md,yml,ts,tsx}\"",
|
||||
@@ -54,19 +52,16 @@
|
||||
"@babel/preset-env": "^7.25.3",
|
||||
"@babel/preset-flow": "^7.24.7",
|
||||
"@electron/packager": "^18.3.6",
|
||||
"@expo/spawn-async": "^1.7.2",
|
||||
"@jest/create-cache-key-function": "^29.7.0",
|
||||
"@microsoft/api-extractor": "^7.52.2",
|
||||
"@octokit/rest": "^22.0.0",
|
||||
"@react-native/metro-babel-transformer": "0.83.0-main",
|
||||
"@react-native/metro-config": "0.83.0-main",
|
||||
"@react-native/metro-babel-transformer": "0.81.0-main",
|
||||
"@react-native/metro-config": "0.81.0-main",
|
||||
"@tsconfig/node22": "22.0.2",
|
||||
"@types/react": "^19.1.0",
|
||||
"@typescript-eslint/parser": "^8.36.0",
|
||||
"ansi-regex": "^5.0.0",
|
||||
"ansi-styles": "^4.2.1",
|
||||
"babel-plugin-minify-dead-code-elimination": "^0.5.2",
|
||||
"babel-plugin-syntax-hermes-parser": "0.32.0",
|
||||
"babel-plugin-syntax-hermes-parser": "0.29.1",
|
||||
"babel-plugin-transform-define": "^2.1.4",
|
||||
"babel-plugin-transform-flow-enums": "^0.0.2",
|
||||
"clang-format": "^1.8.0",
|
||||
@@ -78,50 +73,47 @@
|
||||
"eslint-plugin-babel": "^5.3.1",
|
||||
"eslint-plugin-eslint-comments": "^3.2.0",
|
||||
"eslint-plugin-ft-flow": "^2.0.1",
|
||||
"eslint-plugin-jest": "^29.0.1",
|
||||
"eslint-plugin-jest": "^27.9.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.6.0",
|
||||
"eslint-plugin-react": "^7.30.1",
|
||||
"eslint-plugin-react-native": "^4.0.0",
|
||||
"eslint-plugin-redundant-undefined": "^0.4.0",
|
||||
"eslint-plugin-relay": "^1.8.3",
|
||||
"fb-dotslash": "0.5.8",
|
||||
"flow-api-translator": "0.32.0",
|
||||
"flow-bin": "^0.289.0",
|
||||
"flow-api-translator": "0.29.1",
|
||||
"flow-bin": "^0.275.0",
|
||||
"glob": "^7.1.1",
|
||||
"hermes-eslint": "0.32.0",
|
||||
"hermes-transform": "0.32.0",
|
||||
"hermes-eslint": "0.29.1",
|
||||
"hermes-transform": "0.29.1",
|
||||
"ini": "^5.0.0",
|
||||
"inquirer": "^7.1.0",
|
||||
"jest": "^29.7.0",
|
||||
"jest-config": "^29.7.0",
|
||||
"jest-diff": "^29.7.0",
|
||||
"jest-junit": "^16.0.0",
|
||||
"jest-junit": "^10.0.0",
|
||||
"jest-snapshot": "^29.7.0",
|
||||
"jsonc-parser": "2.2.1",
|
||||
"markdownlint-cli2": "^0.17.2",
|
||||
"markdownlint-rule-relative-links": "^3.0.0",
|
||||
"memfs": "^4.38.2",
|
||||
"metro-babel-register": "^0.83.3",
|
||||
"metro-transform-plugins": "^0.83.3",
|
||||
"memfs": "^4.7.7",
|
||||
"metro-babel-register": "^0.83.0",
|
||||
"metro-transform-plugins": "^0.83.0",
|
||||
"micromatch": "^4.0.4",
|
||||
"node-fetch": "^2.2.0",
|
||||
"nullthrows": "^1.1.1",
|
||||
"prettier": "3.6.2",
|
||||
"prettier-plugin-hermes-parser": "0.32.0",
|
||||
"react": "19.2.0",
|
||||
"react-test-renderer": "19.2.0",
|
||||
"prettier": "2.8.8",
|
||||
"prettier-plugin-hermes-parser": "0.29.1",
|
||||
"react": "19.1.0",
|
||||
"react-test-renderer": "19.1.0",
|
||||
"rimraf": "^3.0.2",
|
||||
"shelljs": "^0.8.5",
|
||||
"signedsource": "^2.0.0",
|
||||
"signedsource": "^1.0.0",
|
||||
"supports-color": "^7.1.0",
|
||||
"temp-dir": "^2.0.0",
|
||||
"tinybench": "^4.1.0",
|
||||
"tinybench": "^3.1.0",
|
||||
"typescript": "5.8.3",
|
||||
"ws": "^7.5.10"
|
||||
"ws": "^6.2.3"
|
||||
},
|
||||
"resolutions": {
|
||||
"react-is": "19.2.0",
|
||||
"on-headers": "1.1.0",
|
||||
"compression": "1.8.1"
|
||||
"eslint-plugin-react-hooks": "6.1.0-canary-12bc60f5-20250613",
|
||||
"react-is": "19.1.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/assets-registry",
|
||||
"version": "0.83.0-main",
|
||||
"version": "0.81.0-main",
|
||||
"description": "Asset support code for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -17,7 +17,7 @@
|
||||
],
|
||||
"bugs": "https://github.com/facebook/react-native/issues",
|
||||
"engines": {
|
||||
"node": ">= 20.19.4"
|
||||
"node": ">= 22.14.0"
|
||||
},
|
||||
"files": [
|
||||
"path-support.js",
|
||||
|
||||
@@ -81,147 +81,10 @@ export {Commands};
|
||||
export default (codegenNativeComponent<ModuleProps>('Module'): NativeType);
|
||||
`;
|
||||
|
||||
const COMMANDS_WITH_COVERAGE_INVALID = `
|
||||
// @flow
|
||||
|
||||
const codegenNativeComponent = require('codegenNativeComponent');
|
||||
import type {NativeComponentType} from 'codegenNativeComponent';
|
||||
|
||||
import type {ViewProps} from 'ViewPropTypes';
|
||||
|
||||
type ModuleProps = $ReadOnly<{|
|
||||
...ViewProps,
|
||||
|}>;
|
||||
|
||||
type NativeType = NativeComponentType<ModuleProps>;
|
||||
|
||||
// Coverage instrumentation of invalid Commands export - should still fail
|
||||
export const Commands = (cov_1234567890().s[0]++, {
|
||||
hotspotUpdate: () => {},
|
||||
scrollTo: () => {},
|
||||
});
|
||||
|
||||
export default (codegenNativeComponent<ModuleProps>('Module'): NativeType);
|
||||
`;
|
||||
|
||||
const COMMANDS_WITH_COVERAGE_WRONG_FUNCTION = `
|
||||
// @flow
|
||||
|
||||
const codegenNativeComponent = require('codegenNativeComponent');
|
||||
import type {NativeComponentType} from 'codegenNativeComponent';
|
||||
|
||||
import type {ViewProps} from 'ViewPropTypes';
|
||||
|
||||
type ModuleProps = $ReadOnly<{|
|
||||
...ViewProps,
|
||||
|}>;
|
||||
|
||||
type NativeType = NativeComponentType<ModuleProps>;
|
||||
|
||||
// Coverage instrumentation of wrong function call - should fail
|
||||
export const Commands = (cov_abcdef123().s[0]++, someOtherFunction({
|
||||
supportedCommands: ['pause', 'play'],
|
||||
}));
|
||||
|
||||
export default (codegenNativeComponent<ModuleProps>('Module'): NativeType);
|
||||
`;
|
||||
|
||||
const COMMANDS_WITH_COMPLEX_COVERAGE_INVALID = `
|
||||
// @flow
|
||||
|
||||
const codegenNativeComponent = require('codegenNativeComponent');
|
||||
import type {NativeComponentType} from 'codegenNativeComponent';
|
||||
|
||||
import type {ViewProps} from 'ViewPropTypes';
|
||||
|
||||
type ModuleProps = $ReadOnly<{|
|
||||
...ViewProps,
|
||||
|}>;
|
||||
|
||||
type NativeType = NativeComponentType<ModuleProps>;
|
||||
|
||||
// Complex coverage instrumentation with invalid nested structure - should fail
|
||||
export const Commands = (
|
||||
cov_xyz789().f[1]++,
|
||||
cov_xyz789().s[2]++,
|
||||
{
|
||||
pause: (ref) => {},
|
||||
play: (ref) => {},
|
||||
}
|
||||
);
|
||||
|
||||
export default (codegenNativeComponent<ModuleProps>('Module'): NativeType);
|
||||
`;
|
||||
|
||||
const COMMANDS_WITH_COVERAGE_WRONG_NAME = `
|
||||
// @flow
|
||||
|
||||
const codegenNativeCommands = require('codegenNativeCommands');
|
||||
const codegenNativeComponent = require('codegenNativeComponent');
|
||||
import type {NativeComponentType} from 'codegenNativeComponent';
|
||||
|
||||
import type {ViewProps} from 'ViewPropTypes';
|
||||
|
||||
type ModuleProps = $ReadOnly<{|
|
||||
...ViewProps,
|
||||
|}>;
|
||||
|
||||
type NativeType = NativeComponentType<ModuleProps>;
|
||||
|
||||
interface NativeCommands {
|
||||
+pause: (viewRef: React.ElementRef<NativeType>) => void;
|
||||
+play: (viewRef: React.ElementRef<NativeType>) => void;
|
||||
}
|
||||
|
||||
// Coverage instrumentation with correct function but wrong export name - should fail
|
||||
export const WrongName = (cov_wrong123().s[0]++, codegenNativeCommands<NativeCommands>({
|
||||
supportedCommands: ['pause', 'play'],
|
||||
}));
|
||||
|
||||
export default (codegenNativeComponent<ModuleProps>('Module'): NativeType);
|
||||
`;
|
||||
|
||||
const COMMANDS_WITH_COVERAGE_TYPE_CAST_INVALID = `
|
||||
// @flow
|
||||
|
||||
const codegenNativeComponent = require('codegenNativeComponent');
|
||||
import type {NativeComponentType} from 'codegenNativeComponent';
|
||||
|
||||
import type {ViewProps} from 'ViewPropTypes';
|
||||
|
||||
type ModuleProps = $ReadOnly<{|
|
||||
...ViewProps,
|
||||
|}>;
|
||||
|
||||
type NativeType = NativeComponentType<ModuleProps>;
|
||||
|
||||
interface NativeCommands {
|
||||
+pause: (viewRef: React.ElementRef<NativeType>) => void;
|
||||
+play: (viewRef: React.ElementRef<NativeType>) => void;
|
||||
}
|
||||
|
||||
// Coverage instrumentation with type cast but wrong function - should fail
|
||||
export const Commands: NativeCommands = (cov_cast123().s[0]++, invalidFunction({
|
||||
supportedCommands: ['pause', 'play'],
|
||||
}));
|
||||
|
||||
export default (codegenNativeComponent<ModuleProps>('Module'): NativeType);
|
||||
`;
|
||||
|
||||
module.exports = {
|
||||
'CommandsExportedWithDifferentNameNativeComponent.js':
|
||||
COMMANDS_EXPORTED_WITH_DIFFERENT_NAME,
|
||||
'CommandsExportedWithShorthandNativeComponent.js':
|
||||
COMMANDS_EXPORTED_WITH_SHORTHAND,
|
||||
'OtherCommandsExportNativeComponent.js': OTHER_COMMANDS_EXPORT,
|
||||
'CommandsWithCoverageInvalidNativeComponent.js':
|
||||
COMMANDS_WITH_COVERAGE_INVALID,
|
||||
'CommandsWithCoverageWrongFunctionNativeComponent.js':
|
||||
COMMANDS_WITH_COVERAGE_WRONG_FUNCTION,
|
||||
'CommandsWithComplexCoverageInvalidNativeComponent.js':
|
||||
COMMANDS_WITH_COMPLEX_COVERAGE_INVALID,
|
||||
'CommandsWithCoverageWrongNameNativeComponent.js':
|
||||
COMMANDS_WITH_COVERAGE_WRONG_NAME,
|
||||
'CommandsWithCoverageTypeCastInvalidNativeComponent.js':
|
||||
COMMANDS_WITH_COVERAGE_TYPE_CAST_INVALID,
|
||||
};
|
||||
|
||||
@@ -59,92 +59,6 @@ export default codegenNativeComponent<ModuleProps>('Module', {
|
||||
});
|
||||
`;
|
||||
|
||||
// Coverage instrumentation test cases - should be recognized as valid
|
||||
const COMMANDS_WITH_SIMPLE_COVERAGE = `
|
||||
// @flow
|
||||
|
||||
const codegenNativeCommands = require('codegenNativeCommands');
|
||||
const codegenNativeComponent = require('codegenNativeComponent');
|
||||
|
||||
import type {ViewProps} from 'ViewPropTypes';
|
||||
import type {NativeComponentType} from 'codegenNativeComponent';
|
||||
|
||||
type ModuleProps = $ReadOnly<{|
|
||||
...ViewProps,
|
||||
|}>;
|
||||
|
||||
type NativeType = NativeComponentType<ModuleProps>;
|
||||
|
||||
interface NativeCommands {
|
||||
+pause: (viewRef: React.ElementRef<NativeType>) => void;
|
||||
+play: (viewRef: React.ElementRef<NativeType>) => void;
|
||||
}
|
||||
|
||||
export const Commands = (cov_1234567890.s[0]++, codegenNativeCommands<NativeCommands>({
|
||||
supportedCommands: ['pause', 'play'],
|
||||
}));
|
||||
|
||||
export default codegenNativeComponent<ModuleProps>('Module');
|
||||
`;
|
||||
|
||||
const COMMANDS_WITH_COMPLEX_COVERAGE = `
|
||||
// @flow
|
||||
|
||||
const codegenNativeCommands = require('codegenNativeCommands');
|
||||
const codegenNativeComponent = require('codegenNativeComponent');
|
||||
|
||||
import type {ViewProps} from 'ViewPropTypes';
|
||||
import type {NativeComponentType} from 'codegenNativeComponent';
|
||||
|
||||
type ModuleProps = $ReadOnly<{|
|
||||
...ViewProps,
|
||||
|}>;
|
||||
|
||||
type NativeType = NativeComponentType<ModuleProps>;
|
||||
|
||||
interface NativeCommands {
|
||||
+seek: (viewRef: React.ElementRef<NativeType>, position: number) => void;
|
||||
+stop: (viewRef: React.ElementRef<NativeType>) => void;
|
||||
}
|
||||
|
||||
export const Commands = (
|
||||
cov_abcdef123().f[2]++,
|
||||
cov_abcdef123().s[5]++,
|
||||
codegenNativeCommands<NativeCommands>({
|
||||
supportedCommands: ['seek', 'stop'],
|
||||
})
|
||||
);
|
||||
|
||||
export default codegenNativeComponent<ModuleProps>('Module');
|
||||
`;
|
||||
|
||||
const COMMANDS_WITH_TYPE_CAST_COVERAGE = `
|
||||
// @flow
|
||||
|
||||
const codegenNativeCommands = require('codegenNativeCommands');
|
||||
const codegenNativeComponent = require('codegenNativeComponent');
|
||||
|
||||
import type {ViewProps} from 'ViewPropTypes';
|
||||
import type {NativeComponentType} from 'codegenNativeComponent';
|
||||
|
||||
type ModuleProps = $ReadOnly<{|
|
||||
...ViewProps,
|
||||
|}>;
|
||||
|
||||
type NativeType = NativeComponentType<ModuleProps>;
|
||||
|
||||
interface NativeCommands {
|
||||
+mute: (viewRef: React.ElementRef<NativeType>) => void;
|
||||
+unmute: (viewRef: React.ElementRef<NativeType>) => void;
|
||||
}
|
||||
|
||||
export const Commands: NativeCommands = (cov_xyz789().s[1]++, codegenNativeCommands<NativeCommands>({
|
||||
supportedCommands: ['mute', 'unmute'],
|
||||
}));
|
||||
|
||||
export default codegenNativeComponent<ModuleProps>('Module');
|
||||
`;
|
||||
|
||||
const FULL_NATIVE_COMPONENT_WITH_TYPE_EXPORT = `
|
||||
// @flow
|
||||
|
||||
@@ -193,9 +107,4 @@ module.exports = {
|
||||
'NotANativeComponent.js': NOT_A_NATIVE_COMPONENT,
|
||||
'FullNativeComponent.js': FULL_NATIVE_COMPONENT,
|
||||
'FullTypedNativeComponent.js': FULL_NATIVE_COMPONENT_WITH_TYPE_EXPORT,
|
||||
'CommandsWithSimpleCoverageNativeComponent.js': COMMANDS_WITH_SIMPLE_COVERAGE,
|
||||
'CommandsWithComplexCoverageNativeComponent.js':
|
||||
COMMANDS_WITH_COMPLEX_COVERAGE,
|
||||
'CommandsWithTypeCastCoverageNativeComponent.js':
|
||||
COMMANDS_WITH_TYPE_CAST_COVERAGE,
|
||||
};
|
||||
|
||||
@@ -1,77 +1,5 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`Babel plugin inline view configs can inline config for CommandsWithComplexCoverageNativeComponent.js 1`] = `
|
||||
"// @flow
|
||||
|
||||
const codegenNativeCommands = require('codegenNativeCommands');
|
||||
const codegenNativeComponent = require('codegenNativeComponent');
|
||||
import type { ViewProps } from 'ViewPropTypes';
|
||||
import type { NativeComponentType } from 'codegenNativeComponent';
|
||||
type ModuleProps = $ReadOnly<{|
|
||||
...ViewProps
|
||||
|}>;
|
||||
type NativeType = NativeComponentType<ModuleProps>;
|
||||
interface NativeCommands {
|
||||
+seek: (viewRef: React.ElementRef<NativeType>, position: number) => void,
|
||||
+stop: (viewRef: React.ElementRef<NativeType>) => void,
|
||||
}
|
||||
const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');
|
||||
let nativeComponentName = 'Module';
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: \\"Module\\",
|
||||
validAttributes: {}
|
||||
};
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);"
|
||||
`;
|
||||
|
||||
exports[`Babel plugin inline view configs can inline config for CommandsWithSimpleCoverageNativeComponent.js 1`] = `
|
||||
"// @flow
|
||||
|
||||
const codegenNativeCommands = require('codegenNativeCommands');
|
||||
const codegenNativeComponent = require('codegenNativeComponent');
|
||||
import type { ViewProps } from 'ViewPropTypes';
|
||||
import type { NativeComponentType } from 'codegenNativeComponent';
|
||||
type ModuleProps = $ReadOnly<{|
|
||||
...ViewProps
|
||||
|}>;
|
||||
type NativeType = NativeComponentType<ModuleProps>;
|
||||
interface NativeCommands {
|
||||
+pause: (viewRef: React.ElementRef<NativeType>) => void,
|
||||
+play: (viewRef: React.ElementRef<NativeType>) => void,
|
||||
}
|
||||
const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');
|
||||
let nativeComponentName = 'Module';
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: \\"Module\\",
|
||||
validAttributes: {}
|
||||
};
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);"
|
||||
`;
|
||||
|
||||
exports[`Babel plugin inline view configs can inline config for CommandsWithTypeCastCoverageNativeComponent.js 1`] = `
|
||||
"// @flow
|
||||
|
||||
const codegenNativeCommands = require('codegenNativeCommands');
|
||||
const codegenNativeComponent = require('codegenNativeComponent');
|
||||
import type { ViewProps } from 'ViewPropTypes';
|
||||
import type { NativeComponentType } from 'codegenNativeComponent';
|
||||
type ModuleProps = $ReadOnly<{|
|
||||
...ViewProps
|
||||
|}>;
|
||||
type NativeType = NativeComponentType<ModuleProps>;
|
||||
interface NativeCommands {
|
||||
+mute: (viewRef: React.ElementRef<NativeType>) => void,
|
||||
+unmute: (viewRef: React.ElementRef<NativeType>) => void,
|
||||
}
|
||||
const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry');
|
||||
let nativeComponentName = 'Module';
|
||||
export const __INTERNAL_VIEW_CONFIG = {
|
||||
uiViewClassName: \\"Module\\",
|
||||
validAttributes: {}
|
||||
};
|
||||
export default NativeComponentRegistry.get(nativeComponentName, () => __INTERNAL_VIEW_CONFIG);"
|
||||
`;
|
||||
|
||||
exports[`Babel plugin inline view configs can inline config for FullNativeComponent.js 1`] = `
|
||||
"// @flow
|
||||
|
||||
@@ -225,61 +153,6 @@ exports[`Babel plugin inline view configs fails on inline config for CommandsExp
|
||||
24 |"
|
||||
`;
|
||||
|
||||
exports[`Babel plugin inline view configs fails on inline config for CommandsWithComplexCoverageInvalidNativeComponent.js 1`] = `
|
||||
"/CommandsWithComplexCoverageInvalidNativeComponent.js: 'Commands' is a reserved export and may only be used to export the result of codegenNativeCommands.
|
||||
14 |
|
||||
15 | // Complex coverage instrumentation with invalid nested structure - should fail
|
||||
> 16 | export const Commands = (
|
||||
| ^
|
||||
17 | cov_xyz789().f[1]++,
|
||||
18 | cov_xyz789().s[2]++,
|
||||
19 | {"
|
||||
`;
|
||||
|
||||
exports[`Babel plugin inline view configs fails on inline config for CommandsWithCoverageInvalidNativeComponent.js 1`] = `
|
||||
"/CommandsWithCoverageInvalidNativeComponent.js: 'Commands' is a reserved export and may only be used to export the result of codegenNativeCommands.
|
||||
14 |
|
||||
15 | // Coverage instrumentation of invalid Commands export - should still fail
|
||||
> 16 | export const Commands = (cov_1234567890().s[0]++, {
|
||||
| ^
|
||||
17 | hotspotUpdate: () => {},
|
||||
18 | scrollTo: () => {},
|
||||
19 | });"
|
||||
`;
|
||||
|
||||
exports[`Babel plugin inline view configs fails on inline config for CommandsWithCoverageTypeCastInvalidNativeComponent.js 1`] = `
|
||||
"/CommandsWithCoverageTypeCastInvalidNativeComponent.js: 'Commands' is a reserved export and may only be used to export the result of codegenNativeCommands.
|
||||
19 |
|
||||
20 | // Coverage instrumentation with type cast but wrong function - should fail
|
||||
> 21 | export const Commands: NativeCommands = (cov_cast123().s[0]++, invalidFunction({
|
||||
| ^
|
||||
22 | supportedCommands: ['pause', 'play'],
|
||||
23 | }));
|
||||
24 |"
|
||||
`;
|
||||
|
||||
exports[`Babel plugin inline view configs fails on inline config for CommandsWithCoverageWrongFunctionNativeComponent.js 1`] = `
|
||||
"/CommandsWithCoverageWrongFunctionNativeComponent.js: 'Commands' is a reserved export and may only be used to export the result of codegenNativeCommands.
|
||||
14 |
|
||||
15 | // Coverage instrumentation of wrong function call - should fail
|
||||
> 16 | export const Commands = (cov_abcdef123().s[0]++, someOtherFunction({
|
||||
| ^
|
||||
17 | supportedCommands: ['pause', 'play'],
|
||||
18 | }));
|
||||
19 |"
|
||||
`;
|
||||
|
||||
exports[`Babel plugin inline view configs fails on inline config for CommandsWithCoverageWrongNameNativeComponent.js 1`] = `
|
||||
"/CommandsWithCoverageWrongNameNativeComponent.js: Native commands must be exported with the name 'Commands'
|
||||
20 |
|
||||
21 | // Coverage instrumentation with correct function but wrong export name - should fail
|
||||
> 22 | export const WrongName = (cov_wrong123().s[0]++, codegenNativeCommands<NativeCommands>({
|
||||
| ^
|
||||
23 | supportedCommands: ['pause', 'play'],
|
||||
24 | }));
|
||||
25 |"
|
||||
`;
|
||||
|
||||
exports[`Babel plugin inline view configs fails on inline config for OtherCommandsExportNativeComponent.js 1`] = `
|
||||
"/OtherCommandsExportNativeComponent.js: 'Commands' is a reserved export and may only be used to export the result of codegenNativeCommands.
|
||||
17 | }
|
||||
|
||||
@@ -24,12 +24,12 @@ try {
|
||||
} catch (e) {
|
||||
// Fallback to lib when source doesn't exit (e.g. when installed as a dev dependency)
|
||||
FlowParser =
|
||||
// $FlowFixMe[cannot-resolve-module]
|
||||
// $FlowIgnore[cannot-resolve-module]
|
||||
require('@react-native/codegen/lib/parsers/flow/parser').FlowParser;
|
||||
TypeScriptParser =
|
||||
// $FlowFixMe[cannot-resolve-module]
|
||||
// $FlowIgnore[cannot-resolve-module]
|
||||
require('@react-native/codegen/lib/parsers/typescript/parser').TypeScriptParser;
|
||||
// $FlowFixMe[cannot-resolve-module]
|
||||
// $FlowIgnore[cannot-resolve-module]
|
||||
RNCodegen = require('@react-native/codegen/lib/generators/RNCodegen');
|
||||
}
|
||||
|
||||
@@ -102,58 +102,6 @@ function isCodegenDeclaration(declaration) {
|
||||
return false;
|
||||
}
|
||||
|
||||
function isCodegenNativeCommandsDeclaration(declaration) {
|
||||
if (!declaration) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Handle direct calls: codegenNativeCommands()
|
||||
if (
|
||||
declaration.type === 'CallExpression' &&
|
||||
declaration.callee &&
|
||||
declaration.callee.type === 'Identifier' &&
|
||||
declaration.callee.name === 'codegenNativeCommands'
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Handle coverage instrumentation: (cov_xxx().s[0]++, codegenNativeCommands())
|
||||
if (declaration.type === 'SequenceExpression' && declaration.expressions) {
|
||||
// Get the last expression in the sequence (the actual function call)
|
||||
const lastExpression =
|
||||
declaration.expressions[declaration.expressions.length - 1];
|
||||
// Recursively check if the last expression is a valid codegenNativeCommands call
|
||||
return isCodegenNativeCommandsDeclaration(lastExpression);
|
||||
}
|
||||
|
||||
// Handle Flow type casts: (codegenNativeCommands(): NativeCommands)
|
||||
if (
|
||||
(declaration.type === 'TypeCastExpression' ||
|
||||
declaration.type === 'AsExpression') &&
|
||||
declaration.expression &&
|
||||
declaration.expression.type === 'CallExpression' &&
|
||||
declaration.expression.callee &&
|
||||
declaration.expression.callee.type === 'Identifier' &&
|
||||
declaration.expression.callee.name === 'codegenNativeCommands'
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Handle TypeScript assertions: codegenNativeCommands() as NativeCommands
|
||||
if (
|
||||
declaration.type === 'TSAsExpression' &&
|
||||
declaration.expression &&
|
||||
declaration.expression.type === 'CallExpression' &&
|
||||
declaration.expression.callee &&
|
||||
declaration.expression.callee.type === 'Identifier' &&
|
||||
declaration.expression.callee.name === 'codegenNativeCommands'
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
module.exports = function ({parse, types: t}) {
|
||||
return {
|
||||
pre(state) {
|
||||
@@ -177,12 +125,12 @@ module.exports = function ({parse, types: t}) {
|
||||
const firstDeclaration = path.node.declaration.declarations[0];
|
||||
|
||||
if (firstDeclaration.type === 'VariableDeclarator') {
|
||||
// Check if this is a valid codegenNativeCommands call, handling type annotations
|
||||
const isValidCommandsExport = isCodegenNativeCommandsDeclaration(
|
||||
firstDeclaration.init,
|
||||
);
|
||||
|
||||
if (isValidCommandsExport) {
|
||||
if (
|
||||
firstDeclaration.init &&
|
||||
firstDeclaration.init.type === 'CallExpression' &&
|
||||
firstDeclaration.init.callee.type === 'Identifier' &&
|
||||
firstDeclaration.init.callee.name === 'codegenNativeCommands'
|
||||
) {
|
||||
if (
|
||||
firstDeclaration.id.type === 'Identifier' &&
|
||||
firstDeclaration.id.name !== 'Commands'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/babel-plugin-codegen",
|
||||
"version": "0.83.0-main",
|
||||
"version": "0.81.0-main",
|
||||
"description": "Babel plugin to generate native module and view manager code for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -19,14 +19,14 @@
|
||||
],
|
||||
"bugs": "https://github.com/facebook/react-native/issues",
|
||||
"engines": {
|
||||
"node": ">= 20.19.4"
|
||||
"node": ">= 22.14.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/traverse": "^7.25.3",
|
||||
"@react-native/codegen": "0.83.0-main"
|
||||
"@react-native/codegen": "0.81.0-main"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.25.2"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/community-cli-plugin",
|
||||
"version": "0.83.0-main",
|
||||
"version": "0.81.0-main",
|
||||
"description": "Core CLI commands for React Native",
|
||||
"keywords": [
|
||||
"react-native",
|
||||
@@ -22,16 +22,16 @@
|
||||
"dist"
|
||||
],
|
||||
"dependencies": {
|
||||
"@react-native/dev-middleware": "0.83.0-main",
|
||||
"@react-native/dev-middleware": "0.81.0-main",
|
||||
"debug": "^4.4.0",
|
||||
"invariant": "^2.2.4",
|
||||
"metro": "^0.83.3",
|
||||
"metro-config": "^0.83.3",
|
||||
"metro-core": "^0.83.3",
|
||||
"metro": "^0.83.0",
|
||||
"metro-config": "^0.83.0",
|
||||
"metro-core": "^0.83.0",
|
||||
"semver": "^7.1.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"metro-resolver": "^0.83.3"
|
||||
"metro-resolver": "^0.83.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@react-native-community/cli": "*",
|
||||
@@ -40,12 +40,9 @@
|
||||
"peerDependenciesMeta": {
|
||||
"@react-native-community/cli": {
|
||||
"optional": true
|
||||
},
|
||||
"@react-native/metro-config": {
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 20.19.4"
|
||||
"node": ">= 22.14.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ function copyAll(filesToCopy: CopiedFiles) {
|
||||
const src = queue.shift();
|
||||
// $FlowFixMe[incompatible-type]
|
||||
const dest = filesToCopy[src];
|
||||
// $FlowFixMe[incompatible-type]
|
||||
// $FlowFixMe[incompatible-call]
|
||||
copy(src, dest, copyNext);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -31,9 +31,9 @@ type MiddlewareReturn = {
|
||||
...
|
||||
};
|
||||
|
||||
// $FlowFixMe[incompatible-type]
|
||||
// $FlowFixMe
|
||||
const unusedStubWSServer: ws$WebSocketServer = {};
|
||||
// $FlowFixMe[incompatible-type]
|
||||
// $FlowFixMe
|
||||
const unusedMiddlewareStub: Server = {};
|
||||
|
||||
const communityMiddlewareFallback = {
|
||||
@@ -80,7 +80,7 @@ try {
|
||||
'@react-native-community/cli-server-api',
|
||||
{paths: [communityCliPath]},
|
||||
);
|
||||
// $FlowFixMe[unsupported-syntax] dynamic import
|
||||
// $FlowIgnore[unsupported-syntax] dynamic import
|
||||
communityMiddlewareFallback.createDevServerMiddleware = require(
|
||||
communityCliServerApiPath,
|
||||
).createDevServerMiddleware as CreateDevServerMiddleware;
|
||||
|
||||
@@ -92,14 +92,14 @@ async function runServer(
|
||||
console.info(`Starting dev server on ${devServerUrl}\n`);
|
||||
|
||||
if (args.assetPlugins) {
|
||||
// $FlowFixMe[cannot-write] Assigning to readonly property
|
||||
// $FlowIgnore[cannot-write] Assigning to readonly property
|
||||
metroConfig.transformer.assetPlugins = args.assetPlugins.map(plugin =>
|
||||
require.resolve(plugin),
|
||||
);
|
||||
}
|
||||
// TODO(T214991636): Remove legacy Metro log forwarding
|
||||
if (!args.clientLogs) {
|
||||
// $FlowFixMe[cannot-write] Assigning to readonly property
|
||||
// $FlowIgnore[cannot-write] Assigning to readonly property
|
||||
metroConfig.server.forwardClientLogs = false;
|
||||
}
|
||||
|
||||
@@ -119,6 +119,7 @@ async function runServer(
|
||||
watchFolders,
|
||||
});
|
||||
const {middleware, websocketEndpoints} = createDevMiddleware({
|
||||
projectRoot,
|
||||
serverBaseUrl: devServerUrl,
|
||||
logger: createDevMiddlewareLogger(terminalReporter),
|
||||
});
|
||||
@@ -126,8 +127,6 @@ async function runServer(
|
||||
const reporter: Reporter = {
|
||||
update(event: TerminalReportableEvent) {
|
||||
terminalReporter.update(event);
|
||||
/* $FlowFixMe[constant-condition] Error discovered during Constant
|
||||
* Condition roll out. See https://fburl.com/workplace/1v97vimq. */
|
||||
if (reportEvent) {
|
||||
reportEvent(event);
|
||||
}
|
||||
@@ -145,7 +144,7 @@ async function runServer(
|
||||
}
|
||||
},
|
||||
};
|
||||
// $FlowFixMe[cannot-write] Assigning to readonly property
|
||||
// $FlowIgnore[cannot-write] Assigning to readonly property
|
||||
metroConfig.reporter = reporter;
|
||||
|
||||
await Metro.runServer(metroConfig, {
|
||||
@@ -174,7 +173,7 @@ function getReporterImpl(
|
||||
try {
|
||||
// First we let require resolve it, so we can require packages in node_modules
|
||||
// as expected. eg: require('my-package/reporter');
|
||||
// $FlowFixMe[unsupported-syntax]
|
||||
// $FlowIgnore[unsupported-syntax]
|
||||
return require(customLogReporterPath);
|
||||
} catch (e) {
|
||||
if (e.code !== 'MODULE_NOT_FOUND') {
|
||||
@@ -182,7 +181,7 @@ function getReporterImpl(
|
||||
}
|
||||
// If that doesn't work, then we next try relative to the cwd, eg:
|
||||
// require('./reporter');
|
||||
// $FlowFixMe[unsupported-syntax]
|
||||
// $FlowIgnore[unsupported-syntax]
|
||||
return require(path.resolve(customLogReporterPath));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,6 +88,7 @@ Diff: ${styleText(['dim', 'underline'], newVersion?.diffUrl ?? 'none')}
|
||||
}
|
||||
}
|
||||
|
||||
// $FlowFixMe
|
||||
function isDiffPurgeEntry(data: Partial<DiffPurge>): data is DiffPurge {
|
||||
return (
|
||||
// $FlowFixMe[incompatible-type-guard]
|
||||
@@ -152,7 +153,7 @@ function buildDiffUrl(oldVersion: string, newVersion: string) {
|
||||
* Returns the most recent React Native version available to upgrade to.
|
||||
*/
|
||||
async function getLatestRnDiffPurgeVersion(): Promise<LatestVersions | void> {
|
||||
const options: RequestOptions = {
|
||||
const options = {
|
||||
// https://developer.github.com/v3/#user-agent-required
|
||||
headers: {'User-Agent': '@react-native/community-cli-plugin'} as Headers,
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/core-cli-utils",
|
||||
"version": "0.83.0-main",
|
||||
"version": "0.81.0-main",
|
||||
"description": "React Native CLI library for Frameworks to build on",
|
||||
"license": "MIT",
|
||||
"main": "./src/index.flow.js",
|
||||
@@ -21,7 +21,7 @@
|
||||
],
|
||||
"bugs": "https://github.com/facebook/react-native/issues",
|
||||
"engines": {
|
||||
"node": ">= 20.19.4"
|
||||
"node": ">= 22.14.0"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
|
||||
@@ -71,7 +71,7 @@ const FIRST = 1,
|
||||
FOURTH = 4;
|
||||
|
||||
function getNodePackagePath(packageName: string): string {
|
||||
// $FlowFixMe[prop-missing] type definition is incomplete
|
||||
// $FlowIgnore[prop-missing] type definition is incomplete
|
||||
return require.resolve(packageName, {cwd: [process.cwd(), ...module.paths]});
|
||||
}
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ const FIRST = 1,
|
||||
FIFTH = 5;
|
||||
|
||||
function getNodePackagePath(packageName: string): string {
|
||||
// $FlowFixMe[prop-missing] type definition is incomplete
|
||||
// $FlowIgnore[prop-missing] type definition is incomplete
|
||||
return require.resolve(packageName, {cwd: [process.cwd(), ...module.paths]});
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
@generated SignedSource<<4bb67766e15e25a481c4c38873260a7a>>
|
||||
Git revision: 7aa57d13e50ce9d74a91c9315c9b0ded00fbc19f
|
||||
@generated SignedSource<<e2d97b04634bf3b566f33d455f38658f>>
|
||||
Git revision: 8dc0d5b365e6b4600b78e5a7381aa861d8c1c81e
|
||||
Built with --nohooks: false
|
||||
Is local checkout: false
|
||||
Remote URL: https://github.com/facebook/react-native-devtools-frontend
|
||||
|
||||
packages/debugger-frontend/dist/third-party/front_end/Images/react_native/learn-debugging-basics.jpg
Vendored
BIN
Binary file not shown.
|
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 53 KiB |
packages/debugger-frontend/dist/third-party/front_end/Images/react_native/learn-native-debugging.jpg
Vendored
BIN
Binary file not shown.
|
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 66 KiB |
BIN
Binary file not shown.
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 7.1 KiB |
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -1 +1 @@
|
||||
import*as e from"../root/root.js";const t=e.Runtime.RNExperimentName,i={didInitializeExperiments:!1,isReactNativeEntryPoint:!1};class n{name;title;unstable;docLink;feedbackLink;enabledByDefault;constructor(e){this.name=e.name,this.title=e.title,this.unstable=e.unstable,this.docLink=e.docLink,this.feedbackLink=e.feedbackLink,this.enabledByDefault=function(e,t){if(null==e)return()=>t;if("boolean"==typeof e)return()=>e;return e}(e.enabledByDefault,!1)}}const r=new class{#e=new Map;#t=new Set;register(e){if(i.didInitializeExperiments)throw new Error("Experiments must be registered before constructing MainImpl");const{name:t}=e;if(this.#e.has(t))throw new Error(`React Native Experiment ${t} is already registered`);this.#e.set(t,new n(e))}enableExperimentsByDefault(e){if(i.didInitializeExperiments)throw new Error("Experiments must be configured before constructing MainImpl");for(const i of e)if(Object.prototype.hasOwnProperty.call(t,i)){const e=this.#e.get(i);if(!e)throw new Error(`React Native Experiment ${i} is not registered`);e.enabledByDefault=()=>!0}else this.#t.add(i)}copyInto(e,t=""){for(const[n,r]of this.#e)e.register(n,t+r.title,r.unstable,r.docLink,r.feedbackLink),r.enabledByDefault({isReactNativeEntryPoint:i.isReactNativeEntryPoint})&&e.enableExperimentsByDefault([n]);for(const t of this.#t)e.enableExperimentsByDefault([t]);i.didInitializeExperiments=!0}};r.register({name:t.JS_HEAP_PROFILER_ENABLE,title:"Enable Heap Profiler (Memory Panel)",unstable:!1,enabledByDefault:({isReactNativeEntryPoint:e})=>!e}),r.register({name:t.REACT_NATIVE_SPECIFIC_UI,title:"Show React Native-specific UI",unstable:!1,enabledByDefault:({isReactNativeEntryPoint:e})=>e}),r.register({name:t.ENABLE_NETWORK_PANEL,title:"Enable Network panel",unstable:!0,enabledByDefault:()=>!1});var a=Object.freeze({__proto__:null,Instance:r,RNExperimentName:t,setIsReactNativeEntryPoint:function(e){if(i.didInitializeExperiments)throw new Error("setIsReactNativeEntryPoint must be called before constructing MainImpl");i.isReactNativeEntryPoint=e}});export{a as RNExperimentsImpl};
|
||||
import*as e from"../root/root.js";const t=e.Runtime.RNExperimentName,n={didInitializeExperiments:!1,isReactNativeEntryPoint:!1};class i{name;title;unstable;docLink;feedbackLink;enabledByDefault;constructor(e){this.name=e.name,this.title=e.title,this.unstable=e.unstable,this.docLink=e.docLink,this.feedbackLink=e.feedbackLink,this.enabledByDefault=function(e,t){if(null==e)return()=>t;if("boolean"==typeof e)return()=>e;return e}(e.enabledByDefault,!1)}}const r=new class{#e=new Map;#t=new Set;register(e){if(n.didInitializeExperiments)throw new Error("Experiments must be registered before constructing MainImpl");const{name:t}=e;if(this.#e.has(t))throw new Error(`React Native Experiment ${t} is already registered`);this.#e.set(t,new i(e))}enableExperimentsByDefault(e){if(n.didInitializeExperiments)throw new Error("Experiments must be configured before constructing MainImpl");for(const n of e)if(Object.prototype.hasOwnProperty.call(t,n)){const e=this.#e.get(n);if(!e)throw new Error(`React Native Experiment ${n} is not registered`);e.enabledByDefault=()=>!0}else this.#t.add(n)}copyInto(e,t=""){for(const[i,r]of this.#e)e.register(i,t+r.title,r.unstable,r.docLink,r.feedbackLink),r.enabledByDefault({isReactNativeEntryPoint:n.isReactNativeEntryPoint})&&e.enableExperimentsByDefault([i]);for(const t of this.#t)e.enableExperimentsByDefault([t]);n.didInitializeExperiments=!0}};r.register({name:t.JS_HEAP_PROFILER_ENABLE,title:"Enable Heap Profiler (Memory Panel)",unstable:!1,enabledByDefault:({isReactNativeEntryPoint:e})=>!e}),r.register({name:t.REACT_NATIVE_SPECIFIC_UI,title:"Show React Native-specific UI",unstable:!1,enabledByDefault:({isReactNativeEntryPoint:e})=>e}),r.register({name:t.ENABLE_PERFORMANCE_PANEL,title:"Enable Performance panel",unstable:!0,enabledByDefault:({isReactNativeEntryPoint:e})=>!e}),r.register({name:t.ENABLE_NETWORK_PANEL,title:"Enable Network panel",unstable:!0,enabledByDefault:()=>!1});var a=Object.freeze({__proto__:null,Instance:r,RNExperimentName:t,setIsReactNativeEntryPoint:function(e){if(n.didInitializeExperiments)throw new Error("setIsReactNativeEntryPoint must be called before constructing MainImpl");n.isReactNativeEntryPoint=e}});export{a as RNExperimentsImpl};
|
||||
|
||||
@@ -1 +1 @@
|
||||
import*as e from"../platform/platform.js";const t=new URLSearchParams(location.search);let n,r,s="";function a(){return window.location.pathname}function i(e){return["node_app","js_app"].some((t=>e.includes(t)))}class o{constructor(){}static instance(e={forceNew:null}){const{forceNew:t}=e;return n&&!t||(n=new o),n}static removeInstance(){n=void 0}static queryParam(e){return t.get(e)}static setQueryParamForTesting(e,n){t.set(e,n)}static isNode(){return void 0===r&&(r=i(a())),r}static setPlatform(e){s=e}static platform(){return s}static isDescriptorEnabled(e){const{experiment:t}=e;if("*"===t)return!0;if(t&&t.startsWith("!")&&h.isEnabled(t.substring(1)))return!1;if(t&&!t.startsWith("!")&&!h.isEnabled(t))return!1;const{condition:n}=e;return!n||n(_)}loadLegacyModule(e){console.log("Loading legacy module: "+e);return import(`../../${e}`).then((t=>(console.log("Loaded legacy module: "+e),t)))}}class l{#e=[];#t=new Set;#n=new Set;#r=new Set;#s=new Set;#a=new c;allConfigurableExperiments(){const e=[];for(const t of this.#e)this.#n.has(t.name)||e.push(t);return e}register(t,n,r,s,a){if(this.#t.has(t))throw new Error(`Duplicate registration of experiment '${t}'`);this.#t.add(t),this.#e.push(new m(this,t,n,Boolean(r),s??e.DevToolsPath.EmptyUrlString,a??e.DevToolsPath.EmptyUrlString))}isEnabled(e){return this.checkExperiment(e),!1!==this.#a.get(e)&&(!(!this.#n.has(e)&&!this.#r.has(e))||(!!this.#s.has(e)||Boolean(this.#a.get(e))))}setEnabled(e,t){this.checkExperiment(e),this.#a.set(e,t)}enableExperimentsTransiently(e){for(const t of e)this.checkExperiment(t),this.#n.add(t)}enableExperimentsByDefault(e){for(const t of e)this.checkExperiment(t),this.#r.add(t)}setServerEnabledExperiments(e){for(const t of e)this.checkExperiment(t),this.#s.add(t)}enableForTest(e){this.checkExperiment(e),this.#n.add(e)}disableForTest(e){this.checkExperiment(e),this.#n.delete(e)}clearForTest(){this.#e=[],this.#t.clear(),this.#n.clear(),this.#r.clear(),this.#s.clear()}cleanUpStaleExperiments(){this.#a.cleanUpStaleExperiments(this.#t)}checkExperiment(e){if(!this.#t.has(e))throw new Error(`Unknown experiment '${e}'`)}}class c{#e={};constructor(){try{const e=self.localStorage?.getItem("experiments");e&&(this.#e=JSON.parse(e))}catch{console.error("Failed to parse localStorage['experiments']")}}get(e){return this.#e[e]}set(e,t){this.#e[e]=t,this.#i()}cleanUpStaleExperiments(e){for(const[t]of Object.entries(this.#e))e.has(t)||delete this.#e[t];this.#i()}#i(){self.localStorage?.setItem("experiments",JSON.stringify(this.#e))}}class m{name;title;unstable;docLink;feedbackLink;#e;constructor(e,t,n,r,s,a){this.name=t,this.title=n,this.unstable=r,this.docLink=s,this.feedbackLink=a,this.#e=e}isEnabled(){return this.#e.isEnabled(this.name)}setEnabled(e){this.#e.setEnabled(this.name,e)}}const h=new l;var E,p,d,u;!function(e){e.REACT_NATIVE_SPECIFIC_UI="react-native-specific-ui",e.JS_HEAP_PROFILER_ENABLE="js-heap-profiler-enable",e.ENABLE_NETWORK_PANEL="enable-network-panel"}(E||(E={})),function(e){e.NOT_SOURCES_HIDE_ADD_FOLDER="!sources.hide_add_folder",e.REACT_NATIVE_UNSTABLE_NETWORK_PANEL="unstable_enableNetworkPanel"}(p||(p={})),function(e){e[e.ALLOW=0]="ALLOW",e[e.ALLOW_WITHOUT_LOGGING=1]="ALLOW_WITHOUT_LOGGING",e[e.DISABLE=2]="DISABLE"}(d||(d={})),function(e){e.ALL_SCRIPTS="ALL_SCRIPTS",e.SIDE_EFFECT_FREE_SCRIPTS_ONLY="SIDE_EFFECT_FREE_SCRIPTS_ONLY",e.NO_SCRIPTS="NO_SCRIPTS"}(u||(u={}));const _=Object.create(null),f={canDock:()=>Boolean(o.queryParam("can_dock")),notSourcesHideAddFolder:()=>Boolean(o.queryParam(p.NOT_SOURCES_HIDE_ADD_FOLDER)),reactNativeUnstableNetworkPanel:()=>Boolean(o.queryParam(p.REACT_NATIVE_UNSTABLE_NETWORK_PANEL))||h.isEnabled("enable-network-panel")};var x=Object.freeze({__proto__:null,get ConditionName(){return p},Experiment:m,ExperimentsSupport:l,get GenAiEnterprisePolicyValue(){return d},get HostConfigFreestylerExecutionMode(){return u},get RNExperimentName(){return E},Runtime:o,conditions:f,experiments:h,getChromeVersion:()=>{const e=navigator.userAgent.match(/(?:^|\W)(?:Chrome|HeadlessChrome)\/(\S+)/);return e&&e.length>1?e[1]:""},getPathName:a,getRemoteBase:function(e=self.location.toString()){const t=new URL(e).searchParams.get("remoteBase");if(!t)return null;const n=/\/serve_file\/(@[0-9a-zA-Z]+)\/?$/.exec(t);return n?{base:`devtools://devtools/remote/serve_file/${n[1]}/`,version:n[1]}:null},hostConfig:_,isNodeEntry:i});export{x as Runtime};
|
||||
import*as e from"../platform/platform.js";const t=new URLSearchParams(location.search);let n,r,s="";function a(){return window.location.pathname}function i(e){return["node_app","js_app"].some((t=>e.includes(t)))}class o{constructor(){}static instance(e={forceNew:null}){const{forceNew:t}=e;return n&&!t||(n=new o),n}static removeInstance(){n=void 0}static queryParam(e){return t.get(e)}static setQueryParamForTesting(e,n){t.set(e,n)}static isNode(){return void 0===r&&(r=i(a())),r}static setPlatform(e){s=e}static platform(){return s}static isDescriptorEnabled(e){const{experiment:t}=e;if("*"===t)return!0;if(t&&t.startsWith("!")&&h.isEnabled(t.substring(1)))return!1;if(t&&!t.startsWith("!")&&!h.isEnabled(t))return!1;const{condition:n}=e;return!n||n(_)}loadLegacyModule(e){console.log("Loading legacy module: "+e);return import(`../../${e}`).then((t=>(console.log("Loaded legacy module: "+e),t)))}}class l{#e=[];#t=new Set;#n=new Set;#r=new Set;#s=new Set;#a=new c;allConfigurableExperiments(){const e=[];for(const t of this.#e)this.#n.has(t.name)||e.push(t);return e}register(t,n,r,s,a){if(this.#t.has(t))throw new Error(`Duplicate registration of experiment '${t}'`);this.#t.add(t),this.#e.push(new m(this,t,n,Boolean(r),s??e.DevToolsPath.EmptyUrlString,a??e.DevToolsPath.EmptyUrlString))}isEnabled(e){return this.checkExperiment(e),!1!==this.#a.get(e)&&(!(!this.#n.has(e)&&!this.#r.has(e))||(!!this.#s.has(e)||Boolean(this.#a.get(e))))}setEnabled(e,t){this.checkExperiment(e),this.#a.set(e,t)}enableExperimentsTransiently(e){for(const t of e)this.checkExperiment(t),this.#n.add(t)}enableExperimentsByDefault(e){for(const t of e)this.checkExperiment(t),this.#r.add(t)}setServerEnabledExperiments(e){for(const t of e)this.checkExperiment(t),this.#s.add(t)}enableForTest(e){this.checkExperiment(e),this.#n.add(e)}disableForTest(e){this.checkExperiment(e),this.#n.delete(e)}clearForTest(){this.#e=[],this.#t.clear(),this.#n.clear(),this.#r.clear(),this.#s.clear()}cleanUpStaleExperiments(){this.#a.cleanUpStaleExperiments(this.#t)}checkExperiment(e){if(!this.#t.has(e))throw new Error(`Unknown experiment '${e}'`)}}class c{#e={};constructor(){try{const e=self.localStorage?.getItem("experiments");e&&(this.#e=JSON.parse(e))}catch{console.error("Failed to parse localStorage['experiments']")}}get(e){return this.#e[e]}set(e,t){this.#e[e]=t,this.#i()}cleanUpStaleExperiments(e){for(const[t]of Object.entries(this.#e))e.has(t)||delete this.#e[t];this.#i()}#i(){self.localStorage?.setItem("experiments",JSON.stringify(this.#e))}}class m{name;title;unstable;docLink;feedbackLink;#e;constructor(e,t,n,r,s,a){this.name=t,this.title=n,this.unstable=r,this.docLink=s,this.feedbackLink=a,this.#e=e}isEnabled(){return this.#e.isEnabled(this.name)}setEnabled(e){this.#e.setEnabled(this.name,e)}}const h=new l;var E,p,d,u;!function(e){e.REACT_NATIVE_SPECIFIC_UI="react-native-specific-ui",e.JS_HEAP_PROFILER_ENABLE="js-heap-profiler-enable",e.ENABLE_PERFORMANCE_PANEL="enable-performance-panel",e.ENABLE_NETWORK_PANEL="enable-network-panel"}(E||(E={})),function(e){e.NOT_SOURCES_HIDE_ADD_FOLDER="!sources.hide_add_folder",e.REACT_NATIVE_UNSTABLE_NETWORK_PANEL="unstable_enableNetworkPanel"}(p||(p={})),function(e){e[e.ALLOW=0]="ALLOW",e[e.ALLOW_WITHOUT_LOGGING=1]="ALLOW_WITHOUT_LOGGING",e[e.DISABLE=2]="DISABLE"}(d||(d={})),function(e){e.ALL_SCRIPTS="ALL_SCRIPTS",e.SIDE_EFFECT_FREE_SCRIPTS_ONLY="SIDE_EFFECT_FREE_SCRIPTS_ONLY",e.NO_SCRIPTS="NO_SCRIPTS"}(u||(u={}));const _=Object.create(null),f={canDock:()=>Boolean(o.queryParam("can_dock")),notSourcesHideAddFolder:()=>Boolean(o.queryParam(p.NOT_SOURCES_HIDE_ADD_FOLDER)),reactNativeUnstableNetworkPanel:()=>Boolean(o.queryParam(p.REACT_NATIVE_UNSTABLE_NETWORK_PANEL))||h.isEnabled("enable-network-panel")};var x=Object.freeze({__proto__:null,get ConditionName(){return p},Experiment:m,ExperimentsSupport:l,get GenAiEnterprisePolicyValue(){return d},get HostConfigFreestylerExecutionMode(){return u},get RNExperimentName(){return E},Runtime:o,conditions:f,experiments:h,getChromeVersion:()=>{const e=navigator.userAgent.match(/(?:^|\W)(?:Chrome|HeadlessChrome)\/(\S+)/);return e&&e.length>1?e[1]:""},getPathName:a,getRemoteBase:function(e=self.location.toString()){const t=new URL(e).searchParams.get("remoteBase");if(!t)return null;const n=/\/serve_file\/(@[0-9a-zA-Z]+)\/?$/.exec(t);return n?{base:`devtools://devtools/remote/serve_file/${n[1]}/`,version:n[1]}:null},hostConfig:_,isNodeEntry:i});export{x as Runtime};
|
||||
|
||||
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+2
-2
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -238,7 +238,7 @@ import"../../ui/components/icon_button/icon_button.js";import"../../ui/component
|
||||
<td>${e.method}</td>
|
||||
<td>${e.params?d`<code>${JSON.stringify(e.params)}</code>`:""}</td>
|
||||
<td>
|
||||
${e.result?d`<code>${JSON.stringify(e.result)}</code>`:e.error?d`<code>${JSON.stringify(e.error)}</code>`:"id"in e?"(pending)":""}
|
||||
${e.result?d`<code>${JSON.stringify(e.result)}</code>`:e.error?d`<code>${JSON.stringify(e.error)}</code>`:"(pending)"}
|
||||
</td>
|
||||
<td data-value=${e.elapsedTime||0}>
|
||||
${"id"in e?e.elapsedTime?U(A.sMs,{PH1:String(e.elapsedTime)}):"(pending)":""}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user