mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Compare commits
50
Commits
v0.75.0-rc.6
...
v0.75.3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4968798538 | ||
|
|
16575babf8 | ||
|
|
cf7b9b9486 | ||
|
|
8734cff95e | ||
|
|
33d12c1737 | ||
|
|
6a08c38263 | ||
|
|
8c732ddf1b | ||
|
|
4fb43c343f | ||
|
|
61fdd51c50 | ||
|
|
1067798a7e | ||
|
|
39222b41cb | ||
|
|
2a567cb546 | ||
|
|
bfb7e16aa3 | ||
|
|
d4bb5820bd | ||
|
|
af5002b2e1 | ||
|
|
6eb2836f61 | ||
|
|
38d7549788 | ||
|
|
3c811d8465 | ||
|
|
58008464c1 | ||
|
|
31a99388de | ||
|
|
44158de822 | ||
|
|
aa7296c008 | ||
|
|
a276df4d2a | ||
|
|
2e994fdddb | ||
|
|
1cea8e8027 | ||
|
|
196399bb93 | ||
|
|
35daa07c39 | ||
|
|
c22803ac5f | ||
|
|
0979921850 | ||
|
|
02d9979c32 | ||
|
|
45cd81706d | ||
|
|
b5b57731d3 | ||
|
|
c1cee11932 | ||
|
|
077815358d | ||
|
|
8ab64afd3a | ||
|
|
d94d447777 | ||
|
|
41b188b7e6 | ||
|
|
a3187bb5d9 | ||
|
|
f202e80177 | ||
|
|
8c4f240c9b | ||
|
|
b64f5498f6 | ||
|
|
efe8a5e85a | ||
|
|
89cdc14c8b | ||
|
|
9120cd30f2 | ||
|
|
34c91036e1 | ||
|
|
82ddf5d532 | ||
|
|
7244893b12 | ||
|
|
b0662b3c33 | ||
|
|
6250409a62 | ||
|
|
b62bfcd561 |
@@ -61,7 +61,7 @@ references:
|
||||
dependency_versions:
|
||||
xcode_version: &xcode_version "15.2"
|
||||
nodelts_image: &nodelts_image "cimg/node:20.2.0"
|
||||
nodeprevlts_image: &nodeprevlts_image "cimg/node:18.12.1"
|
||||
nodeprevlts_image: &nodeprevlts_image "cimg/node:18.18.2"
|
||||
nodelts_browser_image: &nodelts_browser_image "cimg/node:20.2.0-browsers"
|
||||
|
||||
# -------------------------
|
||||
|
||||
@@ -32,7 +32,7 @@ runs:
|
||||
GIT_PAGER=cat git show HEAD
|
||||
- name: Update "latest" tag if needed
|
||||
shell: bash
|
||||
if: ${{ inputs.tag == 'latest' }}
|
||||
if: ${{ inputs.is_latest_on_npm == 'true' }}
|
||||
run: |
|
||||
git tag -d "latest"
|
||||
git push origin :latest
|
||||
|
||||
@@ -86,7 +86,7 @@ runs:
|
||||
echo ${{ steps.hermes-version.outputs.version }}
|
||||
|
||||
- name: Upload Hermes artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: hermes-workspace
|
||||
path: |
|
||||
|
||||
@@ -134,7 +134,7 @@ runs:
|
||||
XCRESULT_PATH=$(find . -name '*.xcresult')
|
||||
tar -zcvf xcresults.tar.gz $XCRESULT_PATH
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v2.2.4
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
if: ${{ inputs.run-unit-tests == true }}
|
||||
with:
|
||||
name: xcresults
|
||||
@@ -146,7 +146,7 @@ runs:
|
||||
platform: ios
|
||||
- name: Store test results
|
||||
if: ${{ inputs.run-unit-tests == true }}
|
||||
uses: actions/upload-artifact@v2.2.4
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: test-results
|
||||
path: ./reports/junit
|
||||
|
||||
@@ -25,6 +25,8 @@ jobs:
|
||||
uses: actions/checkout@v4.1.1
|
||||
with:
|
||||
token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
|
||||
fetch-tags: 'true'
|
||||
fetch-depth: 0
|
||||
- name: Check if on stable branch
|
||||
id: check_stable_branch
|
||||
run: |
|
||||
|
||||
@@ -109,7 +109,7 @@ jobs:
|
||||
uses: actions/cache/restore@v4.0.0
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_${{ matrix.slice }}_${{ matrix.flavor }}
|
||||
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-${{ matrix.slice }}-${{ matrix.flavor }}
|
||||
key: v5-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-${{ matrix.slice }}-${{ matrix.flavor }}
|
||||
- name: Build the Hermes ${{ matrix.slice }} frameworks
|
||||
run: |
|
||||
cd ./packages/react-native/sdks/hermes || exit 1
|
||||
@@ -163,17 +163,21 @@ jobs:
|
||||
echo "Please try again"
|
||||
exit 1
|
||||
fi
|
||||
- name: Compress slices to preserve Symlinks
|
||||
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 (${{ matrix.slice }}, ${{ matrix.flavor }}}
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: slice-${{ matrix.slice }}-${{ matrix.flavor }}
|
||||
path: ./packages/react-native/sdks/hermes/build_${{ matrix.slice }}_${{ matrix.flavor }}
|
||||
path: ./packages/react-native/sdks/hermes/build_${{ matrix.slice }}_${{ matrix.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.0.0
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_${{ matrix.slice }}_${{ matrix.flavor }}
|
||||
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-${{ matrix.slice }}-${{ matrix.flavor }}
|
||||
key: v5-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-${{ matrix.slice }}-${{ matrix.flavor }}
|
||||
|
||||
build_hermes_macos:
|
||||
runs-on: macos-13
|
||||
@@ -198,7 +202,7 @@ jobs:
|
||||
- name: Restore Cached Artifacts
|
||||
uses: actions/cache/restore@v4.0.0
|
||||
with:
|
||||
key: v2-hermes-osx-bin-${{ matrix.flavor }}-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
key: v3-hermes-artifacts-${{ matrix.flavor }}-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
path: |
|
||||
/tmp/hermes/osx-bin/${{ matrix.flavor }}
|
||||
/tmp/hermes/dSYM/${{ matrix.flavor }}
|
||||
@@ -227,38 +231,49 @@ jobs:
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_macosx_${{ matrix.flavor }}
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
name: slice-macosx-${{ matrix.flavor }}
|
||||
- name: Slice cache iphoneos
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_iphoneos_${{ matrix.flavor }}
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
name: slice-iphoneos-${{ matrix.flavor }}
|
||||
- name: Slice cache iphonesimulator
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_iphonesimulator_${{ matrix.flavor }}
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
name: slice-iphonesimulator-${{ matrix.flavor }}
|
||||
- name: Slice cache catalyst
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_catalyst_${{ matrix.flavor }}
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
name: slice-catalyst-${{ matrix.flavor }}
|
||||
- name: Slice cache xros
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_xros_${{ matrix.flavor }}
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
name: slice-xros-${{ matrix.flavor }}
|
||||
- name: Slice cache xrsimulator
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_xrsimulator_${{ matrix.flavor }}
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
name: slice-xrsimulator-${{ matrix.flavor }}
|
||||
- name: Unzip slices
|
||||
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_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' }}
|
||||
run: |
|
||||
@@ -358,7 +373,7 @@ jobs:
|
||||
uses: actions/cache/save@v4.0.0
|
||||
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }} # To avoid that the cache explode.
|
||||
with:
|
||||
key: v2-hermes-artifacts-${{ matrix.flavor }}-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
key: v3-hermes-artifacts-${{ matrix.flavor }}-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
path: |
|
||||
/tmp/hermes/osx-bin/${{ matrix.flavor }}
|
||||
/tmp/hermes/dSYM/${{ matrix.flavor }}
|
||||
@@ -403,7 +418,7 @@ jobs:
|
||||
cp /tmp/hermes/build/bin/hermesc /tmp/hermes/linux64-bin/.
|
||||
fi
|
||||
- name: Upload linux artifacts
|
||||
uses: actions/upload-artifact@v4.3.0
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: hermes-linux-bin
|
||||
path: /tmp/hermes/linux64-bin
|
||||
@@ -491,7 +506,7 @@ jobs:
|
||||
Write-Host "Skipping; Clean c:\tmp\hermes\win64-bin to rebuild."
|
||||
}
|
||||
- name: Upload windows artifacts
|
||||
uses: actions/upload-artifact@v4.3.0
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: hermes-win64-bin
|
||||
path: D:\tmp\hermes\win64-bin\
|
||||
@@ -527,7 +542,7 @@ jobs:
|
||||
shell: bash
|
||||
- name: Upload test results
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@v4.3.0
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: build-android-results
|
||||
compression-level: 1
|
||||
@@ -537,7 +552,7 @@ jobs:
|
||||
packages/react-native/ReactAndroid/build/reports
|
||||
- name: Upload RNTester APK
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@v4.3.0
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: rntester-apk
|
||||
path: packages/rn-tester/android/app/build/outputs/apk/
|
||||
|
||||
@@ -106,7 +106,7 @@ jobs:
|
||||
uses: actions/cache/restore@v4.0.0
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_${{ matrix.slice }}_${{ matrix.flavor }}
|
||||
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-${{ matrix.slice }}-${{ matrix.flavor }}
|
||||
key: v5-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-${{ matrix.slice }}-${{ matrix.flavor }}
|
||||
- name: Build the Hermes ${{ matrix.slice }} frameworks
|
||||
run: |
|
||||
cd ./packages/react-native/sdks/hermes || exit 1
|
||||
@@ -160,17 +160,21 @@ jobs:
|
||||
echo "Please try again"
|
||||
exit 1
|
||||
fi
|
||||
- name: Compress slices to preserve Symlinks
|
||||
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 (${{ matrix.slice }}, ${{ matrix.flavor }}}
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: slice-${{ matrix.slice }}-${{ matrix.flavor }}
|
||||
path: ./packages/react-native/sdks/hermes/build_${{ matrix.slice }}_${{ matrix.flavor }}
|
||||
path: ./packages/react-native/sdks/hermes/build_${{ matrix.slice }}_${{ matrix.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.0.0
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_${{ matrix.slice }}_${{ matrix.flavor }}
|
||||
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-${{ matrix.slice }}-${{ matrix.flavor }}
|
||||
key: v5-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-${{ matrix.slice }}-${{ matrix.flavor }}
|
||||
|
||||
build_hermes_macos:
|
||||
runs-on: macos-13
|
||||
@@ -195,7 +199,7 @@ jobs:
|
||||
- name: Restore Cached Artifacts
|
||||
uses: actions/cache/restore@v4.0.0
|
||||
with:
|
||||
key: v2-hermes-osx-bin-${{ matrix.flavor }}-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
key: v3-hermes-artifacts-${{ matrix.flavor }}-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
path: |
|
||||
/tmp/hermes/osx-bin/${{ matrix.flavor }}
|
||||
/tmp/hermes/dSYM/${{ matrix.flavor }}
|
||||
@@ -224,38 +228,49 @@ jobs:
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_macosx_${{ matrix.flavor }}
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
name: slice-macosx-${{ matrix.flavor }}
|
||||
- name: Slice cache iphoneos
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_iphoneos_${{ matrix.flavor }}
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
name: slice-iphoneos-${{ matrix.flavor }}
|
||||
- name: Slice cache iphonesimulator
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_iphonesimulator_${{ matrix.flavor }}
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
name: slice-iphonesimulator-${{ matrix.flavor }}
|
||||
- name: Slice cache catalyst
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_catalyst_${{ matrix.flavor }}
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
name: slice-catalyst-${{ matrix.flavor }}
|
||||
- name: Slice cache xros
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_xros_${{ matrix.flavor }}
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
name: slice-xros-${{ matrix.flavor }}
|
||||
- name: Slice cache xrsimulator
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_xrsimulator_${{ matrix.flavor }}
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
name: slice-xrsimulator-${{ matrix.flavor }}
|
||||
- name: Unzip slices
|
||||
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_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' }}
|
||||
run: |
|
||||
@@ -355,7 +370,7 @@ jobs:
|
||||
uses: actions/cache/save@v4.0.0
|
||||
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }} # To avoid that the cache explode.
|
||||
with:
|
||||
key: v2-hermes-artifacts-${{ matrix.flavor }}-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
key: v3-hermes-artifacts-${{ matrix.flavor }}-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
path: |
|
||||
/tmp/hermes/osx-bin/${{ matrix.flavor }}
|
||||
/tmp/hermes/dSYM/${{ matrix.flavor }}
|
||||
@@ -400,7 +415,7 @@ jobs:
|
||||
cp /tmp/hermes/build/bin/hermesc /tmp/hermes/linux64-bin/.
|
||||
fi
|
||||
- name: Upload linux artifacts
|
||||
uses: actions/upload-artifact@v4.3.0
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: hermes-linux-bin
|
||||
path: /tmp/hermes/linux64-bin
|
||||
@@ -488,7 +503,7 @@ jobs:
|
||||
Write-Host "Skipping; Clean c:\tmp\hermes\win64-bin to rebuild."
|
||||
}
|
||||
- name: Upload windows artifacts
|
||||
uses: actions/upload-artifact@v4.3.0
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: hermes-win64-bin
|
||||
path: D:\tmp\hermes\win64-bin\
|
||||
@@ -526,7 +541,7 @@ jobs:
|
||||
shell: bash
|
||||
- name: Upload test results
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@v4.3.0
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: build-android-results
|
||||
compression-level: 1
|
||||
@@ -536,7 +551,7 @@ jobs:
|
||||
packages/react-native/ReactAndroid/build/reports
|
||||
- name: Upload RNTester APK
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@v4.3.0
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: rntester-apk
|
||||
path: packages/rn-tester/android/app/build/outputs/apk/
|
||||
@@ -566,6 +581,9 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.1.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
fetch-tags: true
|
||||
- name: Create /tmp/hermes/osx-bin directory
|
||||
run: mkdir -p /tmp/hermes/osx-bin
|
||||
- name: Download osx-bin release artifacts
|
||||
@@ -696,6 +714,7 @@ jobs:
|
||||
path: build
|
||||
- name: Publish @react-native-community/template
|
||||
if: needs.set_release_type.outputs.RELEASE_TYPE == 'release'
|
||||
shell: bash
|
||||
id: publish-to-npm
|
||||
run: |
|
||||
COMMIT_MSG=$(git log -n1 --pretty=%B);
|
||||
@@ -706,16 +725,17 @@ jobs:
|
||||
IS_LATEST=false
|
||||
fi
|
||||
# Go from v0.75.0-rc.4 -> 0.75-stable, which is the template's branching scheme
|
||||
VERSION=$(grep -oE '\d+\.\d+' <<< "${{ github.ref_name }}" | { read version; echo "$version-stable" })
|
||||
VERSION=$(grep -oE '\d+\.\d+' <<< "${{ github.ref_name }}" | { read version; echo "$version-stable"; })
|
||||
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
|
||||
|
||||
curl -L -X POST https://api.github.com/repos/react-native-community/template/release.yaml/dispatches \
|
||||
curl -L https://api.github.com/repos/react-native-community/template/actions/workflows/release.yaml/dispatches
|
||||
-H "Accept: application/vnd.github.v3+json" \
|
||||
-H "Authorization: Bearer $REACT_NATIVE_BOT_GITHUB_TOKEN" \
|
||||
-d "{\"ref\":\"$VERSION\",\"inputs\":{\"version\":\"${{ github.ref_name }}\",\"is_latest_on_npm\":\"$IS_LATEST\"}}\n"
|
||||
-d "{\"ref\":\"$VERSION\",\"inputs\":{\"version\":\"${{ github.ref_name }}\",\"is_latest_on_npm\":\"$IS_LATEST\"}}"
|
||||
- name: Wait for template to be published
|
||||
if: needs.set_release_type.outputs.RELEASE_TYPE == 'release'
|
||||
timeout-minutes: 3
|
||||
shell: bash
|
||||
env:
|
||||
VERSION: ${{ steps.publish-to-npm.outputs.VERSION }}
|
||||
TAG: ${{ steps.publish-to-npm.outputs.TAG }}
|
||||
|
||||
@@ -117,7 +117,7 @@ jobs:
|
||||
uses: actions/cache/restore@v4.0.0
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_${{ matrix.slice }}_${{ matrix.flavor }}
|
||||
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-${{ matrix.slice }}-${{ matrix.flavor }}
|
||||
key: v5-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-${{ matrix.slice }}-${{ matrix.flavor }}
|
||||
- name: Build the Hermes ${{ matrix.slice }} frameworks
|
||||
run: |
|
||||
cd ./packages/react-native/sdks/hermes || exit 1
|
||||
@@ -171,17 +171,21 @@ jobs:
|
||||
echo "Please try again"
|
||||
exit 1
|
||||
fi
|
||||
- name: Compress slices to preserve Symlinks
|
||||
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 (${{ matrix.slice }}, ${{ matrix.flavor }}}
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: slice-${{ matrix.slice }}-${{ matrix.flavor }}
|
||||
path: ./packages/react-native/sdks/hermes/build_${{ matrix.slice }}_${{ matrix.flavor }}
|
||||
path: ./packages/react-native/sdks/hermes/build_${{ matrix.slice }}_${{ matrix.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.0.0
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_${{ matrix.slice }}_${{ matrix.flavor }}
|
||||
key: v4-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-${{ matrix.slice }}-${{ matrix.flavor }}
|
||||
key: v5-hermes-apple-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}-${{ hashfiles('packages/react-native/sdks/hermes-engine/utils/build-apple-framework.sh') }}-${{ matrix.slice }}-${{ matrix.flavor }}
|
||||
|
||||
build_hermes_macos:
|
||||
runs-on: macos-13
|
||||
@@ -206,7 +210,7 @@ jobs:
|
||||
- name: Restore Cached Artifacts
|
||||
uses: actions/cache/restore@v4.0.0
|
||||
with:
|
||||
key: v3-hermes-artifacts-${{ matrix.flavor }}-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
key: v4-hermes-artifacts-${{ matrix.flavor }}-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
path: |
|
||||
/tmp/hermes/osx-bin/${{ matrix.flavor }}
|
||||
/tmp/hermes/dSYM/${{ matrix.flavor }}
|
||||
@@ -235,38 +239,50 @@ jobs:
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_macosx_${{ matrix.flavor }}
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
name: slice-macosx-${{ matrix.flavor }}
|
||||
- name: Slice cache iphoneos
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_iphoneos_${{ matrix.flavor }}
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
name: slice-iphoneos-${{ matrix.flavor }}
|
||||
- name: Slice cache iphonesimulator
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_iphonesimulator_${{ matrix.flavor }}
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
name: slice-iphonesimulator-${{ matrix.flavor }}
|
||||
- name: Slice cache catalyst
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_catalyst_${{ matrix.flavor }}
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
name: slice-catalyst-${{ matrix.flavor }}
|
||||
- name: Slice cache xros
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_xros_${{ matrix.flavor }}
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
name: slice-xros-${{ matrix.flavor }}
|
||||
- name: Slice cache xrsimulator
|
||||
if: ${{ steps.check_if_apple_artifacts_are_there.outputs.ARTIFACTS_EXIST != 'true' }}
|
||||
uses: actions/download-artifact@v4.1.3
|
||||
with:
|
||||
path: ./packages/react-native/sdks/hermes/build_xrsimulator_${{ matrix.flavor }}
|
||||
path: ./packages/react-native/sdks/hermes/
|
||||
name: slice-xrsimulator-${{ matrix.flavor }}
|
||||
- name: Unzip slices
|
||||
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_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' }}
|
||||
run: |
|
||||
@@ -366,7 +382,7 @@ jobs:
|
||||
uses: actions/cache/save@v4.0.0
|
||||
if: ${{ github.ref == 'refs/heads/main' || contains(github.ref, '-stable') }} # To avoid that the cache explode.
|
||||
with:
|
||||
key: v3-hermes-artifacts-${{ matrix.flavor }}-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
key: v4-hermes-artifacts-${{ matrix.flavor }}-${{ needs.prepare_hermes_workspace.outputs.hermes-version }}-${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
path: |
|
||||
/tmp/hermes/osx-bin/${{ matrix.flavor }}
|
||||
/tmp/hermes/dSYM/${{ matrix.flavor }}
|
||||
@@ -476,7 +492,7 @@ jobs:
|
||||
cp /tmp/hermes/build/bin/hermesc /tmp/hermes/linux64-bin/.
|
||||
fi
|
||||
- name: Upload linux artifacts
|
||||
uses: actions/upload-artifact@v4.3.0
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: hermes-linux-bin
|
||||
path: /tmp/hermes/linux64-bin
|
||||
@@ -564,7 +580,7 @@ jobs:
|
||||
Write-Host "Skipping; Clean c:\tmp\hermes\win64-bin to rebuild."
|
||||
}
|
||||
- name: Upload windows artifacts
|
||||
uses: actions/upload-artifact@v4.3.0
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: hermes-win64-bin
|
||||
path: D:\tmp\hermes\win64-bin\
|
||||
@@ -600,7 +616,7 @@ jobs:
|
||||
shell: bash
|
||||
- name: Upload test results
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@v4.3.0
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: build-android-results
|
||||
compression-level: 1
|
||||
@@ -610,7 +626,7 @@ jobs:
|
||||
packages/react-native/ReactAndroid/build/reports
|
||||
- name: Upload RNTester APK
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@v4.3.0
|
||||
uses: actions/upload-artifact@v4.3.1
|
||||
with:
|
||||
name: rntester-apk
|
||||
path: packages/rn-tester/android/app/build/outputs/apk/
|
||||
|
||||
+3
-2
@@ -48,8 +48,8 @@
|
||||
"@definitelytyped/dtslint": "^0.0.127",
|
||||
"@jest/create-cache-key-function": "^29.6.3",
|
||||
"@pkgjs/parseargs": "^0.11.0",
|
||||
"@react-native/metro-babel-transformer": "0.75.0-rc.6",
|
||||
"@react-native/metro-config": "0.75.0-rc.6",
|
||||
"@react-native/metro-babel-transformer": "0.75.3",
|
||||
"@react-native/metro-config": "0.75.3",
|
||||
"@tsconfig/node18": "1.0.1",
|
||||
"@types/react": "^18.2.6",
|
||||
"@typescript-eslint/parser": "^7.1.1",
|
||||
@@ -60,6 +60,7 @@
|
||||
"babel-preset-fbjs": "^3.4.0",
|
||||
"chalk": "^4.0.0",
|
||||
"clang-format": "^1.8.0",
|
||||
"commander": "^9.4.1",
|
||||
"connect": "^3.6.5",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/assets-registry",
|
||||
"version": "0.75.0-rc.6",
|
||||
"version": "0.75.3",
|
||||
"description": "Asset support code for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/babel-plugin-codegen",
|
||||
"version": "0.75.0-rc.6",
|
||||
"version": "0.75.3",
|
||||
"description": "Babel plugin to generate native module and view manager code for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -25,7 +25,7 @@
|
||||
"index.js"
|
||||
],
|
||||
"dependencies": {
|
||||
"@react-native/codegen": "0.75.0-rc.6"
|
||||
"@react-native/codegen": "0.75.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.20.0"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/community-cli-plugin",
|
||||
"version": "0.75.0-rc.6",
|
||||
"version": "0.75.3",
|
||||
"description": "Core CLI commands for React Native",
|
||||
"keywords": [
|
||||
"react-native",
|
||||
@@ -22,17 +22,16 @@
|
||||
"dist"
|
||||
],
|
||||
"dependencies": {
|
||||
"@react-native-community/cli-server-api": "14.0.0-alpha.11",
|
||||
"@react-native-community/cli-tools": "14.0.0-alpha.11",
|
||||
"@react-native/dev-middleware": "0.75.0-rc.6",
|
||||
"@react-native/metro-babel-transformer": "0.75.0-rc.6",
|
||||
"@react-native-community/cli-server-api": "14.1.0",
|
||||
"@react-native-community/cli-tools": "14.1.0",
|
||||
"@react-native/dev-middleware": "0.75.3",
|
||||
"@react-native/metro-babel-transformer": "0.75.3",
|
||||
"chalk": "^4.0.0",
|
||||
"execa": "^5.1.1",
|
||||
"metro": "^0.80.3",
|
||||
"metro-config": "^0.80.3",
|
||||
"metro-core": "^0.80.3",
|
||||
"node-fetch": "^2.2.0",
|
||||
"querystring": "^0.2.1",
|
||||
"readline": "^1.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
* @oncall react_native
|
||||
*/
|
||||
|
||||
import querystring from 'querystring';
|
||||
|
||||
export default function parseKeyValueParamArray(
|
||||
keyValueArray: $ReadOnlyArray<string>,
|
||||
): Record<string, string> {
|
||||
@@ -23,8 +21,11 @@ export default function parseKeyValueParamArray(
|
||||
if (item.indexOf('&') !== -1) {
|
||||
throw new Error('Parameter cannot include "&" but found: ' + item);
|
||||
}
|
||||
Object.assign(result, querystring.parse(item));
|
||||
const params = new URLSearchParams(item);
|
||||
params.forEach((value, key) => {
|
||||
// $FlowExpectedError[prop-missing]
|
||||
result[key] = value;
|
||||
});
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/core-cli-utils",
|
||||
"version": "0.75.0-rc.6",
|
||||
"version": "0.75.3",
|
||||
"description": "React Native CLI library for Frameworks to build on",
|
||||
"license": "MIT",
|
||||
"main": "./src/index.flow.js",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/debugger-frontend",
|
||||
"version": "0.75.0-rc.6",
|
||||
"version": "0.75.3",
|
||||
"description": "Debugger frontend for React Native based on Chrome DevTools",
|
||||
"keywords": [
|
||||
"react-native",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/dev-middleware",
|
||||
"version": "0.75.0-rc.6",
|
||||
"version": "0.75.3",
|
||||
"description": "Dev server middleware for React Native",
|
||||
"keywords": [
|
||||
"react-native",
|
||||
@@ -23,7 +23,7 @@
|
||||
],
|
||||
"dependencies": {
|
||||
"@isaacs/ttlcache": "^1.4.1",
|
||||
"@react-native/debugger-frontend": "0.75.0-rc.6",
|
||||
"@react-native/debugger-frontend": "0.75.3",
|
||||
"chrome-launcher": "^0.15.2",
|
||||
"chromium-edge-launcher": "^0.2.0",
|
||||
"connect": "^3.6.5",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/eslint-config",
|
||||
"version": "0.75.0-rc.6",
|
||||
"version": "0.75.3",
|
||||
"description": "ESLint config for React Native",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -22,7 +22,7 @@
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.20.0",
|
||||
"@babel/eslint-parser": "^7.20.0",
|
||||
"@react-native/eslint-plugin": "0.75.0-rc.6",
|
||||
"@react-native/eslint-plugin": "0.75.3",
|
||||
"@typescript-eslint/eslint-plugin": "^7.1.1",
|
||||
"@typescript-eslint/parser": "^7.1.1",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/eslint-plugin",
|
||||
"version": "0.75.0-rc.6",
|
||||
"version": "0.75.3",
|
||||
"description": "ESLint rules for @react-native/eslint-config",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/eslint-plugin-specs",
|
||||
"version": "0.75.0-rc.6",
|
||||
"version": "0.75.3",
|
||||
"description": "ESLint rules to validate NativeModule and Component Specs",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -31,7 +31,7 @@
|
||||
"@babel/eslint-parser": "^7.20.0",
|
||||
"@babel/plugin-transform-flow-strip-types": "^7.20.0",
|
||||
"@babel/preset-flow": "^7.20.0",
|
||||
"@react-native/codegen": "0.75.0-rc.6",
|
||||
"@react-native/codegen": "0.75.3",
|
||||
"make-dir": "^2.1.0",
|
||||
"pirates": "^4.0.1",
|
||||
"source-map-support": "0.5.0"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "helloworld",
|
||||
"version": "0.75.0-rc.6",
|
||||
"version": "0.75.3",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"bootstrap": "node ./cli.js bootstrap",
|
||||
@@ -13,19 +13,19 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"react": "18.3.1",
|
||||
"react-native": "0.75.0-rc.6"
|
||||
"react-native": "0.75.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.20.0",
|
||||
"@babel/preset-env": "^7.20.0",
|
||||
"@babel/runtime": "^7.20.0",
|
||||
"@react-native/babel-preset": "0.75.0-rc.6",
|
||||
"@react-native/core-cli-utils": "0.75.0-rc.6",
|
||||
"@react-native/eslint-config": "0.75.0-rc.6",
|
||||
"@react-native/metro-config": "0.75.0-rc.6",
|
||||
"@react-native/babel-preset": "0.75.3",
|
||||
"@react-native/core-cli-utils": "0.75.3",
|
||||
"@react-native/eslint-config": "0.75.3",
|
||||
"@react-native/metro-config": "0.75.3",
|
||||
"babel-jest": "^29.6.3",
|
||||
"chalk": "^4.1.2",
|
||||
"commander": "^12.0.0",
|
||||
"commander": "^9.4.1",
|
||||
"eslint": "^8.19.0",
|
||||
"jest": "^29.6.3",
|
||||
"listr2": "^8.2.1",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/hermes-inspector-msggen",
|
||||
"version": "0.75.0-rc.6",
|
||||
"version": "0.75.3",
|
||||
"private": true,
|
||||
"description": "Hermes Inspector Message Generator for React Native",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/metro-config",
|
||||
"version": "0.75.0-rc.6",
|
||||
"version": "0.75.3",
|
||||
"description": "Metro configuration for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -26,8 +26,8 @@
|
||||
"dist"
|
||||
],
|
||||
"dependencies": {
|
||||
"@react-native/js-polyfills": "0.75.0-rc.6",
|
||||
"@react-native/metro-babel-transformer": "0.75.0-rc.6",
|
||||
"@react-native/js-polyfills": "0.75.3",
|
||||
"@react-native/metro-babel-transformer": "0.75.3",
|
||||
"metro-config": "^0.80.3",
|
||||
"metro-runtime": "^0.80.3"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/normalize-colors",
|
||||
"version": "0.75.0-rc.6",
|
||||
"version": "0.75.3",
|
||||
"description": "Color normalization for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/js-polyfills",
|
||||
"version": "0.75.0-rc.6",
|
||||
"version": "0.75.3",
|
||||
"description": "Polyfills for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/babel-preset",
|
||||
"version": "0.75.0-rc.6",
|
||||
"version": "0.75.3",
|
||||
"description": "Babel preset for React Native applications",
|
||||
"main": "src/index.js",
|
||||
"repository": {
|
||||
@@ -56,7 +56,7 @@
|
||||
"@babel/plugin-transform-typescript": "^7.5.0",
|
||||
"@babel/plugin-transform-unicode-regex": "^7.0.0",
|
||||
"@babel/template": "^7.0.0",
|
||||
"@react-native/babel-plugin-codegen": "0.75.0-rc.6",
|
||||
"@react-native/babel-plugin-codegen": "0.75.3",
|
||||
"babel-plugin-transform-flow-enums": "^0.0.2",
|
||||
"react-refresh": "^0.14.0"
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/metro-babel-transformer",
|
||||
"version": "0.75.0-rc.6",
|
||||
"version": "0.75.3",
|
||||
"description": "Babel transformer for React Native applications.",
|
||||
"main": "src/index.js",
|
||||
"repository": {
|
||||
@@ -16,7 +16,7 @@
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.20.0",
|
||||
"@react-native/babel-preset": "0.75.0-rc.6",
|
||||
"@react-native/babel-preset": "0.75.3",
|
||||
"hermes-parser": "0.22.0",
|
||||
"nullthrows": "^1.1.1"
|
||||
},
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@react-native/bots",
|
||||
"description": "React Native Bots",
|
||||
"version": "0.75.0-rc.6",
|
||||
"version": "0.75.3",
|
||||
"private": true,
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/codegen-typescript-test",
|
||||
"version": "0.75.0-rc.6",
|
||||
"version": "0.75.3",
|
||||
"private": true,
|
||||
"description": "TypeScript related unit test for @react-native/codegen",
|
||||
"license": "MIT",
|
||||
@@ -19,7 +19,7 @@
|
||||
"prepare": "yarn run build"
|
||||
},
|
||||
"dependencies": {
|
||||
"@react-native/codegen": "0.75.0-rc.6"
|
||||
"@react-native/codegen": "0.75.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.20.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/codegen",
|
||||
"version": "0.75.0-rc.6",
|
||||
"version": "0.75.3",
|
||||
"description": "Code generation tools for React Native",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -35,7 +35,8 @@
|
||||
"invariant": "^2.2.4",
|
||||
"jscodeshift": "^0.14.0",
|
||||
"mkdirp": "^0.5.1",
|
||||
"nullthrows": "^1.1.1"
|
||||
"nullthrows": "^1.1.1",
|
||||
"yargs": "^17.6.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.20.0",
|
||||
@@ -52,8 +53,7 @@
|
||||
"hermes-estree": "0.22.0",
|
||||
"micromatch": "^4.0.4",
|
||||
"prettier": "2.8.8",
|
||||
"rimraf": "^3.0.2",
|
||||
"yargs": "^17.6.2"
|
||||
"rimraf": "^3.0.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/preset-env": "^7.1.6"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/gradle-plugin",
|
||||
"version": "0.75.0-rc.6",
|
||||
"version": "0.75.3",
|
||||
"description": "Gradle Plugin for React Native",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -32,6 +32,7 @@
|
||||
"README.md",
|
||||
"react-native-gradle-plugin",
|
||||
"settings-plugin",
|
||||
"shared"
|
||||
"shared",
|
||||
"shared-testutil"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
import org.gradle.api.internal.classpath.ModuleRegistry
|
||||
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
|
||||
import org.gradle.configurationcache.extensions.serviceOf
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
plugins {
|
||||
@@ -52,14 +51,6 @@ dependencies {
|
||||
testImplementation(libs.junit)
|
||||
testImplementation(libs.assertj)
|
||||
testImplementation(project(":shared-testutil"))
|
||||
|
||||
testRuntimeOnly(
|
||||
files(
|
||||
serviceOf<ModuleRegistry>()
|
||||
.getModule("gradle-tooling-api-builders")
|
||||
.classpath
|
||||
.asFiles
|
||||
.first()))
|
||||
}
|
||||
|
||||
// We intentionally don't build for Java 17 as users will see a cryptic bytecode version
|
||||
|
||||
+1
@@ -188,6 +188,7 @@ abstract class ReactExtension @Inject constructor(val project: Project) {
|
||||
?.dependencies
|
||||
?.values
|
||||
?.filter { it.platforms?.android !== null }
|
||||
?.filterNot { it.platforms?.android?.isPureCxxDependency == true }
|
||||
?.forEach { deps ->
|
||||
val nameCleansed = deps.nameCleansed
|
||||
val dependencyConfiguration = deps.platforms?.android?.dependencyConfiguration
|
||||
|
||||
+1
@@ -113,6 +113,7 @@ internal object NdkConfiguratorUtils {
|
||||
"**/libreact_utils.so",
|
||||
"**/librrc_image.so",
|
||||
"**/librrc_legacyviewmanagerinterop.so",
|
||||
"**/librrc_textinput.so",
|
||||
"**/librrc_view.so",
|
||||
"**/libruntimeexecutor.so",
|
||||
"**/libturbomodulejsijni.so",
|
||||
|
||||
+38
@@ -189,6 +189,44 @@ class ReactExtensionTest {
|
||||
assertThat(deps).isEmpty()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun getGradleDependenciesToApply_withIsPureCxxDeps_filtersCorrectly() {
|
||||
val validJsonFile =
|
||||
createJsonFile(
|
||||
"""
|
||||
{
|
||||
"reactNativeVersion": "1000.0.0",
|
||||
"dependencies": {
|
||||
"@react-native/oss-library-example": {
|
||||
"root": "./node_modules/@react-native/android-example",
|
||||
"name": "@react-native/android-example",
|
||||
"platforms": {
|
||||
"android": {
|
||||
"sourceDir": "src/main/java",
|
||||
"packageImportPath": "com.facebook.react"
|
||||
}
|
||||
}
|
||||
},
|
||||
"@react-native/another-library-for-testing": {
|
||||
"root": "./node_modules/@react-native/cxx-testing",
|
||||
"name": "@react-native/cxx-testing",
|
||||
"platforms": {
|
||||
"android": {
|
||||
"sourceDir": "src/main/java",
|
||||
"packageImportPath": "com.facebook.react",
|
||||
"isPureCxxDependency": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
.trimIndent())
|
||||
|
||||
val deps = getGradleDependenciesToApply(validJsonFile)
|
||||
assertThat(deps).containsExactly("implementation" to ":react-native_android-example")
|
||||
}
|
||||
|
||||
private fun createJsonFile(@Language("JSON") input: String) =
|
||||
tempFolder.newFile().apply { writeText(input) }
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
import org.gradle.api.internal.classpath.ModuleRegistry
|
||||
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
|
||||
import org.gradle.configurationcache.extensions.serviceOf
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
plugins {
|
||||
@@ -41,14 +40,6 @@ dependencies {
|
||||
|
||||
testImplementation(libs.junit)
|
||||
testImplementation(project(":shared-testutil"))
|
||||
|
||||
testRuntimeOnly(
|
||||
files(
|
||||
serviceOf<ModuleRegistry>()
|
||||
.getModule("gradle-tooling-api-builders")
|
||||
.classpath
|
||||
.asFiles
|
||||
.first()))
|
||||
}
|
||||
|
||||
// We intentionally don't build for Java 17 as users will see a cryptic bytecode version
|
||||
|
||||
+83
-23
@@ -7,6 +7,7 @@
|
||||
|
||||
package com.facebook.react
|
||||
|
||||
import com.facebook.react.model.ModelAutolinkingConfigJson
|
||||
import com.facebook.react.utils.JsonUtils
|
||||
import com.facebook.react.utils.windowsAwareCommandLine
|
||||
import java.io.File
|
||||
@@ -53,30 +54,22 @@ abstract class ReactSettingsExtension @Inject constructor(val settings: Settings
|
||||
.files("yarn.lock", "package-lock.json", "package.json", "react-native.config.js")
|
||||
) {
|
||||
outputFile.parentFile.mkdirs()
|
||||
val lockFilesChanged = checkAndUpdateLockfiles(lockFiles, outputFolder)
|
||||
if (lockFilesChanged || outputFile.exists().not() || outputFile.length() != 0L) {
|
||||
val process =
|
||||
ProcessBuilder(command)
|
||||
.directory(workingDirectory)
|
||||
.redirectOutput(ProcessBuilder.Redirect.to(outputFile))
|
||||
.redirectError(ProcessBuilder.Redirect.INHERIT)
|
||||
.start()
|
||||
val finished = process.waitFor(5, TimeUnit.MINUTES)
|
||||
if (!finished || (process.exitValue() != 0)) {
|
||||
val prefixCommand =
|
||||
"ERROR: autolinkLibrariesFromCommand: process ${command.joinToString(" ")}"
|
||||
val message =
|
||||
if (!finished) "${prefixCommand} timed out"
|
||||
else "${prefixCommand} exited with error code: ${process.exitValue()}"
|
||||
val logger = Logging.getLogger("ReactSettingsExtension")
|
||||
logger.error(message)
|
||||
if (outputFile.length() != 0L) {
|
||||
logger.error(outputFile.readText().substring(0, 1024))
|
||||
|
||||
val updateConfig =
|
||||
object : GenerateConfig {
|
||||
private val pb =
|
||||
ProcessBuilder(command)
|
||||
.directory(workingDirectory)
|
||||
.redirectOutput(ProcessBuilder.Redirect.to(outputFile))
|
||||
.redirectError(ProcessBuilder.Redirect.INHERIT)
|
||||
|
||||
override fun command(): List<String> = pb.command()
|
||||
|
||||
override fun start(): Process = pb.start()
|
||||
}
|
||||
outputFile.delete()
|
||||
throw GradleException(message)
|
||||
}
|
||||
}
|
||||
|
||||
checkAndUpdateCache(updateConfig, outputFile, outputFolder, lockFiles)
|
||||
|
||||
linkLibraries(getLibrariesToAutolink(outputFile))
|
||||
}
|
||||
|
||||
@@ -107,9 +100,73 @@ abstract class ReactSettingsExtension @Inject constructor(val settings: Settings
|
||||
}
|
||||
}
|
||||
|
||||
internal interface GenerateConfig {
|
||||
fun command(): List<String>
|
||||
|
||||
fun start(): Process
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val md = MessageDigest.getInstance("SHA-256")
|
||||
|
||||
/**
|
||||
* Determine if our cache is out-of-date
|
||||
*
|
||||
* @param cacheJsonConfig Our current cached autolinking.json config, which may exist
|
||||
* @param cacheFolder The folder we store our cached SHAs and config
|
||||
* @param lockFiles The [FileCollection] of the lockfiles to check.
|
||||
* @return `true` if the cache needs to be rebuilt, `false` otherwise
|
||||
*/
|
||||
internal fun isCacheDirty(
|
||||
cacheJsonConfig: File,
|
||||
cacheFolder: File,
|
||||
lockFiles: FileCollection,
|
||||
): Boolean {
|
||||
if (cacheJsonConfig.exists().not() || cacheJsonConfig.length() == 0L) {
|
||||
return true
|
||||
}
|
||||
val lockFilesChanged = checkAndUpdateLockfiles(lockFiles, cacheFolder)
|
||||
if (lockFilesChanged) {
|
||||
return true
|
||||
}
|
||||
return isConfigModelInvalid(JsonUtils.fromAutolinkingConfigJson(cacheJsonConfig))
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility function to update the settings cache only if it's entries are dirty
|
||||
*
|
||||
* @param updateJsonConfig A [GenerateConfig] to update the project's autolinking config
|
||||
* @param cacheJsonConfig Our current cached autolinking.json config, which may exist
|
||||
* @param cacheFolder The folder we store our cached SHAs and config
|
||||
* @param lockFiles The [FileCollection] of the lockfiles to check.
|
||||
*/
|
||||
internal fun checkAndUpdateCache(
|
||||
updateJsonConfig: GenerateConfig,
|
||||
cacheJsonConfig: File,
|
||||
cacheFolder: File,
|
||||
lockFiles: FileCollection,
|
||||
) {
|
||||
if (isCacheDirty(cacheJsonConfig, cacheFolder, lockFiles)) {
|
||||
val process = updateJsonConfig.start()
|
||||
|
||||
val finished = process.waitFor(5, TimeUnit.MINUTES)
|
||||
if (!finished || (process.exitValue() != 0)) {
|
||||
val command = updateJsonConfig.command().joinToString(" ")
|
||||
val prefixCommand = "ERROR: autolinkLibrariesFromCommand: process $command"
|
||||
val message =
|
||||
if (!finished) "$prefixCommand timed out"
|
||||
else "$prefixCommand exited with error code: ${process.exitValue()}"
|
||||
val logger = Logging.getLogger("ReactSettingsExtension")
|
||||
logger.error(message)
|
||||
if (cacheJsonConfig.length() != 0L) {
|
||||
logger.error(cacheJsonConfig.readText().substring(0, 1024))
|
||||
}
|
||||
cacheJsonConfig.delete()
|
||||
throw GradleException(message)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility function to check if the provided lockfiles have been updated or not. This function
|
||||
* will both check and update the lockfiles hashes if necessary.
|
||||
@@ -150,5 +207,8 @@ abstract class ReactSettingsExtension @Inject constructor(val settings: Settings
|
||||
|
||||
internal fun computeSha256(lockFile: File) =
|
||||
String.format("%032x", BigInteger(1, md.digest(lockFile.readBytes())))
|
||||
|
||||
internal fun isConfigModelInvalid(model: ModelAutolinkingConfigJson?) =
|
||||
model?.project?.android?.packageName == null
|
||||
}
|
||||
}
|
||||
|
||||
+237
@@ -7,10 +7,12 @@
|
||||
|
||||
package com.facebook.react
|
||||
|
||||
import com.facebook.react.ReactSettingsExtension.Companion.checkAndUpdateCache
|
||||
import com.facebook.react.ReactSettingsExtension.Companion.checkAndUpdateLockfiles
|
||||
import com.facebook.react.ReactSettingsExtension.Companion.computeSha256
|
||||
import com.facebook.react.ReactSettingsExtension.Companion.getLibrariesToAutolink
|
||||
import groovy.test.GroovyTestCase.assertEquals
|
||||
import com.facebook.react.ReactSettingsExtension.GenerateConfig
|
||||
import java.io.File
|
||||
import org.gradle.testfixtures.ProjectBuilder
|
||||
import org.intellij.lang.annotations.Language
|
||||
@@ -236,6 +238,241 @@ class ReactSettingsExtensionTest {
|
||||
File(buildFolder, "package-lock.json.sha").readText())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun skipUpdateIfConfigInCacheIsValid() {
|
||||
val project = ProjectBuilder.builder().withProjectDir(tempFolder.root).build()
|
||||
val buildFolder = tempFolder.newFolder("build")
|
||||
val generatedFolder = tempFolder.newFolder("build", "generated")
|
||||
val outputFile =
|
||||
File(generatedFolder, "autolinking.json").apply {
|
||||
writeText(
|
||||
"""
|
||||
{
|
||||
"root": "/",
|
||||
"reactNativePath": "/node_modules/react-native",
|
||||
"reactNativeVersion": "0.75",
|
||||
"dependencies": {},
|
||||
"healthChecks": [],
|
||||
"platforms": {
|
||||
"ios": {},
|
||||
"android": {}
|
||||
},
|
||||
"assets": [],
|
||||
"project": {
|
||||
"ios": {},
|
||||
"android": {
|
||||
"sourceDir": "/",
|
||||
"appName": "app",
|
||||
"packageName": "com.TestApp",
|
||||
"applicationId": "com.TestApp",
|
||||
"mainActivity": ".MainActivity",
|
||||
"assets": []
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
.trimIndent())
|
||||
}
|
||||
tempFolder.newFile("yarn.lock").apply { writeText("I'm a lockfile") }
|
||||
val lockfileCollection = project.files("yarn.lock")
|
||||
|
||||
// Prebuild the shas with the invalid empty autolinking.json
|
||||
checkAndUpdateLockfiles(lockfileCollection, buildFolder)
|
||||
|
||||
val monitoredUpdateConfig = createMonitoredUpdateConfig()
|
||||
|
||||
checkAndUpdateCache(monitoredUpdateConfig, outputFile, buildFolder, lockfileCollection)
|
||||
|
||||
// The autolinking.json file is valid, SHA's are untouched therefore config should NOT be
|
||||
// refreshed
|
||||
assertThat(monitoredUpdateConfig.run).isFalse()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun checkAndUpdateConfigIfEmpty() {
|
||||
val project = ProjectBuilder.builder().withProjectDir(tempFolder.root).build()
|
||||
val buildFolder = tempFolder.newFolder("build")
|
||||
val generatedFolder = tempFolder.newFolder("build", "generated")
|
||||
val outputFile = File(generatedFolder, "autolinking.json").apply { writeText("") }
|
||||
tempFolder.newFile("yarn.lock").apply { writeText("I'm a lockfile") }
|
||||
val lockfileCollection = project.files("yarn.lock")
|
||||
|
||||
// Prebuild the shas with the invalid empty autolinking.json
|
||||
checkAndUpdateLockfiles(lockfileCollection, buildFolder)
|
||||
|
||||
val monitoredUpdateConfig = createMonitoredUpdateConfig()
|
||||
|
||||
checkAndUpdateCache(monitoredUpdateConfig, outputFile, buildFolder, lockfileCollection)
|
||||
|
||||
// The autolinking.json file is invalid and should be refreshed
|
||||
assertThat(monitoredUpdateConfig.run).isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun checkAndUpdateConfigIfCachedConfigInvalid() {
|
||||
val project = ProjectBuilder.builder().withProjectDir(tempFolder.root).build()
|
||||
val buildFolder = tempFolder.newFolder("build")
|
||||
val generatedFolder = tempFolder.newFolder("build", "generated")
|
||||
val outputFile =
|
||||
File(generatedFolder, "autolinking.json").apply {
|
||||
writeText(
|
||||
"""
|
||||
{
|
||||
"project": {
|
||||
"ios": {},
|
||||
"android": {}
|
||||
}
|
||||
}
|
||||
"""
|
||||
.trimIndent())
|
||||
}
|
||||
tempFolder.newFile("yarn.lock").apply { writeText("I'm a lockfile") }
|
||||
val lockfileCollection = project.files("yarn.lock")
|
||||
|
||||
// Prebuild the shas with the invalid empty autolinking.json
|
||||
checkAndUpdateLockfiles(lockfileCollection, buildFolder)
|
||||
|
||||
val monitoredUpdateConfig = createMonitoredUpdateConfig()
|
||||
|
||||
checkAndUpdateCache(monitoredUpdateConfig, outputFile, buildFolder, lockfileCollection)
|
||||
|
||||
// The autolinking.json file is invalid and should be refreshed
|
||||
assertThat(monitoredUpdateConfig.run).isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isCacheDirty_withMissingAutolinkingFile_returnsTrue() {
|
||||
val project = ProjectBuilder.builder().withProjectDir(tempFolder.root).build()
|
||||
val buildFolder =
|
||||
tempFolder.newFolder("build").apply {
|
||||
File(this, "yarn.lock.sha")
|
||||
.writeText("76046b72442ee7eb130627e56c3db7c9907eef4913b17ad130335edc0eb702a8")
|
||||
}
|
||||
tempFolder.newFile("yarn.lock").apply { writeText("I'm a lockfile") }
|
||||
val lockfiles = project.files("yarn.lock")
|
||||
val emptyConfigFile = File(tempFolder.newFolder("build", "autolinking"), "autolinking.json")
|
||||
|
||||
assertThat(ReactSettingsExtension.isCacheDirty(emptyConfigFile, buildFolder, lockfiles))
|
||||
.isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isCacheDirty_withInvalidAutolinkingFile_returnsTrue() {
|
||||
val project = ProjectBuilder.builder().withProjectDir(tempFolder.root).build()
|
||||
val buildFolder =
|
||||
tempFolder.newFolder("build").apply {
|
||||
File(this, "yarn.lock.sha")
|
||||
.writeText("76046b72442ee7eb130627e56c3db7c9907eef4913b17ad130335edc0eb702a8")
|
||||
}
|
||||
tempFolder.newFile("yarn.lock").apply { writeText("I'm a lockfile") }
|
||||
val lockfiles = project.files("yarn.lock")
|
||||
val invalidConfigFile =
|
||||
createJsonFile(
|
||||
"""
|
||||
{}
|
||||
"""
|
||||
.trimIndent())
|
||||
|
||||
assertThat(ReactSettingsExtension.isCacheDirty(invalidConfigFile, buildFolder, lockfiles))
|
||||
.isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isCacheDirty_withMissingDependenciesInJson_returnsFalse() {
|
||||
val project = ProjectBuilder.builder().withProjectDir(tempFolder.root).build()
|
||||
val buildFolder =
|
||||
tempFolder.newFolder("build").apply {
|
||||
File(this, "yarn.lock.sha")
|
||||
.writeText("76046b72442ee7eb130627e56c3db7c9907eef4913b17ad130335edc0eb702a8")
|
||||
}
|
||||
tempFolder.newFile("yarn.lock").apply { writeText("I'm a lockfile") }
|
||||
val lockfiles = project.files("yarn.lock")
|
||||
val invalidConfigFile =
|
||||
createJsonFile(
|
||||
"""
|
||||
{
|
||||
"reactNativeVersion": "1000.0.0"
|
||||
}
|
||||
"""
|
||||
.trimIndent())
|
||||
|
||||
assertThat(ReactSettingsExtension.isCacheDirty(invalidConfigFile, buildFolder, lockfiles))
|
||||
.isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isCacheDirty_withExistingEmptyDependenciesInJson_returnsTrue() {
|
||||
val project = ProjectBuilder.builder().withProjectDir(tempFolder.root).build()
|
||||
val buildFolder =
|
||||
tempFolder.newFolder("build").apply {
|
||||
File(this, "yarn.lock.sha")
|
||||
.writeText("76046b72442ee7eb130627e56c3db7c9907eef4913b17ad130335edc0eb702a8")
|
||||
}
|
||||
tempFolder.newFile("yarn.lock").apply { writeText("I'm a lockfile") }
|
||||
val lockfiles = project.files("yarn.lock")
|
||||
val invalidConfigFile =
|
||||
createJsonFile(
|
||||
"""
|
||||
{
|
||||
"reactNativeVersion": "1000.0.0",
|
||||
"dependencies": {}
|
||||
}
|
||||
"""
|
||||
.trimIndent())
|
||||
|
||||
assertThat(ReactSettingsExtension.isCacheDirty(invalidConfigFile, buildFolder, lockfiles))
|
||||
.isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isCacheDirty_withExistingDependenciesInJson_returnsTrue() {
|
||||
val project = ProjectBuilder.builder().withProjectDir(tempFolder.root).build()
|
||||
val buildFolder =
|
||||
tempFolder.newFolder("build").apply {
|
||||
File(this, "yarn.lock.sha")
|
||||
.writeText("76046b72442ee7eb130627e56c3db7c9907eef4913b17ad130335edc0eb702a8")
|
||||
}
|
||||
tempFolder.newFile("yarn.lock").apply { writeText("I'm a lockfile") }
|
||||
val lockfiles = project.files("yarn.lock")
|
||||
val invalidConfigFile =
|
||||
createJsonFile(
|
||||
"""
|
||||
{
|
||||
"reactNativeVersion": "1000.0.0",
|
||||
"dependencies": {
|
||||
"@react-native/oss-library-example": {
|
||||
"root": "./node_modules/@react-native/oss-library-example",
|
||||
"name": "@react-native/oss-library-example",
|
||||
"platforms": {
|
||||
"ios": {
|
||||
"podspecPath": "./node_modules/@react-native/oss-library-example/OSSLibraryExample.podspec",
|
||||
"version": "0.0.1",
|
||||
"configurations": [],
|
||||
"scriptPhases": []
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
.trimIndent())
|
||||
|
||||
assertThat(ReactSettingsExtension.isCacheDirty(invalidConfigFile, buildFolder, lockfiles))
|
||||
.isTrue()
|
||||
}
|
||||
|
||||
private fun createJsonFile(@Language("JSON") input: String) =
|
||||
tempFolder.newFile().apply { writeText(input) }
|
||||
|
||||
private fun createMonitoredUpdateConfig() =
|
||||
object : GenerateConfig {
|
||||
var run = false
|
||||
|
||||
override fun start(): Process {
|
||||
run = true
|
||||
return ProcessBuilder("true").start()
|
||||
}
|
||||
|
||||
override fun command(): List<String> = listOf("true")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "react-native-info",
|
||||
"version": "0.75.0-rc.6",
|
||||
"version": "0.75.3",
|
||||
"main": "build/index.js",
|
||||
"license": "MIT",
|
||||
"private": true,
|
||||
@@ -17,11 +17,11 @@
|
||||
"directory": "packages/react-native-info"
|
||||
},
|
||||
"dependencies": {
|
||||
"@react-native-community/cli-config": "14.0.0",
|
||||
"@react-native-community/cli-platform-apple": "14.0.0",
|
||||
"@react-native-community/cli-tools": "14.0.0",
|
||||
"@react-native-community/cli-types": "14.0.0",
|
||||
"commander": "^12.0.0",
|
||||
"@react-native-community/cli-config": "14.1.0",
|
||||
"@react-native-community/cli-platform-apple": "14.1.0",
|
||||
"@react-native-community/cli-tools": "14.1.0",
|
||||
"@react-native-community/cli-types": "14.1.0",
|
||||
"commander": "^9.4.1",
|
||||
"fs-extra": "^11.2.0",
|
||||
"yaml": "^2.4.1"
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/popup-menu-android",
|
||||
"version": "0.75.0-rc.6",
|
||||
"version": "0.75.3",
|
||||
"description": "PopupMenu for the Android platform",
|
||||
"main": "index.js",
|
||||
"files": [
|
||||
@@ -17,7 +17,7 @@
|
||||
],
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@react-native/codegen": "0.75.0-rc.6"
|
||||
"@react-native/codegen": "0.75.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@types/react": "^18.2.6",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/oss-library-example",
|
||||
"version": "0.75.0-rc.6",
|
||||
"version": "0.75.3",
|
||||
"private": true,
|
||||
"description": "Package that includes native module exapmle, native component example, targets both the old and the new architecture. It should serve as an example of a real-world OSS library.",
|
||||
"license": "MIT",
|
||||
@@ -26,8 +26,8 @@
|
||||
],
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.20.0",
|
||||
"@react-native/babel-preset": "0.75.0-rc.6",
|
||||
"react-native": "0.75.0-rc.6"
|
||||
"@react-native/babel-preset": "0.75.3",
|
||||
"react-native": "0.75.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "*",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@react-native/test-renderer",
|
||||
"private": true,
|
||||
"version": "0.75.0-rc.6",
|
||||
"version": "0.75.3",
|
||||
"description": "A Test rendering library for React Native",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
|
||||
@@ -16,8 +16,8 @@ const version: $ReadOnly<{
|
||||
}> = {
|
||||
major: 0,
|
||||
minor: 75,
|
||||
patch: 0,
|
||||
prerelease: 'rc.6',
|
||||
patch: 3,
|
||||
prerelease: null,
|
||||
};
|
||||
|
||||
module.exports = {version};
|
||||
|
||||
+17
-15
@@ -182,21 +182,23 @@ type MaximumOneOf<T, K extends keyof T = keyof T> = K extends keyof T
|
||||
|
||||
export interface TransformsStyle {
|
||||
transform?:
|
||||
| MaximumOneOf<
|
||||
PerspectiveTransform &
|
||||
RotateTransform &
|
||||
RotateXTransform &
|
||||
RotateYTransform &
|
||||
RotateZTransform &
|
||||
ScaleTransform &
|
||||
ScaleXTransform &
|
||||
ScaleYTransform &
|
||||
TranslateXTransform &
|
||||
TranslateYTransform &
|
||||
SkewXTransform &
|
||||
SkewYTransform &
|
||||
MatrixTransform
|
||||
>[]
|
||||
| Readonly<
|
||||
MaximumOneOf<
|
||||
PerspectiveTransform &
|
||||
RotateTransform &
|
||||
RotateXTransform &
|
||||
RotateYTransform &
|
||||
RotateZTransform &
|
||||
ScaleTransform &
|
||||
ScaleXTransform &
|
||||
ScaleYTransform &
|
||||
TranslateXTransform &
|
||||
TranslateYTransform &
|
||||
SkewXTransform &
|
||||
SkewYTransform &
|
||||
MatrixTransform
|
||||
>[]
|
||||
>
|
||||
| string
|
||||
| undefined;
|
||||
transformOrigin?: Array<string | number> | string | undefined;
|
||||
|
||||
@@ -651,8 +651,6 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithFrame : (CGRect)frame)
|
||||
- (NSString *)returnKeyTypeToString:(UIReturnKeyType)returnKeyType
|
||||
{
|
||||
switch (returnKeyType) {
|
||||
case UIReturnKeyDefault:
|
||||
return @"Default";
|
||||
case UIReturnKeyGo:
|
||||
return @"Go";
|
||||
case UIReturnKeyNext:
|
||||
@@ -680,7 +678,6 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithFrame : (CGRect)frame)
|
||||
{
|
||||
returnKeyTypesSet = [NSSet setWithObjects:@(UIReturnKeyDone),
|
||||
@(UIReturnKeyGo),
|
||||
@(UIReturnKeyDefault),
|
||||
@(UIReturnKeyNext),
|
||||
@(UIReturnKeySearch),
|
||||
@(UIReturnKeySend),
|
||||
|
||||
@@ -23,8 +23,8 @@ NSDictionary* RCTGetReactNativeVersion(void)
|
||||
__rnVersion = @{
|
||||
RCTVersionMajor: @(0),
|
||||
RCTVersionMinor: @(75),
|
||||
RCTVersionPatch: @(0),
|
||||
RCTVersionPrerelease: @"rc.6",
|
||||
RCTVersionPatch: @(3),
|
||||
RCTVersionPrerelease: [NSNull null],
|
||||
};
|
||||
});
|
||||
return __rnVersion;
|
||||
|
||||
-3
@@ -471,8 +471,6 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
|
||||
- (NSString *)returnKeyTypeToString:(UIReturnKeyType)returnKeyType
|
||||
{
|
||||
switch (returnKeyType) {
|
||||
case UIReturnKeyDefault:
|
||||
return @"Default";
|
||||
case UIReturnKeyGo:
|
||||
return @"Go";
|
||||
case UIReturnKeyNext:
|
||||
@@ -500,7 +498,6 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
|
||||
{
|
||||
returnKeyTypesSet = [NSSet setWithObjects:@(UIReturnKeyDone),
|
||||
@(UIReturnKeyGo),
|
||||
@(UIReturnKeyDefault),
|
||||
@(UIReturnKeyNext),
|
||||
@(UIReturnKeySearch),
|
||||
@(UIReturnKeySend),
|
||||
|
||||
@@ -4219,6 +4219,7 @@ public final class com/facebook/react/uimanager/LengthPercentage {
|
||||
public static final field Companion Lcom/facebook/react/uimanager/LengthPercentage$Companion;
|
||||
public fun <init> ()V
|
||||
public fun <init> (FLcom/facebook/react/uimanager/LengthPercentageType;)V
|
||||
public final fun getUnit ()Lcom/facebook/react/uimanager/LengthPercentageType;
|
||||
public final fun resolve (FF)F
|
||||
public static final fun setFromDynamic (Lcom/facebook/react/bridge/Dynamic;)Lcom/facebook/react/uimanager/LengthPercentage;
|
||||
}
|
||||
@@ -5022,6 +5023,7 @@ public class com/facebook/react/uimanager/TransformHelper {
|
||||
public fun <init> ()V
|
||||
public static fun processTransform (Lcom/facebook/react/bridge/ReadableArray;[D)V
|
||||
public static fun processTransform (Lcom/facebook/react/bridge/ReadableArray;[DFFLcom/facebook/react/bridge/ReadableArray;)V
|
||||
public static fun processTransform (Lcom/facebook/react/bridge/ReadableArray;[DFFLcom/facebook/react/bridge/ReadableArray;Z)V
|
||||
}
|
||||
|
||||
public abstract interface class com/facebook/react/uimanager/UIBlock {
|
||||
@@ -6447,7 +6449,7 @@ public class com/facebook/react/views/image/ReactImageView : com/facebook/drawee
|
||||
public fun updateCallerContext (Ljava/lang/Object;)V
|
||||
}
|
||||
|
||||
public final class com/facebook/react/views/imagehelper/ImageSource {
|
||||
public class com/facebook/react/views/imagehelper/ImageSource {
|
||||
public static final field Companion Lcom/facebook/react/views/imagehelper/ImageSource$Companion;
|
||||
public fun <init> (Landroid/content/Context;Ljava/lang/String;)V
|
||||
public fun <init> (Landroid/content/Context;Ljava/lang/String;D)V
|
||||
@@ -6457,9 +6459,9 @@ public final class com/facebook/react/views/imagehelper/ImageSource {
|
||||
public final fun getSize ()D
|
||||
public final fun getSource ()Ljava/lang/String;
|
||||
public static final fun getTransparentBitmapImageSource (Landroid/content/Context;)Lcom/facebook/react/views/imagehelper/ImageSource;
|
||||
public final fun getUri ()Landroid/net/Uri;
|
||||
public fun getUri ()Landroid/net/Uri;
|
||||
public fun hashCode ()I
|
||||
public final fun isResource ()Z
|
||||
public fun isResource ()Z
|
||||
}
|
||||
|
||||
public final class com/facebook/react/views/imagehelper/ImageSource$Companion {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
VERSION_NAME=0.75.0-rc.6
|
||||
VERSION_NAME=0.75.3
|
||||
react.internal.publishingGroup=com.facebook.react
|
||||
|
||||
android.useAndroidX=true
|
||||
|
||||
+2
-2
@@ -891,7 +891,7 @@ public class ReactRootView extends FrameLayout implements RootView, ReactRoot {
|
||||
sendEvent(
|
||||
"keyboardDidHide",
|
||||
createKeyboardEventPayload(
|
||||
PixelUtil.toDIPFromPixel(mLastHeight),
|
||||
PixelUtil.toDIPFromPixel(mVisibleViewArea.height()),
|
||||
0,
|
||||
PixelUtil.toDIPFromPixel(mVisibleViewArea.width()),
|
||||
0));
|
||||
@@ -940,7 +940,7 @@ public class ReactRootView extends FrameLayout implements RootView, ReactRoot {
|
||||
sendEvent(
|
||||
"keyboardDidHide",
|
||||
createKeyboardEventPayload(
|
||||
PixelUtil.toDIPFromPixel(mLastHeight),
|
||||
PixelUtil.toDIPFromPixel(mVisibleViewArea.height()),
|
||||
0,
|
||||
PixelUtil.toDIPFromPixel(mVisibleViewArea.width()),
|
||||
0));
|
||||
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package com.facebook.react.bridge
|
||||
|
||||
import com.facebook.jni.HybridData
|
||||
import com.facebook.proguard.annotations.DoNotStrip
|
||||
import com.facebook.proguard.annotations.DoNotStripAny
|
||||
|
||||
/**
|
||||
* An implementation of [Dynamic] that has a C++ implementation.
|
||||
*
|
||||
* This is used to support Legacy Native Modules that have not been migrated to the new architecture
|
||||
* and are using [Dynamic] as a parameter type.
|
||||
*/
|
||||
@DoNotStripAny
|
||||
private class DynamicNative(
|
||||
@Suppress("NoHungarianNotation") @field:DoNotStrip private val mHybridData: HybridData?
|
||||
) : Dynamic {
|
||||
|
||||
override val type: ReadableType
|
||||
get() = getTypeNative()
|
||||
|
||||
override val isNull: Boolean
|
||||
get() = isNullNative()
|
||||
|
||||
private external fun getTypeNative(): ReadableType
|
||||
|
||||
private external fun isNullNative(): Boolean
|
||||
|
||||
external override fun asBoolean(): Boolean
|
||||
|
||||
// The native representation is holding the value as Double. We do the Int conversion here.
|
||||
override fun asInt(): Int = asDouble().toInt()
|
||||
|
||||
external override fun asDouble(): Double
|
||||
|
||||
external override fun asString(): String
|
||||
|
||||
external override fun asArray(): ReadableArray
|
||||
|
||||
external override fun asMap(): ReadableMap
|
||||
|
||||
override fun recycle() {
|
||||
// Noop - nothing to recycle since there is no pooling
|
||||
}
|
||||
}
|
||||
+2
-4
@@ -13,7 +13,6 @@ import androidx.annotation.Nullable;
|
||||
import com.facebook.jni.HybridData;
|
||||
import com.facebook.proguard.annotations.DoNotStrip;
|
||||
import java.io.Closeable;
|
||||
import java.util.OptionalInt;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
@@ -47,7 +46,7 @@ import okhttp3.WebSocketListener;
|
||||
private static class WebSocketDelegate implements Closeable {
|
||||
private final HybridData mHybridData;
|
||||
|
||||
public native void didFailWithError(OptionalInt posixCode, String error);
|
||||
public native void didFailWithError(@Nullable Integer posixCode, String error);
|
||||
|
||||
public native void didReceiveMessage(String message);
|
||||
|
||||
@@ -103,8 +102,7 @@ import okhttp3.WebSocketListener;
|
||||
@Override
|
||||
public void onFailure(WebSocket _unused, Throwable t, @Nullable Response response) {
|
||||
@Nullable String message = t.getMessage();
|
||||
delegate.didFailWithError(
|
||||
OptionalInt.empty(), message != null ? message : "<Unknown error>");
|
||||
delegate.didFailWithError(null, message != null ? message : "<Unknown error>");
|
||||
// "No further calls to this listener will be made." -OkHttp docs for
|
||||
// WebSocketListener.onFailure
|
||||
delegate.close();
|
||||
|
||||
+2
-5
@@ -161,14 +161,11 @@ class TurboModuleInteropUtils {
|
||||
|| paramClass == Callback.class
|
||||
|| paramClass == Promise.class
|
||||
|| paramClass == ReadableMap.class
|
||||
|| paramClass == ReadableArray.class) {
|
||||
|| paramClass == ReadableArray.class
|
||||
|| paramClass == Dynamic.class) {
|
||||
return convertClassToJniType(paramClass);
|
||||
}
|
||||
|
||||
if (paramClass == Dynamic.class) {
|
||||
// TODO(T145105887): Output warnings that TurboModules doesn't yet support Dynamic arguments
|
||||
}
|
||||
|
||||
throw new ParsingException(
|
||||
moduleName,
|
||||
methodName,
|
||||
|
||||
+2
-2
@@ -17,6 +17,6 @@ public class ReactNativeVersion {
|
||||
public static final Map<String, Object> VERSION = MapBuilder.<String, Object>of(
|
||||
"major", 0,
|
||||
"minor", 75,
|
||||
"patch", 0,
|
||||
"prerelease", "rc.6");
|
||||
"patch", 3,
|
||||
"prerelease", null);
|
||||
}
|
||||
|
||||
+6
-1
@@ -29,6 +29,8 @@ import com.facebook.react.common.MapBuilder;
|
||||
import com.facebook.react.common.ReactConstants;
|
||||
import com.facebook.react.uimanager.ReactAccessibilityDelegate.AccessibilityRole;
|
||||
import com.facebook.react.uimanager.ReactAccessibilityDelegate.Role;
|
||||
import com.facebook.react.uimanager.common.UIManagerType;
|
||||
import com.facebook.react.uimanager.common.ViewUtil;
|
||||
import com.facebook.react.uimanager.annotations.ReactProp;
|
||||
import com.facebook.react.uimanager.events.PointerEventHelper;
|
||||
import com.facebook.react.uimanager.util.ReactFindViewUtil;
|
||||
@@ -535,13 +537,16 @@ public abstract class BaseViewManager<T extends View, C extends LayoutShadowNode
|
||||
return;
|
||||
}
|
||||
|
||||
boolean allowPercentageResolution = ViewUtil.getUIManagerType(view) == UIManagerType.FABRIC;
|
||||
|
||||
sMatrixDecompositionContext.reset();
|
||||
TransformHelper.processTransform(
|
||||
transforms,
|
||||
sTransformDecompositionArray,
|
||||
PixelUtil.toDIPFromPixel(view.getWidth()),
|
||||
PixelUtil.toDIPFromPixel(view.getHeight()),
|
||||
transformOrigin);
|
||||
transformOrigin,
|
||||
allowPercentageResolution);
|
||||
MatrixMathHelper.decomposeMatrix(sTransformDecompositionArray, sMatrixDecompositionContext);
|
||||
view.setTranslationX(
|
||||
PixelUtil.toPixelFromDIP(
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ public enum class LengthPercentageType {
|
||||
|
||||
public class LengthPercentage(
|
||||
private val value: Float,
|
||||
private val unit: LengthPercentageType,
|
||||
public val unit: LengthPercentageType,
|
||||
) {
|
||||
public companion object {
|
||||
@JvmStatic
|
||||
|
||||
+41
-12
@@ -45,8 +45,27 @@ public class TransformHelper {
|
||||
return inRadians ? value : MatrixMathHelper.degreesToRadians(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #processTransform(ReadableArray, double[], float, float, ReadableArray,
|
||||
* boolean)} instead.
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "0.75")
|
||||
public static void processTransform(ReadableArray transforms, double[] result) {
|
||||
processTransform(transforms, result, 0, 0, null);
|
||||
processTransform(transforms, result, 0, 0, null, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #processTransform(ReadableArray, double[], float, float, ReadableArray,
|
||||
* boolean)} instead.
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "0.75")
|
||||
public static void processTransform(
|
||||
ReadableArray transforms,
|
||||
double[] result,
|
||||
float viewWidth,
|
||||
float viewHeight,
|
||||
ReadableArray transformOrigin) {
|
||||
processTransform(transforms, result, viewWidth, viewHeight, transformOrigin, false);
|
||||
}
|
||||
|
||||
public static void processTransform(
|
||||
@@ -54,10 +73,13 @@ public class TransformHelper {
|
||||
double[] result,
|
||||
float viewWidth,
|
||||
float viewHeight,
|
||||
ReadableArray transformOrigin) {
|
||||
ReadableArray transformOrigin,
|
||||
boolean allowPercentageResolution) {
|
||||
double[] helperMatrix = sHelperMatrix.get();
|
||||
MatrixMathHelper.resetIdentityMatrix(result);
|
||||
float[] offsets = getTranslateForTransformOrigin(viewWidth, viewHeight, transformOrigin);
|
||||
float[] offsets =
|
||||
getTranslateForTransformOrigin(
|
||||
viewWidth, viewHeight, transformOrigin, allowPercentageResolution);
|
||||
|
||||
if (offsets != null) {
|
||||
MatrixMathHelper.resetIdentityMatrix(helperMatrix);
|
||||
@@ -104,13 +126,13 @@ public class TransformHelper {
|
||||
} else if ("translate".equals(transformType)) {
|
||||
ReadableArray value = transform.getArray(transformType);
|
||||
double x = 0;
|
||||
if (value.getType(0) == ReadableType.String) {
|
||||
if (value.getType(0) == ReadableType.String && allowPercentageResolution) {
|
||||
x = parseTranslateValue(value.getString(0), viewWidth);
|
||||
} else {
|
||||
x = value.getDouble(0);
|
||||
}
|
||||
double y = 0;
|
||||
if (value.getType(1) == ReadableType.String) {
|
||||
if (value.getType(1) == ReadableType.String && allowPercentageResolution) {
|
||||
y = parseTranslateValue(value.getString(1), viewHeight);
|
||||
} else {
|
||||
y = value.getDouble(1);
|
||||
@@ -119,7 +141,8 @@ public class TransformHelper {
|
||||
MatrixMathHelper.applyTranslate3D(helperMatrix, x, y, z);
|
||||
} else if ("translateX".equals(transformType)) {
|
||||
double translateValue = 0;
|
||||
if (transform.getType(transformType) == ReadableType.String) {
|
||||
if (transform.getType(transformType) == ReadableType.String
|
||||
&& allowPercentageResolution) {
|
||||
translateValue = parseTranslateValue(transform.getString(transformType), viewWidth);
|
||||
} else {
|
||||
translateValue = transform.getDouble(transformType);
|
||||
@@ -127,7 +150,8 @@ public class TransformHelper {
|
||||
MatrixMathHelper.applyTranslate2D(helperMatrix, translateValue, 0d);
|
||||
} else if ("translateY".equals(transformType)) {
|
||||
double translateValue = 0;
|
||||
if (transform.getType(transformType) == ReadableType.String) {
|
||||
if (transform.getType(transformType) == ReadableType.String
|
||||
&& allowPercentageResolution) {
|
||||
translateValue = parseTranslateValue(transform.getString(transformType), viewHeight);
|
||||
} else {
|
||||
translateValue = transform.getDouble(transformType);
|
||||
@@ -167,7 +191,10 @@ public class TransformHelper {
|
||||
}
|
||||
|
||||
private static float[] getTranslateForTransformOrigin(
|
||||
float viewWidth, float viewHeight, ReadableArray transformOrigin) {
|
||||
float viewWidth,
|
||||
float viewHeight,
|
||||
ReadableArray transformOrigin,
|
||||
boolean allowPercentageResolution) {
|
||||
if (transformOrigin == null || (viewHeight == 0 && viewWidth == 0)) {
|
||||
return null;
|
||||
}
|
||||
@@ -183,10 +210,12 @@ public class TransformHelper {
|
||||
break;
|
||||
case String:
|
||||
{
|
||||
String part = transformOrigin.getString(i);
|
||||
if (part.endsWith("%")) {
|
||||
float val = Float.parseFloat(part.substring(0, part.length() - 1));
|
||||
origin[i] = (i == 0 ? viewWidth : viewHeight) * val / 100.0f;
|
||||
if (allowPercentageResolution) {
|
||||
String part = transformOrigin.getString(i);
|
||||
if (part.endsWith("%")) {
|
||||
float val = Float.parseFloat(part.substring(0, part.length() - 1));
|
||||
origin[i] = (i == 0 ? viewWidth : viewHeight) * val / 100.0f;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
+8
@@ -7,6 +7,8 @@
|
||||
|
||||
package com.facebook.react.uimanager.common
|
||||
|
||||
import android.view.View
|
||||
|
||||
public object ViewUtil {
|
||||
|
||||
public const val NO_SURFACE_ID: Int = -1
|
||||
@@ -26,6 +28,12 @@ public object ViewUtil {
|
||||
UIManagerType.DEFAULT
|
||||
}
|
||||
|
||||
/**
|
||||
* Overload for {@link #getUIManagerType(int)} that uses the view's id to determine if it
|
||||
* originated from Fabric
|
||||
*/
|
||||
@JvmStatic @UIManagerType public fun getUIManagerType(view: View): Int = getUIManagerType(view.id)
|
||||
|
||||
/**
|
||||
* Version of getUIManagerType that uses both surfaceId and viewTag heuristics
|
||||
*
|
||||
|
||||
+9
-4
@@ -605,6 +605,7 @@ public class CSSBackgroundDrawable extends Drawable {
|
||||
}
|
||||
|
||||
// Clip border ONLY if its color is non transparent
|
||||
float pathAdjustment = 0f;
|
||||
if (Color.alpha(colorLeft) != 0
|
||||
&& Color.alpha(colorTop) != 0
|
||||
&& Color.alpha(colorRight) != 0
|
||||
@@ -615,6 +616,10 @@ public class CSSBackgroundDrawable extends Drawable {
|
||||
mInnerClipTempRectForBorderRadius.bottom -= borderWidth.bottom;
|
||||
mInnerClipTempRectForBorderRadius.left += borderWidth.left;
|
||||
mInnerClipTempRectForBorderRadius.right -= borderWidth.right;
|
||||
|
||||
// only close gap between border and main path if we draw the border, otherwise
|
||||
// we wind up pixelating small pixel-radius curves
|
||||
pathAdjustment = mGapBetweenPaths;
|
||||
}
|
||||
|
||||
mTempRectForCenterDrawPath.top += borderWidth.top * 0.5f;
|
||||
@@ -661,10 +666,10 @@ public class CSSBackgroundDrawable extends Drawable {
|
||||
// (mInnerClipTempRectForBorderRadius), ensuring the border can be
|
||||
// drawn on top without the gap.
|
||||
mBackgroundColorRenderPath.addRoundRect(
|
||||
mInnerClipTempRectForBorderRadius.left - mGapBetweenPaths,
|
||||
mInnerClipTempRectForBorderRadius.top - mGapBetweenPaths,
|
||||
mInnerClipTempRectForBorderRadius.right + mGapBetweenPaths,
|
||||
mInnerClipTempRectForBorderRadius.bottom + mGapBetweenPaths,
|
||||
mInnerClipTempRectForBorderRadius.left - pathAdjustment,
|
||||
mInnerClipTempRectForBorderRadius.top - pathAdjustment,
|
||||
mInnerClipTempRectForBorderRadius.right + pathAdjustment,
|
||||
mInnerClipTempRectForBorderRadius.bottom + pathAdjustment,
|
||||
new float[] {
|
||||
innerTopLeftRadiusX,
|
||||
innerTopLeftRadiusY,
|
||||
|
||||
+7
-5
@@ -12,7 +12,7 @@ import android.net.Uri
|
||||
import java.util.Objects
|
||||
|
||||
/** Class describing an image source (network URI or resource) and size. */
|
||||
public class ImageSource
|
||||
public open class ImageSource
|
||||
@JvmOverloads
|
||||
constructor(
|
||||
context: Context,
|
||||
@@ -23,12 +23,14 @@ constructor(
|
||||
) {
|
||||
|
||||
/** Get the URI for this image - can be either a parsed network URI or a resource URI. */
|
||||
public val uri: Uri = computeUri(context)
|
||||
public open val uri: Uri = computeUri(context)
|
||||
/** Get the area of this image. */
|
||||
public val size: Double = width * height
|
||||
/** Get whether this image source represents an Android resource or a network URI. */
|
||||
public var isResource: Boolean = false
|
||||
private set
|
||||
public open val isResource: Boolean
|
||||
get() = _isResource
|
||||
|
||||
private var _isResource: Boolean = false
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
if (this === other) {
|
||||
@@ -58,7 +60,7 @@ constructor(
|
||||
}
|
||||
|
||||
private fun computeLocalUri(context: Context): Uri {
|
||||
isResource = true
|
||||
_isResource = true
|
||||
return ResourceDrawableIdHelper.instance.getResourceDrawableUri(context, source)
|
||||
}
|
||||
|
||||
|
||||
+11
-1
@@ -23,6 +23,7 @@ import com.facebook.react.common.ReactConstants;
|
||||
import com.facebook.react.common.annotations.VisibleForTesting;
|
||||
import com.facebook.react.module.annotations.ReactModule;
|
||||
import com.facebook.react.uimanager.LengthPercentage;
|
||||
import com.facebook.react.uimanager.LengthPercentageType;
|
||||
import com.facebook.react.uimanager.PixelUtil;
|
||||
import com.facebook.react.uimanager.PointerEvents;
|
||||
import com.facebook.react.uimanager.Spacing;
|
||||
@@ -31,6 +32,8 @@ import com.facebook.react.uimanager.UIManagerHelper;
|
||||
import com.facebook.react.uimanager.ViewProps;
|
||||
import com.facebook.react.uimanager.annotations.ReactProp;
|
||||
import com.facebook.react.uimanager.annotations.ReactPropGroup;
|
||||
import com.facebook.react.uimanager.common.UIManagerType;
|
||||
import com.facebook.react.uimanager.common.ViewUtil;
|
||||
import com.facebook.react.uimanager.events.EventDispatcher;
|
||||
import com.facebook.react.uimanager.style.BorderRadiusProp;
|
||||
import com.facebook.yoga.YogaConstants;
|
||||
@@ -131,9 +134,16 @@ public class ReactViewManager extends ReactClippingViewManager<ReactViewGroup> {
|
||||
ViewProps.BORDER_START_START_RADIUS,
|
||||
})
|
||||
public void setBorderRadius(ReactViewGroup view, int index, Dynamic rawBorderRadius) {
|
||||
|
||||
@Nullable LengthPercentage borderRadius = LengthPercentage.setFromDynamic(rawBorderRadius);
|
||||
|
||||
// We do not support percentage border radii on Paper in order to be consistent with iOS (to
|
||||
// avoid developer surprise if it works on one platform but not another).
|
||||
if (ViewUtil.getUIManagerType(view) != UIManagerType.FABRIC
|
||||
&& borderRadius != null
|
||||
&& borderRadius.getUnit() == LengthPercentageType.PERCENT) {
|
||||
borderRadius = null;
|
||||
}
|
||||
|
||||
view.setBorderRadius(BorderRadiusProp.values()[index], borderRadius);
|
||||
}
|
||||
|
||||
|
||||
+11
-2
@@ -7,6 +7,8 @@
|
||||
|
||||
#include "JCxxInspectorPackagerConnectionWebSocketDelegate.h"
|
||||
|
||||
#include <optional>
|
||||
|
||||
using namespace facebook::jni;
|
||||
|
||||
namespace facebook::react::jsinspector_modern {
|
||||
@@ -17,10 +19,17 @@ JCxxInspectorPackagerConnectionWebSocketDelegate::
|
||||
: cxxDelegate_(cxxDelegate) {}
|
||||
|
||||
void JCxxInspectorPackagerConnectionWebSocketDelegate::didFailWithError(
|
||||
alias_ref<JOptionalInt::javaobject> posixCode,
|
||||
alias_ref<jni::JInteger> posixCode,
|
||||
const std::string& error) {
|
||||
std::optional<int> posixCodeVal;
|
||||
|
||||
// Handle @Nullable JInteger param
|
||||
if (posixCode.get() != nullptr) {
|
||||
posixCodeVal = posixCode->intValue();
|
||||
}
|
||||
|
||||
if (auto delegate = cxxDelegate_.lock()) {
|
||||
delegate->didFailWithError(*posixCode, error);
|
||||
delegate->didFailWithError(posixCodeVal, error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-3
@@ -7,8 +7,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "JOptional.h"
|
||||
|
||||
#include <fbjni/fbjni.h>
|
||||
#include <jsinspector-modern/InspectorPackagerConnection.h>
|
||||
|
||||
@@ -29,7 +27,7 @@ class JCxxInspectorPackagerConnectionWebSocketDelegate
|
||||
"Lcom/facebook/react/devsupport/CxxInspectorPackagerConnection$WebSocketDelegate;";
|
||||
|
||||
void didFailWithError(
|
||||
jni::alias_ref<JOptionalInt::javaobject> posixCode,
|
||||
jni::alias_ref<jni::JInteger> posixCode,
|
||||
const std::string& error);
|
||||
|
||||
void didReceiveMessage(const std::string& message);
|
||||
|
||||
@@ -1,29 +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.
|
||||
*/
|
||||
|
||||
#include "JOptional.h"
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
int JOptionalInt::getAsInt() const {
|
||||
static auto method = javaClassStatic()->getMethod<jint()>("getAsInt");
|
||||
return method(self());
|
||||
}
|
||||
|
||||
bool JOptionalInt::isPresent() const {
|
||||
static auto method = javaClassStatic()->getMethod<jboolean()>("isPresent");
|
||||
return method(self());
|
||||
}
|
||||
|
||||
JOptionalInt::operator std::optional<int>() const {
|
||||
if (!isPresent()) {
|
||||
return {};
|
||||
}
|
||||
return getAsInt();
|
||||
}
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -1,27 +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.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <fbjni/fbjni.h>
|
||||
|
||||
#include <optional>
|
||||
|
||||
// TODO(moti): Consider moving this into fbjni
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
class JOptionalInt : public facebook::jni::JavaClass<JOptionalInt> {
|
||||
public:
|
||||
static auto constexpr kJavaDescriptor = "Ljava/util/OptionalInt;";
|
||||
|
||||
int getAsInt() const;
|
||||
bool isPresent() const;
|
||||
operator std::optional<int>() const;
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "JDynamicNative.h"
|
||||
#include "ReadableNativeArray.h"
|
||||
#include "ReadableNativeMap.h"
|
||||
|
||||
using namespace facebook::jni;
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
jboolean JDynamicNative::isNullNative() {
|
||||
return payload_.isNull();
|
||||
}
|
||||
|
||||
jni::local_ref<ReadableType> JDynamicNative::getTypeNative() {
|
||||
return ReadableType::getType(payload_.type());
|
||||
}
|
||||
|
||||
jni::local_ref<jstring> JDynamicNative::asString() {
|
||||
return jni::make_jstring(payload_.asString());
|
||||
}
|
||||
|
||||
jboolean JDynamicNative::asBoolean() {
|
||||
return payload_.asBool();
|
||||
}
|
||||
|
||||
jdouble JDynamicNative::asDouble() {
|
||||
return payload_.asDouble();
|
||||
}
|
||||
|
||||
jni::local_ref<ReadableArray> JDynamicNative::asArray() {
|
||||
return jni::adopt_local(reinterpret_cast<ReadableArray::javaobject>(
|
||||
ReadableNativeArray::newObjectCxxArgs(payload_).release()));
|
||||
}
|
||||
|
||||
jni::local_ref<ReadableMap> JDynamicNative::asMap() {
|
||||
return jni::adopt_local(reinterpret_cast<ReadableMap::javaobject>(
|
||||
ReadableNativeMap::createWithContents(std::move(payload_)).release()));
|
||||
}
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "NativeCommon.h"
|
||||
#include "ReadableNativeArray.h"
|
||||
#include "ReadableNativeMap.h"
|
||||
|
||||
#include <fbjni/fbjni.h>
|
||||
#include <folly/dynamic.h>
|
||||
#include <folly/json.h>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
struct JDynamic : public jni::JavaClass<JDynamic> {
|
||||
constexpr static auto kJavaDescriptor = "Lcom/facebook/react/bridge/Dynamic;";
|
||||
};
|
||||
|
||||
class JDynamicNative : public jni::HybridClass<JDynamicNative, JDynamic> {
|
||||
public:
|
||||
constexpr static auto kJavaDescriptor =
|
||||
"Lcom/facebook/react/bridge/DynamicNative;";
|
||||
|
||||
JDynamicNative(folly::dynamic payload) : payload_(std::move(payload)) {}
|
||||
|
||||
static void registerNatives() {
|
||||
javaClassStatic()->registerNatives(
|
||||
{makeNativeMethod("isNullNative", JDynamicNative::isNullNative),
|
||||
makeNativeMethod("getTypeNative", JDynamicNative::getTypeNative),
|
||||
makeNativeMethod("asDouble", JDynamicNative::asDouble),
|
||||
makeNativeMethod("asBoolean", JDynamicNative::asBoolean),
|
||||
makeNativeMethod("asString", JDynamicNative::asString),
|
||||
makeNativeMethod("asArray", JDynamicNative::asArray),
|
||||
makeNativeMethod("asMap", JDynamicNative::asMap)});
|
||||
}
|
||||
|
||||
private:
|
||||
friend HybridBase;
|
||||
|
||||
jni::local_ref<ReadableType> getTypeNative();
|
||||
jni::local_ref<jstring> asString();
|
||||
jboolean asBoolean();
|
||||
jdouble asDouble();
|
||||
jboolean isNullNative();
|
||||
jni::local_ref<ReadableArray> asArray();
|
||||
jni::local_ref<ReadableMap> asMap();
|
||||
|
||||
folly::dynamic payload_;
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "CatalystInstanceImpl.h"
|
||||
#include "CxxModuleWrapperBase.h"
|
||||
#include "JCallback.h"
|
||||
#include "JDynamicNative.h"
|
||||
#include "JInspector.h"
|
||||
#include "JReactMarker.h"
|
||||
#include "JavaScriptExecutorHolder.h"
|
||||
@@ -89,6 +90,7 @@ extern "C" JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
|
||||
NativeMap::registerNatives();
|
||||
ReadableNativeMap::registerNatives();
|
||||
WritableNativeMap::registerNatives();
|
||||
JDynamicNative::registerNatives();
|
||||
JReactMarker::registerNatives();
|
||||
JInspector::registerNatives();
|
||||
ReactInstanceManagerInspectorTarget::registerNatives();
|
||||
|
||||
@@ -17,8 +17,8 @@ namespace facebook::react {
|
||||
constexpr struct {
|
||||
int32_t Major = 0;
|
||||
int32_t Minor = 75;
|
||||
int32_t Patch = 0;
|
||||
std::string_view Prerelease = "rc.6";
|
||||
int32_t Patch = 3;
|
||||
std::string_view Prerelease = "";
|
||||
} ReactNativeVersion;
|
||||
|
||||
} // namespace facebook::react
|
||||
|
||||
+8
-1
@@ -19,6 +19,7 @@
|
||||
#include <jsi/JSIDynamic.h>
|
||||
#include <react/bridging/Bridging.h>
|
||||
#include <react/debug/react_native_assert.h>
|
||||
#include <react/jni/JDynamicNative.h>
|
||||
#include <react/jni/NativeMap.h>
|
||||
#include <react/jni/ReadableNativeMap.h>
|
||||
#include <react/jni/WritableNativeMap.h>
|
||||
@@ -373,7 +374,9 @@ JNIArgs convertJSIArgsToJNIArgs(
|
||||
continue;
|
||||
}
|
||||
|
||||
if (arg->isNull() || arg->isUndefined()) {
|
||||
// Dynamic encapsulates the Null type so we don't want to return null here.
|
||||
if ((arg->isNull() && type != "Lcom/facebook/react/bridge/Dynamic;") ||
|
||||
arg->isUndefined()) {
|
||||
jarg->l = nullptr;
|
||||
} else if (type == "Ljava/lang/Double;") {
|
||||
if (!arg->isNumber()) {
|
||||
@@ -436,6 +439,10 @@ JNIArgs convertJSIArgsToJNIArgs(
|
||||
auto jParams =
|
||||
ReadableNativeMap::createWithContents(std::move(dynamicFromValue));
|
||||
jarg->l = makeGlobalIfNecessary(jParams.release());
|
||||
} else if (type == "Lcom/facebook/react/bridge/Dynamic;") {
|
||||
auto dynamicFromValue = jsi::dynamicFromValue(rt, *arg);
|
||||
auto jParams = JDynamicNative::newObjectCxxArgs(dynamicFromValue);
|
||||
jarg->l = makeGlobalIfNecessary(jParams.release());
|
||||
} else {
|
||||
throw JavaTurboModuleInvalidArgumentTypeException(
|
||||
type, argIndex, methodName);
|
||||
|
||||
+40
@@ -13,12 +13,14 @@ import android.widget.Toast;
|
||||
import com.facebook.proguard.annotations.DoNotStrip;
|
||||
import com.facebook.react.bridge.Arguments;
|
||||
import com.facebook.react.bridge.Callback;
|
||||
import com.facebook.react.bridge.Dynamic;
|
||||
import com.facebook.react.bridge.Promise;
|
||||
import com.facebook.react.bridge.ReactApplicationContext;
|
||||
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
||||
import com.facebook.react.bridge.ReactMethod;
|
||||
import com.facebook.react.bridge.ReadableArray;
|
||||
import com.facebook.react.bridge.ReadableMap;
|
||||
import com.facebook.react.bridge.ReadableType;
|
||||
import com.facebook.react.bridge.WritableArray;
|
||||
import com.facebook.react.bridge.WritableMap;
|
||||
import com.facebook.react.bridge.WritableNativeArray;
|
||||
@@ -155,6 +157,44 @@ public class SampleLegacyModule extends ReactContextBaseJavaModule {
|
||||
return map;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@ReactMethod(isBlockingSynchronousMethod = true)
|
||||
public WritableMap getDynamic(Dynamic dynamic) {
|
||||
WritableNativeMap resultMap = new WritableNativeMap();
|
||||
ReadableType type = dynamic.getType();
|
||||
if (type == ReadableType.Null) {
|
||||
log("getDynamic as Null", dynamic, dynamic);
|
||||
resultMap.putString("type", "Null");
|
||||
resultMap.putNull("value");
|
||||
} else if (type == ReadableType.Boolean) {
|
||||
boolean result = dynamic.asBoolean();
|
||||
log("getDynamic as Boolean", dynamic, result);
|
||||
resultMap.putString("type", "Boolean");
|
||||
resultMap.putBoolean("value", result);
|
||||
} else if (type == ReadableType.Number) {
|
||||
int result = dynamic.asInt();
|
||||
log("getDynamic as Number", dynamic, result);
|
||||
resultMap.putString("type", "Number");
|
||||
resultMap.putInt("value", result);
|
||||
} else if (type == ReadableType.String) {
|
||||
String result = dynamic.asString();
|
||||
log("getDynamic as String", dynamic, result);
|
||||
resultMap.putString("type", "String");
|
||||
resultMap.putString("value", result);
|
||||
} else if (type == ReadableType.Array) {
|
||||
ReadableArray result = dynamic.asArray();
|
||||
log("getDynamic as Array", dynamic, result);
|
||||
resultMap.putString("type", "Array");
|
||||
resultMap.putArray("value", result);
|
||||
} else if (type == ReadableType.Map) {
|
||||
ReadableMap result = dynamic.asMap();
|
||||
log("getDynamic as Map", dynamic, result);
|
||||
resultMap.putString("type", "Map");
|
||||
resultMap.putMap("value", result);
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
@DoNotStrip
|
||||
@SuppressWarnings("unused")
|
||||
@ReactMethod(isBlockingSynchronousMethod = true)
|
||||
|
||||
Vendored
+3
-3
@@ -42,10 +42,10 @@ const DEFAULT_REGISTRY_HOST =
|
||||
const HEAD = '1000.0.0';
|
||||
|
||||
// We're going to deprecate the `init` command proxying requests to @react-native-community/cli transparently
|
||||
// on September 30th, 2024 or 0.76 (whichever arrives first). This is part of work to decouple of community CLI from React Native core.
|
||||
// on December 31th, 2024 or 0.76 (whichever arrives first). This is part of work to decouple of community CLI from React Native core.
|
||||
//
|
||||
// See https://github.com/react-native-community/discussions-and-proposals/blob/main/proposals/0759-react-native-frameworks.md
|
||||
const CLI_DEPRECATION_DATE = new Date('2024-09-30');
|
||||
const CLI_DEPRECATION_DATE = new Date('2024-12-31');
|
||||
|
||||
async function getLatestVersion(registryHost = DEFAULT_REGISTRY_HOST) {
|
||||
return new Promise((res, rej) => {
|
||||
@@ -119,7 +119,7 @@ function warnWithDeprecated() {
|
||||
}
|
||||
|
||||
console.warn(`
|
||||
${chalk.yellow('🚨')}️ The \`init\` command is deprecated.
|
||||
🚨️ The \`init\` command is deprecated.
|
||||
|
||||
- Switch to ${chalk.dim('npx @react-native-community/cli init')} for the identical behavior.
|
||||
- Refer to the documentation for information about alternative tools: ${chalk.dim('https://reactnative.dev/docs/getting-started')}`);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "react-native",
|
||||
"version": "0.75.0-rc.6",
|
||||
"version": "0.75.3",
|
||||
"description": "A framework for building native apps using React",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -109,21 +109,22 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@jest/create-cache-key-function": "^29.6.3",
|
||||
"@react-native-community/cli": "14.0.0",
|
||||
"@react-native-community/cli-platform-android": "14.0.0",
|
||||
"@react-native-community/cli-platform-ios": "14.0.0",
|
||||
"@react-native/assets-registry": "0.75.0-rc.6",
|
||||
"@react-native/codegen": "0.75.0-rc.6",
|
||||
"@react-native/community-cli-plugin": "0.75.0-rc.6",
|
||||
"@react-native/gradle-plugin": "0.75.0-rc.6",
|
||||
"@react-native/js-polyfills": "0.75.0-rc.6",
|
||||
"@react-native/normalize-colors": "0.75.0-rc.6",
|
||||
"@react-native/virtualized-lists": "0.75.0-rc.6",
|
||||
"@react-native-community/cli": "14.1.0",
|
||||
"@react-native-community/cli-platform-android": "14.1.0",
|
||||
"@react-native-community/cli-platform-ios": "14.1.0",
|
||||
"@react-native/assets-registry": "0.75.3",
|
||||
"@react-native/codegen": "0.75.3",
|
||||
"@react-native/community-cli-plugin": "0.75.3",
|
||||
"@react-native/gradle-plugin": "0.75.3",
|
||||
"@react-native/js-polyfills": "0.75.3",
|
||||
"@react-native/normalize-colors": "0.75.3",
|
||||
"@react-native/virtualized-lists": "0.75.3",
|
||||
"abort-controller": "^3.0.0",
|
||||
"anser": "^1.4.9",
|
||||
"ansi-regex": "^5.0.0",
|
||||
"base64-js": "^1.5.1",
|
||||
"chalk": "^4.0.0",
|
||||
"commander": "^9.4.1",
|
||||
"event-target-shim": "^5.0.1",
|
||||
"flow-enums-runtime": "^0.0.6",
|
||||
"glob": "^7.1.1",
|
||||
|
||||
+2
@@ -31,6 +31,8 @@ program
|
||||
'npx react-native config',
|
||||
)
|
||||
.option('--load-config <string>', 'JSON project config')
|
||||
.option('--verbose', 'Additional logs', () => true, false)
|
||||
.allowUnknownOption()
|
||||
.action(async function handleAction() {
|
||||
let config = null;
|
||||
let options = program.opts();
|
||||
|
||||
@@ -73,6 +73,7 @@ def list_native_modules!(config_command)
|
||||
found_pods.push({
|
||||
"configurations": configurations,
|
||||
"name": name,
|
||||
"root": package["root"],
|
||||
"path": relative_path.to_path,
|
||||
"podspec_path": podspec_path,
|
||||
"script_phases": script_phases
|
||||
@@ -168,7 +169,7 @@ def link_native_modules!(config)
|
||||
|
||||
# Support passing in a path relative to the root of the package
|
||||
if phase["path"]
|
||||
phase["script"] = File.read(File.expand_path(phase["path"], package[:path]))
|
||||
phase["script"] = File.read(File.expand_path(phase["path"], package[:root]))
|
||||
phase.delete("path")
|
||||
end
|
||||
|
||||
|
||||
@@ -241,7 +241,7 @@ class ReactNativePodsUtils
|
||||
node_binary = `type -a node`.split("\n").map { |path|
|
||||
path.gsub!("node is ", "")
|
||||
}.select { |b|
|
||||
return !b.start_with?("/var")
|
||||
!b.start_with?("/var")
|
||||
}
|
||||
|
||||
node_binary = node_binary[0]
|
||||
|
||||
@@ -225,7 +225,7 @@ function extractSupportedApplePlatforms(dependency, dependencyPath) {
|
||||
return supportedPlatformsMap;
|
||||
}
|
||||
|
||||
function findExternalLibraries(pkgJson) {
|
||||
function findExternalLibraries(pkgJson, projectRoot) {
|
||||
const dependencies = {
|
||||
...pkgJson.dependencies,
|
||||
...pkgJson.devDependencies,
|
||||
@@ -240,6 +240,7 @@ function findExternalLibraries(pkgJson) {
|
||||
try {
|
||||
const configFilePath = require.resolve(
|
||||
path.join(dependency, 'package.json'),
|
||||
{paths: [projectRoot]},
|
||||
);
|
||||
const configFile = JSON.parse(fs.readFileSync(configFilePath));
|
||||
const codegenConfigFileDir = path.dirname(configFilePath);
|
||||
@@ -533,7 +534,7 @@ function findCodegenEnabledLibraries(pkgJson, projectRoot) {
|
||||
} else {
|
||||
return [
|
||||
...projectLibraries,
|
||||
...findExternalLibraries(pkgJson),
|
||||
...findExternalLibraries(pkgJson, projectRoot),
|
||||
...findLibrariesFromReactNativeConfig(projectRoot),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
hermes-2024-07-01-RNv0.75.0-1edbe36ce92fef2c4d427f5c4e104f2758f4b692
|
||||
hermes-2024-08-15-RNv0.75.1-4b3bf912cc0f705b51b71ce1a5b8bd79b93a451b
|
||||
@@ -12,9 +12,9 @@ set -e
|
||||
# Given a specific target, retrieve the right architecture for it
|
||||
# $1 the target you want to build. Allowed values: iphoneos, iphonesimulator, catalyst, xros, xrsimulator
|
||||
function get_architecture {
|
||||
if [[ $1 == "iphoneos" || $1 == "xros" || $1 == "xrsimulator" ]]; then
|
||||
if [[ $1 == "iphoneos" || $1 == "xros" ]]; then
|
||||
echo "arm64"
|
||||
elif [[ $1 == "iphonesimulator" ]]; then
|
||||
elif [[ $1 == "iphonesimulator" || $1 == "xrsimulator" ]]; then
|
||||
echo "x86_64;arm64"
|
||||
elif [[ $1 == "catalyst" ]]; then
|
||||
echo "x86_64;arm64"
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
import * as React from 'react';
|
||||
import {View, StyleSheet} from 'react-native';
|
||||
import {View, StyleSheet, type ShadowStyleIOS} from 'react-native';
|
||||
|
||||
export function App() {
|
||||
return <View style={styles.container} />;
|
||||
@@ -40,3 +40,15 @@ const styles2 = StyleSheet.create({
|
||||
magrinRight: 1,
|
||||
},
|
||||
});
|
||||
|
||||
const shadowOffsetConst: Readonly<ShadowStyleIOS['shadowOffset']> = {
|
||||
width: 1,
|
||||
height: 2,
|
||||
};
|
||||
|
||||
const styles3 = StyleSheet.create({
|
||||
transforms: {
|
||||
transform: [{translateX: 40}] as const,
|
||||
shadowOffset: shadowOffsetConst,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@react-native/tester-e2e",
|
||||
"private": true,
|
||||
"version": "0.75.0-rc.6",
|
||||
"version": "0.75.3",
|
||||
"license": "MIT",
|
||||
"description": "React Native E2E tester app.",
|
||||
"homepage": "https://github.com/facebook/react-native/tree/HEAD/packages/rn-tester-e2e",
|
||||
|
||||
+280
-280
File diff suppressed because it is too large
Load Diff
@@ -142,6 +142,17 @@ class SampleLegacyModuleExample extends React.Component<{||}, State> {
|
||||
getSampleLegacyModule()?.getObject({a: 1, b: 'foo', c: null}),
|
||||
getValue: () =>
|
||||
getSampleLegacyModule()?.getValue(5, 'test', {a: 1, b: 'foo'}),
|
||||
getDynamicWithNull: () => getSampleLegacyModule()?.getDynamic(null),
|
||||
getDynamicWithBoolean: () =>
|
||||
getSampleLegacyModule()?.getDynamic(true),
|
||||
getDynamicWithNumber: () =>
|
||||
getSampleLegacyModule()?.getDynamic(42.24),
|
||||
getDynamicWithString: () =>
|
||||
getSampleLegacyModule()?.getDynamic('The answer is 42'),
|
||||
getDynamicWithArray: () =>
|
||||
getSampleLegacyModule()?.getDynamic(['the', 'answer', 'is', '42']),
|
||||
getDynamicWithMap: () =>
|
||||
getSampleLegacyModule()?.getDynamic({answer: '42'}),
|
||||
callback: () =>
|
||||
getSampleLegacyModule()?.getValueWithCallback(callbackValue =>
|
||||
this._setResult('callback', callbackValue),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/tester",
|
||||
"version": "0.75.0-rc.6",
|
||||
"version": "0.75.3",
|
||||
"private": true,
|
||||
"description": "React Native tester app.",
|
||||
"license": "MIT",
|
||||
@@ -26,8 +26,8 @@
|
||||
"flow-enums-runtime": "^0.0.6",
|
||||
"invariant": "^2.2.4",
|
||||
"nullthrows": "^1.1.1",
|
||||
"@react-native/oss-library-example": "0.75.0-rc.6",
|
||||
"@react-native/popup-menu-android": "0.75.0-rc.6"
|
||||
"@react-native/oss-library-example": "0.75.3",
|
||||
"@react-native/popup-menu-android": "0.75.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "18.3.1",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/typescript-config",
|
||||
"version": "0.75.0-rc.6",
|
||||
"version": "0.75.3",
|
||||
"description": "Default TypeScript configuration for React Native apps",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/virtualized-lists",
|
||||
"version": "0.75.0-rc.6",
|
||||
"version": "0.75.3",
|
||||
"description": "Virtualized lists for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
Reference in New Issue
Block a user