mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a2b836f8f9 |
@@ -9,3 +9,12 @@ end_of_line = lf
|
||||
insert_final_newline = true
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.gradle]
|
||||
indent_size = 4
|
||||
|
||||
[*.kts]
|
||||
indent_size = 4
|
||||
|
||||
[BUCK]
|
||||
indent_size = 4
|
||||
|
||||
+2
-1
@@ -48,6 +48,7 @@ packages/react-native/flow/
|
||||
[options]
|
||||
enums=true
|
||||
experimental.pattern_matching=true
|
||||
experimental.pattern_matching.includes=<PROJECT_ROOT>/packages/react-native/src/private/components/virtualview/
|
||||
casting_syntax=both
|
||||
component_syntax=true
|
||||
|
||||
@@ -104,4 +105,4 @@ untyped-import
|
||||
untyped-type-import
|
||||
|
||||
[version]
|
||||
^0.275.0
|
||||
^0.274.0
|
||||
|
||||
@@ -14,23 +14,23 @@ runs:
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: hermes-workspace
|
||||
path: 'C:\tmp\hermes'
|
||||
path: 'D:\tmp\hermes'
|
||||
- name: Set up workspace
|
||||
shell: powershell
|
||||
run: |
|
||||
mkdir -p C:\tmp\hermes\osx-bin
|
||||
mkdir -p D:\tmp\hermes\osx-bin
|
||||
mkdir -p .\packages\react-native\sdks\hermes
|
||||
cp -r -Force C:\tmp\hermes\hermes\* .\packages\react-native\sdks\hermes\.
|
||||
cp -r -Force D:\tmp\hermes\hermes\* .\packages\react-native\sdks\hermes\.
|
||||
cp -r -Force .\packages\react-native\sdks\hermes-engine\utils\* .\packages\react-native\sdks\hermes\.
|
||||
- name: Windows cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
key: v3-hermes-${{ github.job }}-windows-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}
|
||||
path: |
|
||||
C:\tmp\hermes\win64-bin\
|
||||
C:\tmp\hermes\hermes\icu\
|
||||
C:\tmp\hermes\hermes\deps\
|
||||
C:\tmp\hermes\hermes\build_release\
|
||||
D:\tmp\hermes\win64-bin\
|
||||
D:\tmp\hermes\hermes\icu\
|
||||
D:\tmp\hermes\hermes\deps\
|
||||
D:\tmp\hermes\hermes\build_release\
|
||||
- name: setup-msbuild
|
||||
uses: microsoft/setup-msbuild@v1.3.2
|
||||
- name: Set up workspace
|
||||
@@ -83,4 +83,4 @@ runs:
|
||||
uses: actions/upload-artifact@v4.3.4
|
||||
with:
|
||||
name: hermes-win64-bin
|
||||
path: C:\tmp\hermes\win64-bin\
|
||||
path: D:\tmp\hermes\win64-bin\
|
||||
|
||||
@@ -129,7 +129,7 @@ runs:
|
||||
run: yarn build
|
||||
- name: Build types
|
||||
shell: bash
|
||||
run: yarn build-types --skip-snapshot
|
||||
run: yarn build-types
|
||||
# Continue with publish steps
|
||||
- name: Set npm credentials
|
||||
if: ${{ inputs.release-type == 'release' ||
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
name: diff-js-api-breaking-changes
|
||||
description: Check for breaking changes in the public React Native JS API
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Fetch snapshot from PR head
|
||||
shell: bash
|
||||
env:
|
||||
SCRATCH_DIR: ${{ runner.temp }}/diff-js-api-breaking-changes
|
||||
run: |
|
||||
mkdir $SCRATCH_DIR
|
||||
git fetch --depth=1 origin ${{ github.event.pull_request.head.sha }}
|
||||
git show ${{ github.event.pull_request.head.sha }}:packages/react-native/ReactNativeApi.d.ts > $SCRATCH_DIR/ReactNativeApi-after.d.ts \
|
||||
|| echo "" > $SCRATCH_DIR/ReactNativeApi.d.ts
|
||||
- name: Run breaking change detection
|
||||
shell: bash
|
||||
env:
|
||||
SCRATCH_DIR: ${{ runner.temp }}/diff-js-api-breaking-changes
|
||||
run: |
|
||||
node ./scripts/js-api/diff-api-snapshot \
|
||||
${{ github.workspace }}/packages/react-native/ReactNativeApi.d.ts \
|
||||
$SCRATCH_DIR/ReactNativeApi-after.d.ts \
|
||||
> $SCRATCH_DIR/output.json
|
||||
@@ -49,7 +49,7 @@ runs:
|
||||
run: yarn run lint-markdown
|
||||
- name: Build types
|
||||
shell: bash
|
||||
run: yarn build-types --skip-snapshot
|
||||
run: yarn build-types
|
||||
- name: Run typescript check of generated types
|
||||
shell: bash
|
||||
run: yarn test-generated-typescript
|
||||
|
||||
@@ -4,7 +4,7 @@ inputs:
|
||||
node-version:
|
||||
description: 'The node.js version to use'
|
||||
required: false
|
||||
default: '22.14.0'
|
||||
default: '22'
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
|
||||
@@ -48,14 +48,6 @@ runs:
|
||||
- name: Print third-party folder
|
||||
shell: bash
|
||||
run: ls -lR /tmp/third-party
|
||||
- name: Download React Native Prebuilds
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: ReactCore${{ inputs.flavor }}.xcframework.tar.gz
|
||||
path: /tmp/ReactCore
|
||||
- name: Print ReactCore folder
|
||||
shell: bash
|
||||
run: ls -lR /tmp/ReactCore
|
||||
- name: Install iOS dependencies - Configuration ${{ inputs.flavor }};
|
||||
shell: bash
|
||||
run: |
|
||||
@@ -81,7 +73,6 @@ runs:
|
||||
TARBALL_FILENAME=$(node ../../packages/react-native/scripts/hermes/get-tarball-name.js --buildType "$BUILD_TYPE")
|
||||
export HERMES_ENGINE_TARBALL_PATH="$HERMES_WS_DIR/hermes-runtime-darwin/$TARBALL_FILENAME"
|
||||
export RCT_USE_LOCAL_RN_DEP="/tmp/third-party/ReactNativeDependencies${{ inputs.flavor }}.xcframework.tar.gz"
|
||||
export RCT_TESTONLY_RNCORE_TARBALL_PATH="/tmp/ReactCore/ReactCore${{ inputs.flavor }}.xcframework.tar.gz"
|
||||
|
||||
yarn bootstrap ios "${args[@]}" | cat
|
||||
|
||||
|
||||
@@ -94,14 +94,6 @@ runs:
|
||||
- name: Print third-party folder
|
||||
shell: bash
|
||||
run: ls -lR /tmp/third-party
|
||||
- name: Download React Native Prebuilds
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: ReactCore${{ inputs.flavor }}.xcframework.tar.gz
|
||||
path: /tmp/ReactCore
|
||||
- name: Print ReactCore folder
|
||||
shell: bash
|
||||
run: ls -lR /tmp/ReactCore
|
||||
- name: Setup xcode build cache
|
||||
uses: ./.github/actions/setup-xcode-build-cache
|
||||
with:
|
||||
@@ -113,13 +105,12 @@ runs:
|
||||
shell: bash
|
||||
run: |
|
||||
export HERMES_ENGINE_TARBALL_PATH=$HERMES_ENGINE_TARBALL_PATH
|
||||
export RCT_USE_LOCAL_RN_DEP="/tmp/third-party/ReactNativeDependencies${{ inputs.flavor }}.xcframework.tar.gz"
|
||||
export RCT_TESTONLY_RNCORE_TARBALL_PATH="/tmp/ReactCore/ReactCore${{ inputs.flavor }}.xcframework.tar.gz"
|
||||
|
||||
if [[ ${{ inputs.use-frameworks }} == "DynamicFrameworks" ]]; then
|
||||
export USE_FRAMEWORKS=dynamic
|
||||
fi
|
||||
|
||||
export RCT_USE_LOCAL_RN_DEP="/tmp/third-party/ReactNativeDependencies${{ inputs.flavor }}.xcframework.tar.gz"
|
||||
cd packages/rn-tester
|
||||
|
||||
bundle install
|
||||
|
||||
@@ -2,8 +2,6 @@ name: yarn-install
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Setup node.js
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Install dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
|
||||
@@ -38,7 +38,7 @@ describe('#verifyArtifactsAreOnMaven', () => {
|
||||
|
||||
expect(mockSleep).toHaveBeenCalledTimes(1);
|
||||
expect(mockFetch).toHaveBeenCalledWith(
|
||||
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1/react-native-artifacts-0.78.1.pom',
|
||||
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1',
|
||||
);
|
||||
});
|
||||
|
||||
@@ -55,7 +55,7 @@ describe('#verifyArtifactsAreOnMaven', () => {
|
||||
|
||||
expect(mockSleep).toHaveBeenCalledTimes(1);
|
||||
expect(mockFetch).toHaveBeenCalledWith(
|
||||
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1/react-native-artifacts-0.78.1.pom',
|
||||
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1',
|
||||
);
|
||||
});
|
||||
|
||||
@@ -67,7 +67,7 @@ describe('#verifyArtifactsAreOnMaven', () => {
|
||||
|
||||
expect(mockSleep).toHaveBeenCalledTimes(0);
|
||||
expect(mockFetch).toHaveBeenCalledWith(
|
||||
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1/react-native-artifacts-0.78.1.pom',
|
||||
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1',
|
||||
);
|
||||
});
|
||||
|
||||
@@ -81,7 +81,7 @@ describe('#verifyArtifactsAreOnMaven', () => {
|
||||
expect(mockSleep).toHaveBeenCalledTimes(90);
|
||||
expect(mockExit).toHaveBeenCalledWith(1);
|
||||
expect(mockFetch).toHaveBeenCalledWith(
|
||||
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1/react-native-artifacts-0.78.1.pom',
|
||||
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/0.78.1',
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -13,14 +13,13 @@ const SLEEP_S = 60; // 1 minute
|
||||
const MAX_RETRIES = 90; // 90 attempts. Waiting between attempt: 1 min. Total time: 90 min.
|
||||
const ARTIFACT_URL =
|
||||
'https://repo1.maven.org/maven2/com/facebook/react/react-native-artifacts/';
|
||||
const ARTIFACT_NAME = 'react-native-artifacts-';
|
||||
|
||||
async function verifyArtifactsAreOnMaven(version, retries = MAX_RETRIES) {
|
||||
if (version.startsWith('v')) {
|
||||
version = version.substring(1);
|
||||
}
|
||||
|
||||
const artifactUrl = `${ARTIFACT_URL}${version}/${ARTIFACT_NAME}${version}.pom`;
|
||||
const artifactUrl = `${ARTIFACT_URL}${version}`;
|
||||
for (let currentAttempt = 1; currentAttempt <= retries; currentAttempt++) {
|
||||
const response = await fetch(artifactUrl);
|
||||
|
||||
|
||||
@@ -18,10 +18,6 @@ jobs:
|
||||
run: |
|
||||
git config --local user.email "bot@reactnative.dev"
|
||||
git config --local user.name "React Native Bot"
|
||||
- name: Setup xcode
|
||||
uses: ./.github/actions/setup-xcode
|
||||
with:
|
||||
xcode-version: '16.2.0'
|
||||
- name: Extract branch name
|
||||
run: |
|
||||
TAG="${{ github.ref_name }}";
|
||||
|
||||
@@ -22,8 +22,6 @@ jobs:
|
||||
uses: ./.github/actions/setup-node
|
||||
- name: Run yarn install
|
||||
uses: ./.github/actions/yarn-install
|
||||
- name: Run diff-js-api-breaking-changes
|
||||
uses: ./.github/actions/diff-js-api-breaking-changes
|
||||
- name: Danger
|
||||
run: yarn danger ci --use-github-checks --failOnErrors
|
||||
working-directory: private/react-native-bots
|
||||
|
||||
@@ -128,9 +128,9 @@ jobs:
|
||||
runs-on: windows-2025
|
||||
needs: prepare_hermes_workspace
|
||||
env:
|
||||
HERMES_WS_DIR: 'C:\tmp\hermes'
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: 'C:\tmp\hermes\hermes-runtime-darwin'
|
||||
HERMES_OSXBIN_ARTIFACTS_DIR: 'C:\tmp\hermes\osx-bin'
|
||||
HERMES_WS_DIR: 'D:\tmp\hermes'
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: 'D:\tmp\hermes\hermes-runtime-darwin'
|
||||
HERMES_OSXBIN_ARTIFACTS_DIR: 'D:\tmp\hermes\osx-bin'
|
||||
ICU_URL: "https://github.com/unicode-org/icu/releases/download/release-64-2/icu4c-64_2-Win64-MSVC2017.zip"
|
||||
MSBUILD_DIR: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin'
|
||||
CMAKE_DIR: 'C:\Program Files\CMake\bin'
|
||||
|
||||
@@ -23,7 +23,7 @@ jobs:
|
||||
id: restore-ios-slice
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
key: v3-ios-core-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/setup.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
|
||||
key: v3-ios-core-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift') }}-${{ hashFiles('packages/react-native/scripts/ios-prebuild/setup.js') }}
|
||||
path: packages/react-native/
|
||||
- name: Setup node.js
|
||||
if: steps.restore-ios-slice.outputs.cache-hit != 'true'
|
||||
@@ -83,7 +83,7 @@ jobs:
|
||||
# Move the XCFramework in the destination directory
|
||||
mv /tmp/third-party/packages/react-native/third-party/ReactNativeDependencies.xcframework packages/react-native/third-party/ReactNativeDependencies.xcframework
|
||||
|
||||
VERSION=$(jq -r '.version' packages/react-native/package.json)
|
||||
VERSION=$(jq -r '.version' package.json)
|
||||
echo "$VERSION-${{matrix.flavor}}" > "packages/react-native/third-party/version.txt"
|
||||
cat "packages/react-native/third-party/version.txt"
|
||||
# Check destination directory
|
||||
@@ -117,7 +117,7 @@ jobs:
|
||||
uses: actions/cache/save@v4
|
||||
if: ${{ github.ref == 'refs/heads/main' }} # To avoid that the cache explode
|
||||
with:
|
||||
key: v3-ios-core-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/setup.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
|
||||
key: v3-ios-core-${{ matrix.slice }}-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift') }}-${{ hashFiles('packages/react-native/scripts/ios-prebuild/setup.js') }}
|
||||
path: |
|
||||
packages/react-native/.build/output/spm/${{ matrix.flavor }}/Build/Products
|
||||
packages/react-native/.build/headers
|
||||
@@ -140,7 +140,7 @@ jobs:
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: packages/react-native/.build/output/xcframeworks
|
||||
key: v2-ios-core-xcframework-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/setup.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
|
||||
key: v2-ios-core-xcframework-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift') }}-${{ hashFiles('packages/react-native/scripts/ios-prebuild/setup.js') }}
|
||||
- name: Setup node.js
|
||||
if: steps.restore-ios-xcframework.outputs.cache-hit != 'true'
|
||||
uses: ./.github/actions/setup-node
|
||||
@@ -209,4 +209,4 @@ jobs:
|
||||
path: |
|
||||
packages/react-native/.build/output/xcframeworks/ReactCore${{matrix.flavor}}.xcframework.tar.gz
|
||||
packages/react-native/.build/output/xcframeworks/ReactCore${{matrix.flavor}}.framework.dSYM.tar.gz
|
||||
key: v2-ios-core-xcframework-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift', 'packages/react-native/scripts/ios-prebuild/setup.js', 'packages/react-native/React/**/*', 'packages/react-native/ReactCommon/**/*', 'packages/react-native/Libraries/**/*') }}
|
||||
key: v2-ios-core-xcframework-${{ matrix.flavor }}-${{ hashFiles('packages/react-native/Package.swift') }}-${{ hashFiles('packages/react-native/scripts/ios-prebuild/setup.js') }}
|
||||
|
||||
@@ -21,7 +21,7 @@ jobs:
|
||||
- name: Build packages
|
||||
run: yarn build
|
||||
- name: Build types
|
||||
run: yarn build-types --skip-snapshot
|
||||
run: yarn build-types
|
||||
- name: Set NPM auth token
|
||||
run: echo "//registry.npmjs.org/:_authToken=$GHA_NPM_TOKEN" > ~/.npmrc
|
||||
- name: Find and publish all bumped packages
|
||||
|
||||
@@ -125,9 +125,9 @@ jobs:
|
||||
runs-on: windows-2025
|
||||
needs: prepare_hermes_workspace
|
||||
env:
|
||||
HERMES_WS_DIR: 'C:\tmp\hermes'
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: 'C:\tmp\hermes\hermes-runtime-darwin'
|
||||
HERMES_OSXBIN_ARTIFACTS_DIR: 'C:\tmp\hermes\osx-bin'
|
||||
HERMES_WS_DIR: 'D:\tmp\hermes'
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: 'D:\tmp\hermes\hermes-runtime-darwin'
|
||||
HERMES_OSXBIN_ARTIFACTS_DIR: 'D:\tmp\hermes\osx-bin'
|
||||
ICU_URL: "https://github.com/unicode-org/icu/releases/download/release-64-2/icu4c-64_2-Win64-MSVC2017.zip"
|
||||
MSBUILD_DIR: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin'
|
||||
CMAKE_DIR: 'C:\Program Files\CMake\bin'
|
||||
|
||||
@@ -128,7 +128,7 @@ jobs:
|
||||
test_ios_rntester_ruby_3_2_0:
|
||||
runs-on: macos-14
|
||||
needs:
|
||||
[build_apple_slices_hermes, prepare_hermes_workspace, build_hermes_macos, prebuild_apple_dependencies, prebuild_react_native_core]
|
||||
[build_apple_slices_hermes, prepare_hermes_workspace, build_hermes_macos, prebuild_apple_dependencies]
|
||||
env:
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
|
||||
@@ -141,12 +141,31 @@ jobs:
|
||||
ruby-version: "3.2.0"
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
flavor: Debug
|
||||
|
||||
test_ios_rntester_dynamic_frameworks:
|
||||
runs-on: macos-14
|
||||
needs:
|
||||
[build_apple_slices_hermes, prepare_hermes_workspace, build_hermes_macos, prebuild_apple_dependencies]
|
||||
env:
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
|
||||
continue-on-error: true
|
||||
strategy:
|
||||
fail-fast: false
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Run it
|
||||
uses: ./.github/actions/test-ios-rntester
|
||||
with:
|
||||
use-frameworks: DynamicFrameworks
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
|
||||
test_ios_rntester:
|
||||
runs-on: macos-14-large
|
||||
needs:
|
||||
[build_apple_slices_hermes, prepare_hermes_workspace, build_hermes_macos, prebuild_apple_dependencies, prebuild_react_native_core]
|
||||
[build_apple_slices_hermes, prepare_hermes_workspace, build_hermes_macos, prebuild_apple_dependencies]
|
||||
env:
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: /tmp/hermes/hermes-runtime-darwin
|
||||
@@ -155,14 +174,14 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
flavor: [Debug, Release]
|
||||
frameworks: [StaticLibraries, DynamicFrameworks]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Run it
|
||||
uses: ./.github/actions/test-ios-rntester
|
||||
with:
|
||||
use-frameworks: ${{ matrix.frameworks }}
|
||||
run-unit-tests: "false"
|
||||
use-frameworks: StaticLibraries
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
flavor: ${{ matrix.flavor }}
|
||||
@@ -245,14 +264,6 @@ jobs:
|
||||
- name: Print third-party folder
|
||||
shell: bash
|
||||
run: ls -lR /tmp/third-party
|
||||
- name: Download React Native Prebuilds
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: ReactCore${{ matrix.flavor }}.xcframework.tar.gz
|
||||
path: /tmp/ReactCore
|
||||
- name: Print ReactCore folder
|
||||
shell: bash
|
||||
run: ls -lR /tmp/ReactCore
|
||||
- name: Prepare artifacts
|
||||
run: |
|
||||
REACT_NATIVE_PKG=$(find /tmp/react-native-tmp -type f -name "*.tgz")
|
||||
@@ -275,7 +286,6 @@ jobs:
|
||||
NEW_ARCH_ENABLED=1
|
||||
|
||||
export RCT_USE_LOCAL_RN_DEP=/tmp/third-party/ReactNativeDependencies${{ matrix.flavor }}.xcframework.tar.gz
|
||||
export RCT_TESTONLY_RNCORE_TARBALL_PATH="/tmp/ReactCore/ReactCore${{ matrix.flavor }}.xcframework.tar.gz"
|
||||
HERMES_ENGINE_TARBALL_PATH=$HERMES_PATH RCT_NEW_ARCH_ENABLED=$NEW_ARCH_ENABLED bundle exec pod install
|
||||
|
||||
xcodebuild \
|
||||
@@ -382,9 +392,9 @@ jobs:
|
||||
runs-on: windows-2025
|
||||
needs: prepare_hermes_workspace
|
||||
env:
|
||||
HERMES_WS_DIR: 'C:\tmp\hermes'
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: 'C:\tmp\hermes\hermes-runtime-darwin'
|
||||
HERMES_OSXBIN_ARTIFACTS_DIR: 'C:\tmp\hermes\osx-bin'
|
||||
HERMES_WS_DIR: 'D:\tmp\hermes'
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: 'D:\tmp\hermes\hermes-runtime-darwin'
|
||||
HERMES_OSXBIN_ARTIFACTS_DIR: 'D:\tmp\hermes\osx-bin'
|
||||
ICU_URL: "https://github.com/unicode-org/icu/releases/download/release-64-2/icu4c-64_2-Win64-MSVC2017.zip"
|
||||
MSBUILD_DIR: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin'
|
||||
CMAKE_DIR: 'C:\Program Files\CMake\bin'
|
||||
@@ -538,7 +548,7 @@ jobs:
|
||||
|
||||
test_ios_helloworld_with_ruby_3_2_0:
|
||||
runs-on: macos-14
|
||||
needs: [prepare_hermes_workspace, build_hermes_macos, prebuild_apple_dependencies, prebuild_react_native_core] # prepare_hermes_workspace must be there because we need its reference to retrieve a couple of outputs
|
||||
needs: [prepare_hermes_workspace, build_hermes_macos, prebuild_apple_dependencies] # prepare_hermes_workspace must be there because we need its reference to retrieve a couple of outputs
|
||||
env:
|
||||
PROJECT_NAME: iOSTemplateProject
|
||||
HERMES_WS_DIR: /tmp/hermes
|
||||
@@ -555,7 +565,7 @@ jobs:
|
||||
|
||||
test_ios_helloworld:
|
||||
runs-on: macos-14
|
||||
needs: [prepare_hermes_workspace, build_hermes_macos, prebuild_apple_dependencies, prebuild_react_native_core] # prepare_hermes_workspace must be there because we need its reference to retrieve a couple of outputs
|
||||
needs: [prepare_hermes_workspace, build_hermes_macos, prebuild_apple_dependencies] # prepare_hermes_workspace must be there because we need its reference to retrieve a couple of outputs
|
||||
strategy:
|
||||
matrix:
|
||||
flavor: [Debug, Release]
|
||||
@@ -583,7 +593,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node-version: ["24", "22", "20"]
|
||||
node-version: ["24", "22"]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
@@ -175,6 +175,3 @@ fix_*.patch
|
||||
|
||||
# [Experimental] Generated TS type definitions
|
||||
/packages/**/types_generated/
|
||||
|
||||
/packages/debugger-shell/build/
|
||||
/packages/*/dist/
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
# Changelog (pre 0.80)
|
||||
|
||||
## v0.79.5
|
||||
|
||||
### Fixed
|
||||
|
||||
- **Flow:** Publish top-level Flow types for `react-native` ([fbbd20dd63](https://github.com/facebook/react-native/commit/fbbd20dd632acd72d2abe861dd4a0e6e98437cf2) by [@buschco](https://github.com/buschco))
|
||||
|
||||
## v0.79.4
|
||||
|
||||
### Fixed
|
||||
@@ -319,31 +313,6 @@ ChuiHW))
|
||||
- **JSC:** Clean up RCTBridgeDelegate to remove shouldBridgeUseCustomJSC method ([c8f1506f13](https://github.com/facebook/react-native/commit/c8f1506f13310ffafe370273805684e696d72d50) by [@zhongwuzw](https://github.com/zhongwuzw))
|
||||
- **Layout:** Remove no longer needed UISceneDelegate ([a033cf9d5e](https://github.com/facebook/react-native/commit/a033cf9d5e8ffbda8b6f86cf3ce152b4ccb73187) by [@okwasniewski](https://github.com/okwasniewski))
|
||||
|
||||
## v0.78.3
|
||||
|
||||
### Added
|
||||
|
||||
#### Android specific
|
||||
|
||||
- **Gradle:** RNGP - Add support for `exclusiveEnterpriseRepository` to specify an internal Maven mirror. ([6cb8dc37c7](https://github.com/facebook/react-native/commit/6cb8dc37c74995cba3f9f0a845919f305de53c3d) by [@cortinico](https://github.com/cortinico))
|
||||
|
||||
### Fixed
|
||||
|
||||
- **DevTools**: Temporarily disable eager evaluation and live expressions in the console tab ([07717b5275](https://github.com/facebook/react-native/commit/07717b5275d80cde7b2b4edbe032ab629127fbf0) by [@huntie](https://github.com/huntie))
|
||||
- **InteropLayer:** Fixed adding child views to a native view using the interop layer ([d53a60dd23](https://github.com/facebook/react-native/commit/d53a60dd23c5df8afca058a867c50df8b61f62e2) by [@chrfalch](https://github.com/chrfalch))
|
||||
- **Runtime:** Align timer IDs and timer function argument error handling with web standards. ([480a4642e5](https://github.com/facebook/react-native/commit/480a4642e5a644becf1c477d3d239f9b57efff3a) by [@kitten](https://github.com/kitten))
|
||||
|
||||
#### Android specific
|
||||
|
||||
- **StyleSheet:** Wrong `borderBottomEndRadius` on RTL ([68d6ada448](https://github.com/facebook/react-native/commit/68d6ada44893701b6006a6b1753131c7e880a30a) by [@riteshshukla04](https://github.com/riteshshukla04))
|
||||
|
||||
#### iOS specific
|
||||
|
||||
- **Codegen:** Skip codegen for selectively disabled libraries in react-native.config.js ([be8595b18a](https://github.com/facebook/react-native/commit/be8595b18a46635bf679d8e7473f2960c33530fa) by [@ismarbesic](https://github.com/ismarbesic))
|
||||
- **Layout:** Layout direction changes are now honored on bundle reload ([36f29beac4](https://github.com/facebook/react-native/commit/36f29beac47259768612bf56e5d9acfa4b94ab1a) by [@chrsmys](https://github.com/chrsmys))
|
||||
- **Runtime:** Re-enable enableFixForViewCommandRace feature flag ([ae59702f8e](https://github.com/facebook/react-native/commit/ae59702f8ee89e7bddec971e0a041744cb91e65c) by [@okwasniewski](https://github.com/okwasniewski))
|
||||
- **Switch:** Fixed switches correctly reverting to controlled state ([aa8c072870](https://github.com/facebook/react-native/commit/aa8c072870f6f9740e567a0f455c0e500ff1400c) by [@javache](https://github.com/javache))
|
||||
|
||||
## v0.78.2
|
||||
|
||||
### Changed
|
||||
-1114
File diff suppressed because it is too large
Load Diff
@@ -13,7 +13,6 @@ plugins {
|
||||
alias(libs.plugins.kotlin.android) apply false
|
||||
alias(libs.plugins.binary.compatibility.validator) apply true
|
||||
alias(libs.plugins.android.test) apply false
|
||||
alias(libs.plugins.ktfmt) apply true
|
||||
}
|
||||
|
||||
val reactAndroidProperties = java.util.Properties()
|
||||
@@ -131,30 +130,3 @@ if (project.findProperty("react.internal.useHermesNightly")?.toString()?.toBoole
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ktfmt {
|
||||
blockIndent.set(2)
|
||||
continuationIndent.set(4)
|
||||
maxWidth.set(100)
|
||||
removeUnusedImports.set(false)
|
||||
manageTrailingCommas.set(false)
|
||||
}
|
||||
|
||||
// Configure ktfmt tasks to include gradle-plugin
|
||||
listOf("ktfmtCheck", "ktfmtFormat").forEach { taskName ->
|
||||
tasks.named(taskName) { dependsOn(gradle.includedBuild("gradle-plugin").task(":$taskName")) }
|
||||
}
|
||||
|
||||
allprojects {
|
||||
// Apply exclusions for specific files that should not be formatted
|
||||
val excludePatterns =
|
||||
listOf(
|
||||
"**/build/**",
|
||||
"**/hermes-engine/**",
|
||||
"**/internal/featureflags/**",
|
||||
"**/systeminfo/ReactNativeVersion.kt")
|
||||
listOf(
|
||||
com.ncorti.ktfmt.gradle.tasks.KtfmtCheckTask::class,
|
||||
com.ncorti.ktfmt.gradle.tasks.KtfmtFormatTask::class)
|
||||
.forEach { tasks.withType(it) { exclude(excludePatterns) } }
|
||||
}
|
||||
|
||||
-149
@@ -1,149 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow strict-local
|
||||
* @format
|
||||
*/
|
||||
|
||||
declare module '@electron/packager' {
|
||||
declare export type AsarOptions = $FlowFixMe;
|
||||
|
||||
declare export type ElectronDownloadRequestOptions = $FlowFixMe;
|
||||
|
||||
declare export type TargetDefinition = {
|
||||
arch: TargetArch,
|
||||
platform: TargetPlatform,
|
||||
};
|
||||
|
||||
declare export type FinalizePackageTargetsHookFunction = (
|
||||
targets: TargetDefinition[],
|
||||
callback: HookFunctionErrorCallback,
|
||||
) => void;
|
||||
|
||||
declare export type HookFunction = (
|
||||
buildPath: string,
|
||||
electronVersion: string,
|
||||
platform: TargetPlatform,
|
||||
arch: TargetArch,
|
||||
callback: HookFunctionErrorCallback,
|
||||
) => void;
|
||||
|
||||
declare export type IgnoreFunction = (path: string) => boolean;
|
||||
|
||||
declare export type HookFunctionErrorCallback = (err?: Error | null) => void;
|
||||
|
||||
declare export interface MacOSProtocol {
|
||||
name: string;
|
||||
schemes: string[];
|
||||
}
|
||||
|
||||
declare export type NotaryToolCredentials = $FlowFixMe;
|
||||
|
||||
declare export type OsxSignOptions = $FlowFixMe;
|
||||
|
||||
declare export type OsxUniversalOptions = $FlowFixMe;
|
||||
|
||||
declare export type Win32MetadataOptions = $ReadOnly<{
|
||||
CompanyName?: string,
|
||||
FileDescription?: string,
|
||||
OriginalFilename?: string,
|
||||
ProductName?: string,
|
||||
InternalName?: string,
|
||||
'requested-execution-level'?:
|
||||
| 'asInvoker'
|
||||
| 'highestAvailable'
|
||||
| 'requireAdministrator',
|
||||
'application-manifest'?: string,
|
||||
}>;
|
||||
|
||||
declare export type WindowsSignOptions = $FlowFixMe;
|
||||
|
||||
declare export type OfficialArch =
|
||||
| 'ia32'
|
||||
| 'x64'
|
||||
| 'armv7l'
|
||||
| 'arm64'
|
||||
| 'mips64el'
|
||||
| 'universal';
|
||||
|
||||
declare export type OfficialPlatform = 'linux' | 'win32' | 'darwin' | 'mas';
|
||||
|
||||
declare export type TargetArch = OfficialArch | string;
|
||||
|
||||
declare export type TargetPlatform = OfficialPlatform | string;
|
||||
|
||||
declare export type ArchOption = TargetArch | 'all';
|
||||
|
||||
declare export type PlatformOption = TargetPlatform | 'all';
|
||||
|
||||
declare export interface Options {
|
||||
dir: string;
|
||||
afterAsar?: HookFunction[];
|
||||
afterComplete?: HookFunction[];
|
||||
afterCopy?: HookFunction[];
|
||||
afterCopyExtraResources?: HookFunction[];
|
||||
afterExtract?: HookFunction[];
|
||||
afterFinalizePackageTargets?: FinalizePackageTargetsHookFunction[];
|
||||
afterInitialize?: HookFunction[];
|
||||
afterPrune?: HookFunction[];
|
||||
all?: boolean;
|
||||
appBundleId?: string;
|
||||
appCategoryType?: string;
|
||||
appCopyright?: string;
|
||||
appVersion?: string;
|
||||
arch?: ArchOption | ArchOption[];
|
||||
asar?: boolean | AsarOptions;
|
||||
beforeAsar?: HookFunction[];
|
||||
beforeCopy?: HookFunction[];
|
||||
beforeCopyExtraResources?: HookFunction[];
|
||||
buildVersion?: string;
|
||||
darwinDarkModeSupport?: boolean;
|
||||
derefSymlinks?: boolean;
|
||||
download?: ElectronDownloadRequestOptions;
|
||||
electronVersion?: string;
|
||||
electronZipDir?: string;
|
||||
executableName?: string;
|
||||
extendHelperInfo?:
|
||||
| string
|
||||
| {
|
||||
[property: string]: any,
|
||||
};
|
||||
extendInfo?:
|
||||
| string
|
||||
| {
|
||||
[property: string]: any,
|
||||
};
|
||||
extraResource?: string | string[];
|
||||
helperBundleId?: string;
|
||||
icon?: string;
|
||||
ignore?: RegExp | (string | RegExp)[] | IgnoreFunction;
|
||||
junk?: boolean;
|
||||
name?: string;
|
||||
osxNotarize?: NotaryToolCredentials;
|
||||
osxSign?: true | OsxSignOptions;
|
||||
osxUniversal?: OsxUniversalOptions;
|
||||
out?: string;
|
||||
overwrite?: boolean;
|
||||
platform?: TargetPlatform | 'all' | Array<TargetPlatform | 'all'>;
|
||||
prebuiltAsar?: string;
|
||||
protocols?: MacOSProtocol[];
|
||||
prune?: boolean;
|
||||
quiet?: boolean;
|
||||
tmpdir?: string | false;
|
||||
usageDescription?: {
|
||||
[property: string]: string,
|
||||
};
|
||||
win32metadata?: Win32MetadataOptions;
|
||||
windowsSign?: true | WindowsSignOptions;
|
||||
}
|
||||
|
||||
declare function packager(options: Options): Promise<string[]>;
|
||||
|
||||
declare module.exports: typeof packager & {
|
||||
packager: typeof packager,
|
||||
default: typeof packager,
|
||||
};
|
||||
}
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@@ -32,7 +32,7 @@ if (process.env.FBSOURCE_ENV === '1') {
|
||||
require('@fb-tools/babel-register');
|
||||
} else {
|
||||
// Register Babel to allow local packages to be loaded from source
|
||||
require('../scripts/shared/babelRegister').registerForMonorepo();
|
||||
require('../scripts/babel-register').registerForMonorepo();
|
||||
}
|
||||
|
||||
const transformer = require('@react-native/metro-babel-transformer');
|
||||
|
||||
+16
-22
@@ -8,19 +8,15 @@
|
||||
"android": "yarn --cwd packages/rn-tester android",
|
||||
"build-android": "./gradlew :packages:react-native:ReactAndroid:build",
|
||||
"build": "node ./scripts/build/build.js",
|
||||
"build-types": "node ./scripts/js-api/build-types",
|
||||
"build-types": "node ./scripts/build-types",
|
||||
"clang-format": "clang-format -i --glob=*/**/*.{h,cpp,m,mm}",
|
||||
"clean": "node ./scripts/build/clean.js",
|
||||
"cxx-api-build": "node ./scripts/cxx-api/public-api.js",
|
||||
"flow-check": "flow check",
|
||||
"flow": "flow",
|
||||
"format-check": "prettier --list-different \"./**/*.{js,md,yml,ts,tsx}\"",
|
||||
"format": "npm run prettier && npm run clang-format",
|
||||
"featureflags": "yarn --cwd packages/react-native featureflags",
|
||||
"js-api-diff": "node ./scripts/js-api/diff-api-snapshot",
|
||||
"lint-ci": "./.github/workflow-scripts/analyze_code.sh && yarn shellcheck",
|
||||
"lint-kotlin-check": "./gradlew ktfmtCheck",
|
||||
"lint-kotlin": "./gradlew ktfmtFormat",
|
||||
"lint-markdown": "markdownlint-cli2 2>&1",
|
||||
"lint": "eslint --max-warnings 0 .",
|
||||
"prettier": "prettier --write \"./**/*.{js,md,yml,ts,tsx}\"",
|
||||
@@ -30,13 +26,13 @@
|
||||
"set-version": "node ./scripts/releases/set-version.js",
|
||||
"test-android": "./gradlew :packages:react-native:ReactAndroid:test",
|
||||
"test-ci": "jest --maxWorkers=2 --ci --reporters=\"default\" --reporters=\"jest-junit\"",
|
||||
"test-release-local-clean": "node ./scripts/release-testing/test-release-local-clean.js",
|
||||
"test-release-local": "node ./scripts/release-testing/test-release-local.js",
|
||||
"test-e2e-local-clean": "node ./scripts/release-testing/test-e2e-local-clean.js",
|
||||
"test-e2e-local": "node ./scripts/release-testing/test-e2e-local.js",
|
||||
"test-ios": "./scripts/objc-test.sh test",
|
||||
"test-typescript": "tsc -p packages/react-native/types/tsconfig.json",
|
||||
"test-generated-typescript": "tsc -p packages/react-native/types_generated/tsconfig.test.json",
|
||||
"test": "jest",
|
||||
"fantom": "./scripts/fantom.sh",
|
||||
"fantom": "JS_DIR='..' yarn jest --config private/react-native-fantom/config/jest.config.js",
|
||||
"trigger-react-native-release": "node ./scripts/releases-local/trigger-react-native-release.js",
|
||||
"update-lock": "npx yarn-deduplicate"
|
||||
},
|
||||
@@ -53,17 +49,16 @@
|
||||
"@babel/plugin-transform-regenerator": "^7.24.7",
|
||||
"@babel/preset-env": "^7.25.3",
|
||||
"@babel/preset-flow": "^7.24.7",
|
||||
"@electron/packager": "^18.3.6",
|
||||
"@jest/create-cache-key-function": "^29.7.0",
|
||||
"@microsoft/api-extractor": "^7.52.2",
|
||||
"@react-native/metro-babel-transformer": "0.81.0-main",
|
||||
"@react-native/metro-config": "0.81.0-main",
|
||||
"@react-native/metro-babel-transformer": "0.80.0-main",
|
||||
"@react-native/metro-config": "0.80.0-main",
|
||||
"@tsconfig/node22": "22.0.2",
|
||||
"@types/react": "^19.1.0",
|
||||
"@typescript-eslint/parser": "^8.36.0",
|
||||
"@typescript-eslint/parser": "^7.1.1",
|
||||
"ansi-styles": "^4.2.1",
|
||||
"babel-plugin-minify-dead-code-elimination": "^0.5.2",
|
||||
"babel-plugin-syntax-hermes-parser": "0.29.1",
|
||||
"babel-plugin-syntax-hermes-parser": "0.29.0",
|
||||
"babel-plugin-transform-define": "^2.1.4",
|
||||
"babel-plugin-transform-flow-enums": "^0.0.2",
|
||||
"clang-format": "^1.8.0",
|
||||
@@ -81,12 +76,11 @@
|
||||
"eslint-plugin-react-native": "^4.0.0",
|
||||
"eslint-plugin-redundant-undefined": "^0.4.0",
|
||||
"eslint-plugin-relay": "^1.8.3",
|
||||
"flow-api-translator": "0.29.1",
|
||||
"flow-bin": "^0.275.0",
|
||||
"flow-api-translator": "0.29.0",
|
||||
"flow-bin": "^0.274.0",
|
||||
"glob": "^7.1.1",
|
||||
"hermes-eslint": "0.29.1",
|
||||
"hermes-transform": "0.29.1",
|
||||
"ini": "^5.0.0",
|
||||
"hermes-eslint": "0.29.0",
|
||||
"hermes-transform": "0.29.0",
|
||||
"inquirer": "^7.1.0",
|
||||
"jest": "^29.7.0",
|
||||
"jest-config": "^29.7.0",
|
||||
@@ -95,14 +89,14 @@
|
||||
"jest-snapshot": "^29.7.0",
|
||||
"markdownlint-cli2": "^0.17.2",
|
||||
"markdownlint-rule-relative-links": "^3.0.0",
|
||||
"memfs": "^4.7.7",
|
||||
"metro-babel-register": "^0.83.0",
|
||||
"metro-transform-plugins": "^0.83.0",
|
||||
"metro-babel-register": "^0.82.4",
|
||||
"metro-memory-fs": "^0.82.4",
|
||||
"metro-transform-plugins": "^0.82.4",
|
||||
"micromatch": "^4.0.4",
|
||||
"node-fetch": "^2.2.0",
|
||||
"nullthrows": "^1.1.1",
|
||||
"prettier": "2.8.8",
|
||||
"prettier-plugin-hermes-parser": "0.29.1",
|
||||
"prettier-plugin-hermes-parser": "0.29.0",
|
||||
"react": "19.1.0",
|
||||
"react-test-renderer": "19.1.0",
|
||||
"rimraf": "^3.0.2",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/assets-registry",
|
||||
"version": "0.81.0-main",
|
||||
"version": "0.80.0-main",
|
||||
"description": "Asset support code for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -17,7 +17,7 @@
|
||||
],
|
||||
"bugs": "https://github.com/facebook/react-native/issues",
|
||||
"engines": {
|
||||
"node": ">= 20.19.4"
|
||||
"node": ">= 22.14.0"
|
||||
},
|
||||
"files": [
|
||||
"path-support.js",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/babel-plugin-codegen",
|
||||
"version": "0.81.0-main",
|
||||
"version": "0.80.0-main",
|
||||
"description": "Babel plugin to generate native module and view manager code for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -19,14 +19,14 @@
|
||||
],
|
||||
"bugs": "https://github.com/facebook/react-native/issues",
|
||||
"engines": {
|
||||
"node": ">= 20.19.4"
|
||||
"node": ">= 22.14.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/traverse": "^7.25.3",
|
||||
"@react-native/codegen": "0.81.0-main"
|
||||
"@react-native/codegen": "0.80.0-main"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.25.2"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/community-cli-plugin",
|
||||
"version": "0.81.0-main",
|
||||
"version": "0.80.0-main",
|
||||
"description": "Core CLI commands for React Native",
|
||||
"keywords": [
|
||||
"react-native",
|
||||
@@ -22,16 +22,16 @@
|
||||
"dist"
|
||||
],
|
||||
"dependencies": {
|
||||
"@react-native/dev-middleware": "0.81.0-main",
|
||||
"@react-native/dev-middleware": "0.80.0-main",
|
||||
"debug": "^4.4.0",
|
||||
"invariant": "^2.2.4",
|
||||
"metro": "^0.83.0",
|
||||
"metro-config": "^0.83.0",
|
||||
"metro-core": "^0.83.0",
|
||||
"metro": "^0.82.4",
|
||||
"metro-config": "^0.82.4",
|
||||
"metro-core": "^0.82.4",
|
||||
"semver": "^7.1.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"metro-resolver": "^0.83.0"
|
||||
"metro-resolver": "^0.82.4"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@react-native-community/cli": "*",
|
||||
@@ -43,6 +43,6 @@
|
||||
}
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 20.19.4"
|
||||
"node": ">= 22.14.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ async function runServer(
|
||||
// $FlowIgnore[cannot-write] Assigning to readonly property
|
||||
metroConfig.reporter = reporter;
|
||||
|
||||
await Metro.runServer(metroConfig, {
|
||||
const serverInstance = await Metro.runServer(metroConfig, {
|
||||
host: args.host,
|
||||
secure: args.https,
|
||||
secureCert: args.cert,
|
||||
@@ -161,6 +161,18 @@ async function runServer(
|
||||
|
||||
reportEvent = eventsSocketEndpoint.reportEvent;
|
||||
|
||||
// In Node 8, the default keep-alive for an HTTP connection is 5 seconds. In
|
||||
// early versions of Node 8, this was implemented in a buggy way which caused
|
||||
// some HTTP responses (like those containing large JS bundles) to be
|
||||
// terminated early.
|
||||
//
|
||||
// As a workaround, arbitrarily increase the keep-alive from 5 to 30 seconds,
|
||||
// which should be enough to send even the largest of JS bundles.
|
||||
//
|
||||
// For more info: https://github.com/nodejs/node/issues/13391
|
||||
//
|
||||
serverInstance.keepAliveTimeout = 30000;
|
||||
|
||||
await version.logIfUpdateAvailable(cliConfig, terminalReporter);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ export type * from './index.flow';
|
||||
*/
|
||||
|
||||
if (!process.env.BUILD_EXCLUDE_BABEL_REGISTER) {
|
||||
require('../../../scripts/shared/babelRegister').registerForMonorepo();
|
||||
require('../../../scripts/babel-register').registerForMonorepo();
|
||||
}
|
||||
|
||||
module.exports = require('./index.flow');
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/core-cli-utils",
|
||||
"version": "0.81.0-main",
|
||||
"version": "0.80.0-main",
|
||||
"description": "React Native CLI library for Frameworks to build on",
|
||||
"license": "MIT",
|
||||
"main": "./src/index.flow.js",
|
||||
@@ -21,7 +21,7 @@
|
||||
],
|
||||
"bugs": "https://github.com/facebook/react-native/issues",
|
||||
"engines": {
|
||||
"node": ">= 20.19.4"
|
||||
"node": ">= 22.14.0"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
|
||||
@@ -13,7 +13,7 @@ export type * from './index.flow';
|
||||
*/
|
||||
|
||||
if (process.env.BUILD_EXCLUDE_BABEL_REGISTER == null) {
|
||||
require('../../../scripts/shared/babelRegister').registerForMonorepo();
|
||||
require('../../../scripts/babel-register').registerForMonorepo();
|
||||
}
|
||||
|
||||
module.exports = require('./index.flow');
|
||||
|
||||
@@ -76,8 +76,9 @@ function getNodePackagePath(packageName: string): string {
|
||||
}
|
||||
|
||||
function metro(...args: $ReadOnlyArray<string>): ExecaPromise {
|
||||
log(`🚇 metro ${args.join(' ')} `);
|
||||
return execa('npx', ['--offline', 'metro', ...args]);
|
||||
const metroPath = getNodePackagePath(path.join('metro', 'src', 'cli.js'));
|
||||
log(`🚇 ${metroPath} ${args.join(' ')} `);
|
||||
return execa('node', [metroPath, ...args]);
|
||||
}
|
||||
|
||||
export const tasks = {
|
||||
|
||||
@@ -125,7 +125,7 @@ export const tasks = {
|
||||
}),
|
||||
),
|
||||
installDependencies: task(FIFTH, 'Install CocoaPods dependencies', () => {
|
||||
const env: {[string]: string | void} = {
|
||||
const env = {
|
||||
RCT_NEW_ARCH_ENABLED: options.newArchitecture ? '1' : '0',
|
||||
USE_FRAMEWORKS: options.frameworks,
|
||||
USE_HERMES: options.hermes ? '1' : '0',
|
||||
|
||||
@@ -13,7 +13,7 @@ export type * from './version.flow';
|
||||
*/
|
||||
|
||||
if (process.env.BUILD_EXCLUDE_BABEL_REGISTER == null) {
|
||||
require('../../../../scripts/shared/babelRegister').registerForMonorepo();
|
||||
require('../../../../scripts/babel-register').registerForMonorepo();
|
||||
}
|
||||
|
||||
module.exports = require('./version.flow');
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
@generated SignedSource<<e2d97b04634bf3b566f33d455f38658f>>
|
||||
Git revision: 8dc0d5b365e6b4600b78e5a7381aa861d8c1c81e
|
||||
@generated SignedSource<<cf5be4596d1f07e220b710fc286d02fa>>
|
||||
Git revision: d95ac13bf0ab64a5e6c2eb18eb138587063b9c34
|
||||
Built with --nohooks: false
|
||||
Is local checkout: false
|
||||
Remote URL: https://github.com/facebook/react-native-devtools-frontend
|
||||
|
||||
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+2
-2
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+4
-5
File diff suppressed because one or more lines are too long
Vendored
+6
-6
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/debugger-frontend",
|
||||
"version": "0.81.0-main",
|
||||
"version": "0.80.0-main",
|
||||
"description": "Debugger frontend for React Native based on Chrome DevTools",
|
||||
"keywords": [
|
||||
"react-native",
|
||||
@@ -20,6 +20,6 @@
|
||||
"BUILD_INFO"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">= 20.19.4"
|
||||
"node": ">= 22.14.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/debugger-shell",
|
||||
"version": "0.81.0-main",
|
||||
"version": "0.80.0-main",
|
||||
"description": "Experimental debugger shell for React Native for use with @react-native/debugger-frontend",
|
||||
"keywords": [
|
||||
"react-native",
|
||||
@@ -8,7 +8,7 @@
|
||||
],
|
||||
"homepage": "https://github.com/facebook/react-native/tree/HEAD/packages/debugger-shell#readme",
|
||||
"bugs": "https://github.com/facebook/react-native/issues",
|
||||
"main": "./src/index.js",
|
||||
"main": "./src/node/index.js",
|
||||
"exports": {
|
||||
".": {
|
||||
"node": "./src/node/index.js",
|
||||
@@ -26,12 +26,12 @@
|
||||
},
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 20.19.4",
|
||||
"electron": ">=36.3.0"
|
||||
"node": ">= 22.14.0",
|
||||
"electron": ">=36.2.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"cross-spawn": "^7.0.6",
|
||||
"electron": "36.3.0"
|
||||
"electron": "36.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"semver": "^7.1.3"
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
|
||||
// $FlowFixMe[unclear-type] We have no Flow types for the Electron API.
|
||||
const {BrowserWindow, app, shell, ipcMain} = require('electron') as any;
|
||||
const path = require('path');
|
||||
const util = require('util');
|
||||
|
||||
const windowMetadata = new WeakMap<
|
||||
@@ -69,8 +68,6 @@ function handleLaunchArgs(argv: string[]) {
|
||||
partition: 'persist:react-native-devtools',
|
||||
preload: require.resolve('./preload.js'),
|
||||
},
|
||||
// Icon for Linux
|
||||
icon: path.join(__dirname, 'resources', 'icon.png'),
|
||||
});
|
||||
|
||||
// Open links in the default browser instead of in new Electron windows.
|
||||
@@ -93,7 +90,7 @@ function handleLaunchArgs(argv: string[]) {
|
||||
}
|
||||
|
||||
app.whenReady().then(() => {
|
||||
handleLaunchArgs(process.argv.slice(app.isPackaged ? 1 : 2));
|
||||
handleLaunchArgs(process.argv.slice(2));
|
||||
|
||||
app.on(
|
||||
'second-instance',
|
||||
|
||||
@@ -10,25 +10,9 @@
|
||||
|
||||
// $FlowFixMe[unclear-type] We have no Flow types for the Electron API.
|
||||
const {app} = require('electron') as any;
|
||||
const util = require('util');
|
||||
|
||||
// Handle global command line arguments which don't require a window
|
||||
// or the single instance lock to be held.
|
||||
const {
|
||||
values: {version = false},
|
||||
} = util.parseArgs({
|
||||
options: {version: {type: 'boolean'}},
|
||||
args: process.argv.slice(app.isPackaged ? 1 : 2),
|
||||
strict: false,
|
||||
});
|
||||
if (version) {
|
||||
console.log(`${app.getName()} v${app.getVersion()}`);
|
||||
// Not app.quit() - we want to exit immediately without initialising the graphical subsystem.
|
||||
app.exit(0);
|
||||
}
|
||||
|
||||
const gotTheLock = app.requestSingleInstanceLock({
|
||||
argv: process.argv.slice(app.isPackaged ? 1 : 2),
|
||||
argv: process.argv.slice(2),
|
||||
});
|
||||
|
||||
if (!gotTheLock) {
|
||||
|
||||
@@ -13,7 +13,7 @@ export type * from './index.flow';
|
||||
*/
|
||||
|
||||
if (!Boolean(process.env.BUILD_EXCLUDE_BABEL_REGISTER)) {
|
||||
require('../../../../scripts/shared/babelRegister').registerForMonorepo();
|
||||
require('../../../../scripts/babel-register').registerForMonorepo();
|
||||
}
|
||||
|
||||
module.exports = require('./index.flow');
|
||||
|
||||
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 134 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 118 KiB |
@@ -1,26 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow strict-local
|
||||
* @format
|
||||
*/
|
||||
|
||||
// As far as Flow is concerned, this package is Node-only.
|
||||
/*::
|
||||
export type * from './node';
|
||||
const Node = require('./node');
|
||||
declare module.exports: typeof Node;
|
||||
*/
|
||||
|
||||
// Because Electron doesn't support package.json `exports`, we need to
|
||||
// switch at runtime.
|
||||
if ('electron' in process.versions) {
|
||||
// $FlowIgnore[invalid-export]
|
||||
module.exports = require('./electron');
|
||||
} else {
|
||||
// $FlowIgnore[invalid-export]
|
||||
module.exports = require('./node');
|
||||
}
|
||||
@@ -13,7 +13,7 @@ export type * from './index.flow';
|
||||
*/
|
||||
|
||||
if (!process.env.BUILD_EXCLUDE_BABEL_REGISTER) {
|
||||
require('../../../../scripts/shared/babelRegister').registerForMonorepo();
|
||||
require('../../../../scripts/babel-register').registerForMonorepo();
|
||||
}
|
||||
|
||||
export * from './index.flow';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/dev-middleware",
|
||||
"version": "0.81.0-main",
|
||||
"version": "0.80.0-main",
|
||||
"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.81.0-main",
|
||||
"@react-native/debugger-frontend": "0.80.0-main",
|
||||
"chrome-launcher": "^0.15.2",
|
||||
"chromium-edge-launcher": "^0.2.0",
|
||||
"connect": "^3.6.5",
|
||||
@@ -35,7 +35,7 @@
|
||||
"ws": "^6.2.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 20.19.4"
|
||||
"node": ">= 22.14.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"selfsigned": "^2.4.1",
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
*/
|
||||
|
||||
import type {JsonPagesListResponse} from '../inspector-proxy/types';
|
||||
import type {BrowserLauncher} from '../types/BrowserLauncher';
|
||||
|
||||
import DefaultBrowserLauncher from '../utils/DefaultBrowserLauncher';
|
||||
import {fetchJson, requestLocal} from './FetchUtils';
|
||||
@@ -23,7 +22,7 @@ const PAGES_POLLING_DELAY = 2100;
|
||||
jest.useFakeTimers();
|
||||
|
||||
describe('enableStandaloneFuseboxShell experiment', () => {
|
||||
const BrowserLauncherWithFuseboxShell: BrowserLauncher = {
|
||||
const BrowserLauncherWithFuseboxShell = {
|
||||
...DefaultBrowserLauncher,
|
||||
unstable_showFuseboxShell: () => {
|
||||
throw new Error('Not implemented');
|
||||
|
||||
@@ -13,7 +13,7 @@ export type * from './index.flow';
|
||||
*/
|
||||
|
||||
if (!process.env.BUILD_EXCLUDE_BABEL_REGISTER) {
|
||||
require('../../../scripts/shared/babelRegister').registerForMonorepo();
|
||||
require('../../../scripts/babel-register').registerForMonorepo();
|
||||
}
|
||||
|
||||
export * from './index.flow';
|
||||
|
||||
@@ -22,7 +22,6 @@ import type {
|
||||
import type {IncomingMessage, ServerResponse} from 'http';
|
||||
|
||||
import getBaseUrlFromRequest from '../utils/getBaseUrlFromRequest';
|
||||
import getDevToolsFrontendUrl from '../utils/getDevToolsFrontendUrl';
|
||||
import Device from './Device';
|
||||
import EventLoopPerfTracker from './EventLoopPerfTracker';
|
||||
import InspectorProxyHeartbeat from './InspectorProxyHeartbeat';
|
||||
@@ -250,15 +249,13 @@ export default class InspectorProxy implements InspectorProxyQueries {
|
||||
|
||||
const webSocketUrlWithoutProtocol = `${host}${WS_DEBUGGER_URL}?device=${deviceId}&page=${page.id}`;
|
||||
const webSocketDebuggerUrl = `${webSocketScheme}://${webSocketUrlWithoutProtocol}`;
|
||||
const devtoolsFrontendUrl = getDevToolsFrontendUrl(
|
||||
this.#experiments,
|
||||
webSocketDebuggerUrl,
|
||||
this.#serverBaseUrl.origin,
|
||||
{
|
||||
relative: true,
|
||||
useFuseboxEntryPoint: page.capabilities.prefersFuseboxFrontend,
|
||||
},
|
||||
);
|
||||
|
||||
// For now, `/json/list` returns the legacy built-in `devtools://` URL, to
|
||||
// preserve existing handling by Flipper. This may return a placeholder in
|
||||
// future -- please use the `/open-debugger` endpoint.
|
||||
const devtoolsFrontendUrl =
|
||||
`devtools://devtools/bundled/js_app.html?experiments=true&v8only=true&${webSocketScheme}=` +
|
||||
encodeURIComponent(webSocketUrlWithoutProtocol);
|
||||
|
||||
return {
|
||||
id: `${deviceId}-${page.id}`,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/eslint-config",
|
||||
"version": "0.81.0-main",
|
||||
"version": "0.80.0-main",
|
||||
"description": "ESLint config for React Native",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -16,15 +16,15 @@
|
||||
],
|
||||
"bugs": "https://github.com/facebook/react-native/issues",
|
||||
"engines": {
|
||||
"node": ">= 20.19.4"
|
||||
"node": ">= 22.14.0"
|
||||
},
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.25.2",
|
||||
"@babel/eslint-parser": "^7.25.1",
|
||||
"@react-native/eslint-plugin": "0.81.0-main",
|
||||
"@typescript-eslint/eslint-plugin": "^8.36.0",
|
||||
"@typescript-eslint/parser": "^8.36.0",
|
||||
"@react-native/eslint-plugin": "0.80.0-main",
|
||||
"@typescript-eslint/eslint-plugin": "^7.1.1",
|
||||
"@typescript-eslint/parser": "^7.1.1",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"eslint-plugin-eslint-comments": "^3.2.0",
|
||||
"eslint-plugin-ft-flow": "^2.0.1",
|
||||
|
||||
@@ -31,8 +31,6 @@ eslintTester.run('../no-deep-imports', rule, {
|
||||
"import Foo from 'react/native/Foo';",
|
||||
"import 'react-native/Libraries/Core/InitializeCore';",
|
||||
"require('react-native/Libraries/Core/InitializeCore');",
|
||||
"import Foo from 'react-native/src/fb_internal/Foo'",
|
||||
"require('react-native/src/fb_internal/Foo')",
|
||||
],
|
||||
invalid: [
|
||||
{
|
||||
@@ -105,25 +103,5 @@ eslintTester.run('../no-deep-imports', rule, {
|
||||
],
|
||||
output: null,
|
||||
},
|
||||
{
|
||||
code: "import type {RootTag} from 'react-native/Libraries/Types/RootTagTypes';",
|
||||
errors: [
|
||||
{
|
||||
messageId: 'deepImport',
|
||||
data: {importPath: 'react-native/Libraries/Types/RootTagTypes'},
|
||||
},
|
||||
],
|
||||
output: "import type {RootTag} from 'react-native';",
|
||||
},
|
||||
{
|
||||
code: "import type {ModalBaseProps, Foo} from 'react-native/Libraries/Modal/Modal';",
|
||||
errors: [
|
||||
{
|
||||
messageId: 'deepImport',
|
||||
data: {importPath: 'react-native/Libraries/Modal/Modal'},
|
||||
},
|
||||
],
|
||||
output: null,
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
@@ -31,8 +31,7 @@ module.exports = {
|
||||
ImportDeclaration(node) {
|
||||
if (
|
||||
!isDeepReactNativeImport(node.source) ||
|
||||
isInitializeCoreImport(node.source) ||
|
||||
isFbInternalImport(node.source)
|
||||
isInitializeCoreImport(node.source)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
@@ -41,55 +40,25 @@ module.exports = {
|
||||
'react-native/'.length,
|
||||
);
|
||||
const publicAPIDefaultComponent = publicAPIMapping[reactNativeSource];
|
||||
if (publicAPIDefaultComponent && publicAPIDefaultComponent.default) {
|
||||
if (publicAPIDefaultComponent) {
|
||||
context.report({
|
||||
...getStandardReport(node.source),
|
||||
fix(fixer) {
|
||||
return fixer.replaceText(
|
||||
node,
|
||||
`import {${publicAPIDefaultComponent.default}} from 'react-native';`,
|
||||
`import {${publicAPIDefaultComponent}} from 'react-native';`,
|
||||
);
|
||||
},
|
||||
});
|
||||
} else {
|
||||
context.report(getStandardReport(node.source));
|
||||
}
|
||||
} else if (isTypeImport(node)) {
|
||||
const reactNativeSource = node.source.value.slice(
|
||||
'react-native/'.length,
|
||||
);
|
||||
const publicAPIDefaultComponent = publicAPIMapping[reactNativeSource];
|
||||
if (publicAPIDefaultComponent && publicAPIDefaultComponent.types) {
|
||||
const typeNames = [];
|
||||
for (const specifier of node.specifiers) {
|
||||
const importedName = specifier.imported.name;
|
||||
if (!publicAPIDefaultComponent.types.includes(importedName)) {
|
||||
context.report(getStandardReport(node.source));
|
||||
return;
|
||||
}
|
||||
typeNames.push(importedName);
|
||||
}
|
||||
|
||||
context.report({
|
||||
...getStandardReport(node.source),
|
||||
fix(fixer) {
|
||||
return fixer.replaceText(
|
||||
node,
|
||||
`import type {${typeNames.join(', ')}} from 'react-native';`,
|
||||
);
|
||||
},
|
||||
});
|
||||
}
|
||||
} else {
|
||||
context.report(getStandardReport(node.source));
|
||||
}
|
||||
},
|
||||
CallExpression(node) {
|
||||
if (
|
||||
!isDeepRequire(node) ||
|
||||
isInitializeCoreImport(node.arguments[0]) ||
|
||||
isFbInternalImport(node.arguments[0])
|
||||
) {
|
||||
if (!isDeepRequire(node) || isInitializeCoreImport(node.arguments[0])) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -102,13 +71,13 @@ module.exports = {
|
||||
) {
|
||||
const reactNativeSource = importPath.slice('react-native/'.length);
|
||||
const publicAPIDefaultComponent = publicAPIMapping[reactNativeSource];
|
||||
if (publicAPIDefaultComponent && publicAPIDefaultComponent.default) {
|
||||
if (publicAPIDefaultComponent) {
|
||||
context.report({
|
||||
...getStandardReport(node.arguments[0]),
|
||||
fix(fixer) {
|
||||
return fixer.replaceText(
|
||||
parent,
|
||||
`{${publicAPIDefaultComponent.default}} = require('react-native')`,
|
||||
`{${publicAPIDefaultComponent}} = require('react-native')`,
|
||||
);
|
||||
},
|
||||
});
|
||||
@@ -140,10 +109,6 @@ module.exports = {
|
||||
);
|
||||
}
|
||||
|
||||
function isTypeImport(node) {
|
||||
return node.type === 'ImportDeclaration' && node.importKind === 'type';
|
||||
}
|
||||
|
||||
function isDeepRequire(node) {
|
||||
return (
|
||||
node.callee.type === 'Identifier' &&
|
||||
@@ -172,13 +137,5 @@ module.exports = {
|
||||
|
||||
return source.value === 'react-native/Libraries/Core/InitializeCore';
|
||||
}
|
||||
|
||||
function isFbInternalImport(source) {
|
||||
if (source.type !== 'Literal' || typeof source.value !== 'string') {
|
||||
return false;
|
||||
}
|
||||
|
||||
return source.value.startsWith('react-native/src/fb_internal/');
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/eslint-plugin",
|
||||
"version": "0.81.0-main",
|
||||
"version": "0.80.0-main",
|
||||
"description": "ESLint rules for @react-native/eslint-config",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -18,10 +18,10 @@
|
||||
"bugs": "https://github.com/facebook/react-native/issues",
|
||||
"main": "index.js",
|
||||
"devDependencies": {
|
||||
"babel-plugin-syntax-hermes-parser": "0.29.1",
|
||||
"hermes-eslint": "0.29.1"
|
||||
"babel-plugin-syntax-hermes-parser": "0.29.0",
|
||||
"hermes-eslint": "0.29.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 20.19.4"
|
||||
"node": ">= 22.14.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,513 +17,92 @@
|
||||
* If the path is not matched, the auto-fix won't be suggested.
|
||||
*/
|
||||
const publicAPIMapping = {
|
||||
'Libraries/Components/AccessibilityInfo/AccessibilityInfo': {
|
||||
default: 'AccessibilityInfo',
|
||||
types: null,
|
||||
},
|
||||
'Libraries/Components/ActivityIndicator/ActivityIndicator': {
|
||||
default: 'ActivityIndicator',
|
||||
types: ['ActivityIndicatorProps'],
|
||||
},
|
||||
'Libraries/Components/Button': {
|
||||
default: 'Button',
|
||||
types: ['ButtonProps'],
|
||||
},
|
||||
'Libraries/Components/DrawerAndroid/DrawerLayoutAndroid': {
|
||||
default: 'DrawerLayoutAndroid',
|
||||
types: ['DrawerLayoutAndroidProps', 'DrawerSlideEvent'],
|
||||
},
|
||||
'Libraries/Components/LayoutConformance/LayoutConformance': {
|
||||
default: 'experimental_LayoutConformance',
|
||||
types: ['LayoutConformanceProps'],
|
||||
},
|
||||
'Libraries/Lists/FlatList': {
|
||||
default: 'FlatList',
|
||||
types: ['FlatListProps'],
|
||||
},
|
||||
'Libraries/Image/Image': {
|
||||
default: 'Image',
|
||||
types: [
|
||||
'ImageBackgroundProps',
|
||||
'ImageErrorEvent',
|
||||
'ImageLoadEvent',
|
||||
'ImageProgressEventIOS',
|
||||
'ImageProps',
|
||||
'ImagePropsAndroid',
|
||||
'ImagePropsBase',
|
||||
'ImagePropsIOS',
|
||||
'ImageResolvedAssetSource',
|
||||
'ImageSize',
|
||||
'ImageSourcePropType',
|
||||
],
|
||||
},
|
||||
'Libraries/Image/ImageSource': {
|
||||
default: null,
|
||||
types: ['ImageRequireSource', 'ImageSource', 'ImageURISource'],
|
||||
},
|
||||
'Libraries/Image/ImageBackground': {
|
||||
default: 'ImageBackground',
|
||||
types: null,
|
||||
},
|
||||
'Libraries/Components/TextInput/InputAccessoryView': {
|
||||
default: 'InputAccessoryView',
|
||||
types: ['InputAccessoryViewProps'],
|
||||
},
|
||||
'Libraries/Components/Keyboard/KeyboardAvoidingView': {
|
||||
default: 'KeyboardAvoidingView',
|
||||
types: ['KeyboardAvoidingViewProps'],
|
||||
},
|
||||
'Libraries/Modal/Modal': {
|
||||
default: 'Modal',
|
||||
types: [
|
||||
'ModalBaseProps',
|
||||
'ModalProps',
|
||||
'ModalPropsAndroid',
|
||||
'ModalPropsIOS',
|
||||
],
|
||||
},
|
||||
'Libraries/Components/Pressable/Pressable': {
|
||||
default: 'Pressable',
|
||||
types: [
|
||||
'PressableAndroidRippleConfig',
|
||||
'PressableProps',
|
||||
'PressableStateCallbackType',
|
||||
],
|
||||
},
|
||||
'Libraries/Components/ProgressBarAndroid/ProgressBarAndroid': {
|
||||
default: 'ProgressBarAndroid',
|
||||
types: ['ProgressBarAndroidProps'],
|
||||
},
|
||||
'Libraries/Components/RefreshControl/RefreshControl': {
|
||||
default: 'RefreshControl',
|
||||
types: [
|
||||
'RefreshControlProps',
|
||||
'RefreshControlPropsAndroid',
|
||||
'RefreshControlPropsIOS',
|
||||
],
|
||||
},
|
||||
'Libraries/Components/SafeAreaView/SafeAreaView': {
|
||||
default: 'SafeAreaView',
|
||||
types: null,
|
||||
},
|
||||
'Libraries/Components/ScrollView/ScrollView': {
|
||||
default: 'ScrollView',
|
||||
types: [
|
||||
'ScrollResponderType',
|
||||
'ScrollViewProps',
|
||||
'ScrollViewPropsAndroid',
|
||||
'ScrollViewPropsIOS',
|
||||
'ScrollViewImperativeMethods',
|
||||
'ScrollViewScrollToOptions',
|
||||
],
|
||||
},
|
||||
'Libraries/Lists/SectionList': {
|
||||
default: 'SectionList',
|
||||
types: [
|
||||
'SectionListProps',
|
||||
'SectionListRenderItem',
|
||||
'SectionListRenderItemInfo',
|
||||
'SectionListData',
|
||||
],
|
||||
},
|
||||
'Libraries/Components/StatusBar/StatusBar': {
|
||||
default: 'StatusBar',
|
||||
types: ['StatusBarAnimation', 'StatusBarProps', 'StatusBarStyle'],
|
||||
},
|
||||
'Libraries/Components/Switch/Switch': {
|
||||
default: 'Switch',
|
||||
types: ['SwitchChangeEvent', 'SwitchProps'],
|
||||
},
|
||||
'Libraries/Text/Text': {
|
||||
default: 'Text',
|
||||
types: ['TextProps'],
|
||||
},
|
||||
'Libraries/Components/TextInput/TextInput': {
|
||||
default: 'TextInput',
|
||||
types: [
|
||||
'AutoCapitalize',
|
||||
'EnterKeyHintTypeOptions',
|
||||
'KeyboardTypeOptions',
|
||||
'InputModeOptions',
|
||||
'TextContentType',
|
||||
'TextInputAndroidProps',
|
||||
'TextInputIOSProps',
|
||||
'TextInputProps',
|
||||
'TextInputChangeEvent',
|
||||
'TextInputContentSizeChangeEvent',
|
||||
'TextInputEndEditingEvent',
|
||||
'TextInputFocusEvent',
|
||||
'TextInputKeyPressEvent',
|
||||
'TextInputSelectionChangeEvent',
|
||||
'TextInputSubmitEditingEvent',
|
||||
'ReturnKeyTypeOptions',
|
||||
'SubmitBehavior',
|
||||
],
|
||||
},
|
||||
'Libraries/Components/Touchable/Touchable': {
|
||||
default: 'Touchable',
|
||||
types: null,
|
||||
},
|
||||
'Libraries/Components/Touchable/TouchableHighlight': {
|
||||
default: 'TouchableHighlight',
|
||||
types: ['TouchableHighlightProps'],
|
||||
},
|
||||
'Libraries/Components/Touchable/TouchableNativeFeedback': {
|
||||
default: 'TouchableNativeFeedback',
|
||||
types: ['TouchableNativeFeedbackProps'],
|
||||
},
|
||||
'Libraries/Components/Touchable/TouchableOpacity': {
|
||||
default: 'TouchableOpacity',
|
||||
types: ['TouchableOpacityProps'],
|
||||
},
|
||||
'Libraries/Components/Touchable/TouchableWithoutFeedback': {
|
||||
default: 'TouchableWithoutFeedback',
|
||||
types: ['TouchableWithoutFeedbackProps'],
|
||||
},
|
||||
'Libraries/Components/View/View': {
|
||||
default: 'View',
|
||||
types: null,
|
||||
},
|
||||
'Libraries/Components/View/ViewAccessibility': {
|
||||
default: null,
|
||||
types: [
|
||||
'AccessibilityActionEvent',
|
||||
'AccessibilityProps',
|
||||
'AccessibilityRole',
|
||||
'AccessibilityState',
|
||||
'AccessibilityValue',
|
||||
'Role',
|
||||
],
|
||||
},
|
||||
'Libraries/Components/View/ViewPropTypes': {
|
||||
default: null,
|
||||
types: [
|
||||
'GestureResponderHandlers',
|
||||
'TVViewPropsIOS',
|
||||
'ViewProps',
|
||||
'ViewPropsAndroid',
|
||||
'ViewPropsIOS',
|
||||
],
|
||||
},
|
||||
'Libraries/Lists/VirtualizedList': {
|
||||
default: 'VirtualizedList',
|
||||
types: [
|
||||
'ListRenderItemInfo',
|
||||
'ListRenderItem',
|
||||
'Separators',
|
||||
'VirtualizedListProps',
|
||||
],
|
||||
},
|
||||
'Libraries/Lists/VirtualizedSectionList': {
|
||||
default: 'VirtualizedSectionList',
|
||||
types: [
|
||||
'ScrollToLocationParamsType',
|
||||
'SectionBase',
|
||||
'VirtualizedSectionListProps',
|
||||
],
|
||||
},
|
||||
'Libraries/ActionSheetIOS/ActionSheetIOS': {
|
||||
default: 'ActionSheetIOS',
|
||||
types: [
|
||||
'ActionSheetIOSOptions',
|
||||
'ShareActionSheetIOSOptions',
|
||||
'ShareActionSheetError',
|
||||
],
|
||||
},
|
||||
'Libraries/Alert/Alert': {
|
||||
default: 'Alert',
|
||||
types: ['AlertType', 'AlertButtonStyle', 'AlertButton', 'AlertOptions'],
|
||||
},
|
||||
'Libraries/Animated/Animated': {
|
||||
default: 'Animated',
|
||||
types: null,
|
||||
},
|
||||
'Libraries/Utilities/Appearance': {
|
||||
default: 'Appearance',
|
||||
types: null,
|
||||
},
|
||||
'Libraries/ReactNative/AppRegistry': {
|
||||
default: 'AppRegistry',
|
||||
types: [
|
||||
'TaskProvider',
|
||||
'ComponentProvider',
|
||||
'ComponentProviderInstrumentationHook',
|
||||
'AppConfig',
|
||||
'Runnable',
|
||||
'Runnables',
|
||||
'Registry',
|
||||
'WrapperComponentProvider',
|
||||
'RootViewStyleProvider',
|
||||
],
|
||||
},
|
||||
'Libraries/AppState/AppState': {
|
||||
default: 'AppState',
|
||||
types: ['AppStateStatus', 'AppStateEvent'],
|
||||
},
|
||||
'Libraries/Utilities/BackHandler': {
|
||||
default: 'BackHandler',
|
||||
types: ['BackPressEventName'],
|
||||
},
|
||||
'Libraries/Components/Clipboard/Clipboard': {
|
||||
default: 'Clipboard',
|
||||
types: null,
|
||||
},
|
||||
'Libraries/Utilities/DeviceInfo': {
|
||||
default: 'DeviceInfo',
|
||||
types: ['DeviceInfoConstants'],
|
||||
},
|
||||
'src/private/devsupport/devmenu/DevMenu': {
|
||||
default: 'DevMenu',
|
||||
types: null,
|
||||
},
|
||||
'Libraries/Utilities/DevSettings': {
|
||||
default: 'DevSettings',
|
||||
types: null,
|
||||
},
|
||||
'Libraries/Utilities/Dimensions': {
|
||||
default: 'Dimensions',
|
||||
types: [
|
||||
'DimensionsPayload',
|
||||
'DisplayMetrics',
|
||||
'DisplayMetricsAndroid',
|
||||
'ScaledSize',
|
||||
],
|
||||
},
|
||||
'Libraries/Animated/Easing': {
|
||||
default: 'Easing',
|
||||
types: ['EasingFunction'],
|
||||
},
|
||||
'Libraries/ReactNative/I18nManager': {
|
||||
default: 'I18nManager',
|
||||
types: null,
|
||||
},
|
||||
'Libraries/Interaction/InteractionManager': {
|
||||
default: 'InteractionManager',
|
||||
types: ['Handle', 'PromiseTask', 'SimpleTask'],
|
||||
},
|
||||
'Libraries/Components/Keyboard/Keyboard': {
|
||||
default: 'Keyboard',
|
||||
types: [
|
||||
'AndroidKeyboardEvent',
|
||||
'IOSKeyboardEvent',
|
||||
'KeyboardEvent',
|
||||
'KeyboardEventEasing',
|
||||
'KeyboardEventName',
|
||||
'KeyboardMetrics',
|
||||
],
|
||||
},
|
||||
'Libraries/LayoutAnimation/LayoutAnimation': {
|
||||
default: 'LayoutAnimation',
|
||||
types: [
|
||||
'LayoutAnimationAnim',
|
||||
'LayoutAnimationConfig',
|
||||
'LayoutAnimationProperties',
|
||||
'LayoutAnimationProperty',
|
||||
'LayoutAnimationType',
|
||||
'LayoutAnimationTypes',
|
||||
],
|
||||
},
|
||||
'Libraries/Linking/Linking': {
|
||||
default: 'Linking',
|
||||
types: null,
|
||||
},
|
||||
'Libraries/LogBox/LogBox': {
|
||||
default: 'LogBox',
|
||||
types: ['ExtendedExceptionData', 'IgnorePattern', 'LogData'],
|
||||
},
|
||||
'Libraries/NativeModules/specs/NativeDialogManagerAndroid': {
|
||||
default: 'NativeDialogManagerAndroid',
|
||||
types: null,
|
||||
},
|
||||
'Libraries/EventEmitter/NativeEventEmitter': {
|
||||
default: 'NativeEventEmitter',
|
||||
types: [
|
||||
'EventSubscription',
|
||||
'EmitterSubscription',
|
||||
'NativeEventSubscription',
|
||||
],
|
||||
},
|
||||
'Libraries/Network/RCTNetworking': {
|
||||
default: 'Networking',
|
||||
types: null,
|
||||
},
|
||||
'Libraries/Interaction/PanResponder': {
|
||||
default: 'PanResponder',
|
||||
types: [
|
||||
'PanResponderCallbacks',
|
||||
'PanResponderGestureState',
|
||||
'PanResponderInstance',
|
||||
],
|
||||
},
|
||||
'Libraries/PermissionsAndroid/PermissionsAndroid': {
|
||||
default: 'PermissionsAndroid',
|
||||
types: ['Permission', 'PermissionStatus', 'Rationale'],
|
||||
},
|
||||
'Libraries/Utilities/PixelRatio': {
|
||||
default: 'PixelRatio',
|
||||
types: null,
|
||||
},
|
||||
'Libraries/PushNotificationIOS/PushNotificationIOS': {
|
||||
default: 'PushNotificationIOS',
|
||||
types: ['PushNotificationEventName', 'PushNotificationPermissions'],
|
||||
},
|
||||
'Libraries/Settings/Settings': {
|
||||
default: 'Settings',
|
||||
types: null,
|
||||
},
|
||||
'Libraries/Share/Share': {
|
||||
default: 'Share',
|
||||
types: ['ShareAction', 'ShareContent', 'ShareOptions'],
|
||||
},
|
||||
'Libraries/StyleSheet/StyleSheet': {
|
||||
default: 'StyleSheet',
|
||||
types: [
|
||||
'ColorValue',
|
||||
'ImageStyle',
|
||||
'FilterFunction',
|
||||
'FontVariant',
|
||||
'NativeColorValue',
|
||||
'OpaqueColorValue',
|
||||
'StyleProp',
|
||||
'TextStyle',
|
||||
'TransformsStyle',
|
||||
'ViewStyle',
|
||||
],
|
||||
},
|
||||
'Libraries/StyleSheet/StyleSheetTypes': {
|
||||
default: null,
|
||||
types: [
|
||||
'BoxShadowValue',
|
||||
'CursorValue',
|
||||
'DimensionValue',
|
||||
'DropShadowValue',
|
||||
'EdgeInsetsValue',
|
||||
'PointValue',
|
||||
],
|
||||
},
|
||||
'Libraries/StyleSheet/Rect': {
|
||||
default: null,
|
||||
types: ['Insets'],
|
||||
},
|
||||
'Libraries/Performance/Systrace': {
|
||||
default: 'Systrace',
|
||||
types: null,
|
||||
},
|
||||
'Libraries/Components/ToastAndroid/ToastAndroid': {
|
||||
default: 'ToastAndroid',
|
||||
types: null,
|
||||
},
|
||||
'Libraries/TurboModule/TurboModuleRegistry': {
|
||||
default: 'TurboModuleRegistry',
|
||||
types: null,
|
||||
},
|
||||
'Libraries/TurboModule/RCTExport': {
|
||||
default: null,
|
||||
types: ['TurboModule'],
|
||||
},
|
||||
'Libraries/ReactNative/UIManager': {
|
||||
default: 'UIManager',
|
||||
types: null,
|
||||
},
|
||||
'Libraries/Animated/useAnimatedValue': {
|
||||
default: 'useAnimatedValue',
|
||||
types: null,
|
||||
},
|
||||
'Libraries/Utilities/useColorScheme': {
|
||||
default: 'useColorScheme',
|
||||
types: null,
|
||||
},
|
||||
'src/private/specs_DEPRECATED/modules/NativeAppearance': {
|
||||
default: null,
|
||||
types: ['ColorSchemeName'],
|
||||
},
|
||||
'Libraries/Utilities/useWindowDimensions': {
|
||||
default: 'useWindowDimensions',
|
||||
types: null,
|
||||
},
|
||||
'Libraries/UTFSequence': {
|
||||
default: 'UTFSequence',
|
||||
types: null,
|
||||
},
|
||||
'Libraries/Vibration/Vibration': {
|
||||
default: 'Vibration',
|
||||
types: null,
|
||||
},
|
||||
'Libraries/Utilities/codegenNativeComponent': {
|
||||
default: 'codegenNativeComponent',
|
||||
types: null,
|
||||
},
|
||||
'Libraries/Utilities/codegenNativeCommands': {
|
||||
default: 'codegenNativeCommands',
|
||||
types: null,
|
||||
},
|
||||
'Libraries/EventEmitter/RCTDeviceEventEmitter': {
|
||||
default: 'DeviceEventEmitter',
|
||||
types: null,
|
||||
},
|
||||
'Libraries/StyleSheet/PlatformColorValueTypesIOS': {
|
||||
default: 'DynamicColorIOS',
|
||||
types: ['DynamicColorIOSTuple'],
|
||||
},
|
||||
'Libraries/EventEmitter/RCTNativeAppEventEmitter': {
|
||||
default: 'NativeAppEventEmitter',
|
||||
types: null,
|
||||
},
|
||||
'Libraries/BatchedBridge/NativeModules': {
|
||||
default: 'NativeModules',
|
||||
types: null,
|
||||
},
|
||||
'Libraries/Utilities/Platform': {
|
||||
default: 'Platform',
|
||||
types: null,
|
||||
},
|
||||
'./Libraries/Utilities/PlatformTypes': {
|
||||
default: null,
|
||||
types: ['PlatformOSType', 'PlatformSelectSpec'],
|
||||
},
|
||||
'Libraries/StyleSheet/PlatformColorValueTypes': {
|
||||
default: 'PlatformColor',
|
||||
types: null,
|
||||
},
|
||||
'Libraries/StyleSheet/processColor': {
|
||||
default: 'processColor',
|
||||
types: ['ProcessedColorValue'],
|
||||
},
|
||||
'Libraries/ReactNative/requireNativeComponent': {
|
||||
default: 'requireNativeComponent',
|
||||
types: null,
|
||||
},
|
||||
'Libraries/ReactNative/RootTag': {
|
||||
default: 'RootTagContext',
|
||||
types: ['RootTag'],
|
||||
},
|
||||
'Libraries/Types/RootTagTypes': {
|
||||
default: null,
|
||||
types: ['RootTag'],
|
||||
},
|
||||
'src/private/types/HostInstance': {
|
||||
default: null,
|
||||
types: [
|
||||
'HostInstance',
|
||||
'NativeMethods',
|
||||
'NativeMethodsMixin',
|
||||
'MeasureInWindowOnSuccessCallback',
|
||||
'MeasureLayoutOnSuccessCallback',
|
||||
'MeasureOnSuccessCallback',
|
||||
],
|
||||
},
|
||||
'src/private/types/HostComponent': {
|
||||
default: null,
|
||||
types: ['HostComponent'],
|
||||
},
|
||||
'Libraries/vendor/core/ErrorUtils': {
|
||||
default: null,
|
||||
types: ['ErrorUtils'],
|
||||
},
|
||||
'Libraries/ReactPrivate/ReactNativePrivateInterface': {
|
||||
default: null,
|
||||
types: ['PublicRootInstance', 'PublicTextInstance'],
|
||||
},
|
||||
'Libraries/Components/AccessibilityInfo/AccessibilityInfo':
|
||||
'AccessibilityInfo',
|
||||
'Libraries/Components/ActivityIndicator/ActivityIndicator':
|
||||
'ActivityIndicator',
|
||||
'Libraries/Components/Button': 'Button',
|
||||
'Libraries/Components/DrawerAndroid/DrawerLayoutAndroid':
|
||||
'DrawerLayoutAndroid',
|
||||
'Libraries/Components/LayoutConformance/LayoutConformance':
|
||||
'experimental_LayoutConformance',
|
||||
'Libraries/Lists/FlatList': 'FlatList',
|
||||
'Libraries/Image/Image': 'Image',
|
||||
'Libraries/Image/ImageBackground': 'ImageBackground',
|
||||
'Libraries/Components/TextInput/InputAccessoryView': 'InputAccessoryView',
|
||||
'Libraries/Components/Keyboard/KeyboardAvoidingView': 'KeyboardAvoidingView',
|
||||
'Libraries/Modal/Modal': 'Modal',
|
||||
'Libraries/Components/Pressable/Pressable': 'Pressable',
|
||||
'Libraries/Components/ProgressBarAndroid/ProgressBarAndroid':
|
||||
'ProgressBarAndroid',
|
||||
'Libraries/Components/RefreshControl/RefreshControl': 'RefreshControl',
|
||||
'Libraries/Components/SafeAreaView/SafeAreaView': 'SafeAreaView',
|
||||
'Libraries/Components/ScrollView/ScrollView': 'ScrollView',
|
||||
'Libraries/Lists/SectionList': 'SectionList',
|
||||
'Libraries/Components/StatusBar/StatusBar': 'StatusBar',
|
||||
'Libraries/Components/Switch/Switch': 'Switch',
|
||||
'Libraries/Text/Text': 'Text',
|
||||
'Libraries/Components/TextInput/TextInput': 'TextInput',
|
||||
'Libraries/Components/Touchable/Touchable': 'Touchable',
|
||||
'Libraries/Components/Touchable/TouchableHighlight': 'TouchableHighlight',
|
||||
'Libraries/Components/Touchable/TouchableNativeFeedback':
|
||||
'TouchableNativeFeedback',
|
||||
'Libraries/Components/Touchable/TouchableOpacity': 'TouchableOpacity',
|
||||
'Libraries/Components/Touchable/TouchableWithoutFeedback':
|
||||
'TouchableWithoutFeedback',
|
||||
'Libraries/Components/View/View': 'View',
|
||||
'Libraries/Lists/VirtualizedList': 'VirtualizedList',
|
||||
'Libraries/Lists/VirtualizedSectionList': 'VirtualizedSectionList',
|
||||
'Libraries/ActionSheetIOS/ActionSheetIOS': 'ActionSheetIOS',
|
||||
'Libraries/Alert/Alert': 'Alert',
|
||||
'Libraries/Animated/Animated': 'Animated',
|
||||
'Libraries/Utilities/Appearance': 'Appearance',
|
||||
'Libraries/ReactNative/AppRegistry': 'AppRegistry',
|
||||
'Libraries/AppState/AppState': 'AppState',
|
||||
'Libraries/Utilities/BackHandler': 'BackHandler',
|
||||
'Libraries/Components/Clipboard/Clipboard': 'Clipboard',
|
||||
'Libraries/Utilities/DeviceInfo': 'DeviceInfo',
|
||||
'src/private/devsupport/devmenu/DevMenu': 'DevMenu',
|
||||
'Libraries/Utilities/DevSettings': 'DevSettings',
|
||||
'Libraries/Utilities/Dimensions': 'Dimensions',
|
||||
'Libraries/Animated/Easing': 'Easing',
|
||||
'Libraries/ReactNative/I18nManager': 'I18nManager',
|
||||
'Libraries/Interaction/InteractionManager': 'InteractionManager',
|
||||
'Libraries/Components/Keyboard/Keyboard': 'Keyboard',
|
||||
'Libraries/LayoutAnimation/LayoutAnimation': 'LayoutAnimation',
|
||||
'Libraries/Linking/Linking': 'Linking',
|
||||
'Libraries/LogBox/LogBox': 'LogBox',
|
||||
'Libraries/NativeModules/specs/NativeDialogManagerAndroid':
|
||||
'NativeDialogManagerAndroid',
|
||||
'Libraries/EventEmitter/NativeEventEmitter': 'NativeEventEmitter',
|
||||
'Libraries/Network/RCTNetworking': 'Networking',
|
||||
'Libraries/Interaction/PanResponder': 'PanResponder',
|
||||
'Libraries/PermissionsAndroid/PermissionsAndroid': 'PermissionsAndroid',
|
||||
'Libraries/Utilities/PixelRatio': 'PixelRatio',
|
||||
'Libraries/PushNotificationIOS/PushNotificationIOS': 'PushNotificationIOS',
|
||||
'Libraries/Settings/Settings': 'Settings',
|
||||
'Libraries/Share/Share': 'Share',
|
||||
'Libraries/StyleSheet/StyleSheet': 'StyleSheet',
|
||||
'Libraries/Performance/Systrace': 'Systrace',
|
||||
'Libraries/Components/ToastAndroid/ToastAndroid': 'ToastAndroid',
|
||||
'Libraries/TurboModule/TurboModuleRegistry': 'TurboModuleRegistry',
|
||||
'Libraries/ReactNative/UIManager': 'UIManager',
|
||||
'Libraries/Animated/useAnimatedValue': 'useAnimatedValue',
|
||||
'Libraries/Utilities/useColorScheme': 'useColorScheme',
|
||||
'Libraries/Utilities/useWindowDimensions': 'useWindowDimensions',
|
||||
'Libraries/UTFSequence': 'UTFSequence',
|
||||
'Libraries/Vibration/Vibration': 'Vibration',
|
||||
'Libraries/Utilities/codegenNativeComponent': 'codegenNativeComponent',
|
||||
'Libraries/Utilities/codegenNativeCommands': 'codegenNativeCommands',
|
||||
'Libraries/EventEmitter/RCTDeviceEventEmitter': 'DeviceEventEmitter',
|
||||
'Libraries/StyleSheet/PlatformColorValueTypesIOS': 'DynamicColorIOS',
|
||||
'Libraries/EventEmitter/RCTNativeAppEventEmitter': 'NativeAppEventEmitter',
|
||||
'Libraries/BatchedBridge/NativeModules': 'NativeModules',
|
||||
'Libraries/Utilities/Platform': 'Platform',
|
||||
'Libraries/StyleSheet/PlatformColorValueTypes': 'PlatformColor',
|
||||
'Libraries/StyleSheet/processColor': 'processColor',
|
||||
'Libraries/ReactNative/requireNativeComponent': 'requireNativeComponent',
|
||||
'Libraries/ReactNative/RootTag': 'RootTagContext',
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/eslint-plugin-specs",
|
||||
"version": "0.81.0-main",
|
||||
"version": "0.80.0-main",
|
||||
"description": "ESLint rules to validate NativeModule and Component Specs",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -26,16 +26,16 @@
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.25.2",
|
||||
"@babel/plugin-transform-flow-strip-types": "^7.25.2",
|
||||
"@react-native/codegen": "0.81.0-main",
|
||||
"@react-native/codegen": "0.80.0-main",
|
||||
"make-dir": "^2.1.0",
|
||||
"pirates": "^4.0.1",
|
||||
"source-map-support": "0.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-plugin-syntax-hermes-parser": "0.29.1",
|
||||
"hermes-eslint": "0.29.1"
|
||||
"babel-plugin-syntax-hermes-parser": "0.29.0",
|
||||
"hermes-eslint": "0.29.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 20.19.4"
|
||||
"node": ">= 22.14.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,10 +5,7 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
plugins {
|
||||
alias(libs.plugins.kotlin.jvm).apply(false)
|
||||
alias(libs.plugins.ktfmt).apply(true)
|
||||
}
|
||||
plugins { alias(libs.plugins.kotlin.jvm).apply(false) }
|
||||
|
||||
tasks.register("build") {
|
||||
dependsOn(
|
||||
@@ -27,21 +24,3 @@ tasks.register("clean") {
|
||||
":shared:clean",
|
||||
)
|
||||
}
|
||||
|
||||
tasks.named("ktfmtCheck") {
|
||||
dependsOn(
|
||||
":react-native-gradle-plugin:ktfmtCheck",
|
||||
":settings-plugin:ktfmtCheck",
|
||||
":shared-testutil:ktfmtCheck",
|
||||
":shared:ktfmtCheck",
|
||||
)
|
||||
}
|
||||
|
||||
tasks.named("ktfmtFormat") {
|
||||
dependsOn(
|
||||
":react-native-gradle-plugin:ktfmtFormat",
|
||||
":settings-plugin:ktfmtFormat",
|
||||
":shared-testutil:ktfmtFormat",
|
||||
":shared:ktfmtFormat",
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
[versions]
|
||||
agp = "8.11.0"
|
||||
agp = "8.10.1"
|
||||
gson = "2.8.9"
|
||||
guava = "31.0.1-jre"
|
||||
javapoet = "1.13.0"
|
||||
junit = "4.13.2"
|
||||
kotlin = "2.1.20"
|
||||
assertj = "3.25.1"
|
||||
ktfmt = "0.22.0"
|
||||
|
||||
[libraries]
|
||||
kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
|
||||
@@ -19,4 +18,3 @@ assertj = { module = "org.assertj:assertj-core", version.ref = "assertj" }
|
||||
|
||||
[plugins]
|
||||
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
|
||||
ktfmt = { id = "com.ncorti.ktfmt.gradle", version.ref = "ktfmt" }
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/gradle-plugin",
|
||||
"version": "0.81.0-main",
|
||||
"version": "0.80.0-main",
|
||||
"description": "Gradle Plugin for React Native",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -16,7 +16,7 @@
|
||||
],
|
||||
"bugs": "https://github.com/facebook/react-native/issues",
|
||||
"engines": {
|
||||
"node": ">= 20.19.4"
|
||||
"node": ">= 22.14.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "./gradlew build",
|
||||
|
||||
@@ -12,7 +12,6 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
plugins {
|
||||
alias(libs.plugins.kotlin.jvm)
|
||||
alias(libs.plugins.ktfmt)
|
||||
id("java-gradle-plugin")
|
||||
}
|
||||
|
||||
|
||||
-2
@@ -18,7 +18,6 @@ import com.facebook.react.tasks.GenerateEntryPointTask
|
||||
import com.facebook.react.tasks.GeneratePackageListTask
|
||||
import com.facebook.react.utils.AgpConfiguratorUtils.configureBuildConfigFieldsForApp
|
||||
import com.facebook.react.utils.AgpConfiguratorUtils.configureBuildConfigFieldsForLibraries
|
||||
import com.facebook.react.utils.AgpConfiguratorUtils.configureBuildTypesForApp
|
||||
import com.facebook.react.utils.AgpConfiguratorUtils.configureDevServerLocation
|
||||
import com.facebook.react.utils.AgpConfiguratorUtils.configureNamespaceForLibraries
|
||||
import com.facebook.react.utils.BackwardCompatUtils.configureBackwardCompatibilityReactMap
|
||||
@@ -85,7 +84,6 @@ class ReactPlugin : Plugin<Project> {
|
||||
configureAutolinking(project, extension)
|
||||
configureCodegen(project, extension, rootExtension, isLibrary = false)
|
||||
configureResources(project, extension)
|
||||
configureBuildTypesForApp(project)
|
||||
}
|
||||
|
||||
// Library Only Configuration
|
||||
|
||||
-5
@@ -70,7 +70,6 @@ abstract class GenerateEntryPointTask : DefaultTask() {
|
||||
|
||||
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
|
||||
import com.facebook.react.common.annotations.internal.LegacyArchitectureLogger;
|
||||
import com.facebook.react.views.view.WindowUtilKt;
|
||||
import com.facebook.react.soloader.OpenSourceMergedSoMapping;
|
||||
import com.facebook.soloader.SoLoader;
|
||||
|
||||
@@ -94,10 +93,6 @@ abstract class GenerateEntryPointTask : DefaultTask() {
|
||||
if ({{packageName}}.BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
|
||||
DefaultNewArchitectureEntryPoint.load();
|
||||
}
|
||||
|
||||
if ({{packageName}}.BuildConfig.IS_EDGE_TO_EDGE_ENABLED) {
|
||||
WindowUtilKt.setEdgeToEdgeFeatureFlagOn();
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
-1
@@ -148,7 +148,6 @@ abstract class GeneratePackageListTask : DefaultTask() {
|
||||
|
||||
{{ packageImports }}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class PackageList {
|
||||
private Application application;
|
||||
private ReactNativeHost reactNativeHost;
|
||||
|
||||
-24
@@ -11,7 +11,6 @@ import com.android.build.api.variant.ApplicationAndroidComponentsExtension
|
||||
import com.android.build.api.variant.LibraryAndroidComponentsExtension
|
||||
import com.android.build.gradle.LibraryExtension
|
||||
import com.facebook.react.ReactExtension
|
||||
import com.facebook.react.utils.ProjectUtils.isEdgeToEdgeEnabled
|
||||
import com.facebook.react.utils.ProjectUtils.isHermesEnabled
|
||||
import com.facebook.react.utils.ProjectUtils.isNewArchEnabled
|
||||
import java.io.File
|
||||
@@ -19,7 +18,6 @@ import java.net.Inet4Address
|
||||
import java.net.NetworkInterface
|
||||
import javax.xml.parsers.DocumentBuilder
|
||||
import javax.xml.parsers.DocumentBuilderFactory
|
||||
import kotlin.plus
|
||||
import org.gradle.api.Action
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.plugins.AppliedPlugin
|
||||
@@ -28,26 +26,6 @@ import org.w3c.dom.Element
|
||||
@Suppress("UnstableApiUsage")
|
||||
internal object AgpConfiguratorUtils {
|
||||
|
||||
fun configureBuildTypesForApp(project: Project) {
|
||||
val action =
|
||||
Action<AppliedPlugin> {
|
||||
project.extensions
|
||||
.getByType(ApplicationAndroidComponentsExtension::class.java)
|
||||
.finalizeDsl { ext ->
|
||||
ext.buildTypes {
|
||||
val debug =
|
||||
getByName("debug").apply {
|
||||
manifestPlaceholders["usesCleartextTraffic"] = "true"
|
||||
}
|
||||
getByName("release").apply {
|
||||
manifestPlaceholders["usesCleartextTraffic"] = "false"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
project.pluginManager.withPlugin("com.android.application", action)
|
||||
}
|
||||
|
||||
fun configureBuildConfigFieldsForApp(project: Project, extension: ReactExtension) {
|
||||
val action =
|
||||
Action<AppliedPlugin> {
|
||||
@@ -61,8 +39,6 @@ internal object AgpConfiguratorUtils {
|
||||
project.isNewArchEnabled(extension).toString())
|
||||
ext.defaultConfig.buildConfigField(
|
||||
"boolean", "IS_HERMES_ENABLED", project.isHermesEnabled.toString())
|
||||
ext.defaultConfig.buildConfigField(
|
||||
"boolean", "IS_EDGE_TO_EDGE_ENABLED", project.isEdgeToEdgeEnabled.toString())
|
||||
}
|
||||
}
|
||||
project.pluginManager.withPlugin("com.android.application", action)
|
||||
|
||||
-27
@@ -8,14 +8,12 @@
|
||||
package com.facebook.react.utils
|
||||
|
||||
import com.facebook.react.utils.PropertyUtils.DEFAULT_INTERNAL_PUBLISHING_GROUP
|
||||
import com.facebook.react.utils.PropertyUtils.EXCLUSIVE_ENTEPRISE_REPOSITORY
|
||||
import com.facebook.react.utils.PropertyUtils.INCLUDE_JITPACK_REPOSITORY
|
||||
import com.facebook.react.utils.PropertyUtils.INCLUDE_JITPACK_REPOSITORY_DEFAULT
|
||||
import com.facebook.react.utils.PropertyUtils.INTERNAL_PUBLISHING_GROUP
|
||||
import com.facebook.react.utils.PropertyUtils.INTERNAL_REACT_NATIVE_MAVEN_LOCAL_REPO
|
||||
import com.facebook.react.utils.PropertyUtils.INTERNAL_USE_HERMES_NIGHTLY
|
||||
import com.facebook.react.utils.PropertyUtils.INTERNAL_VERSION_NAME
|
||||
import com.facebook.react.utils.PropertyUtils.SCOPED_EXCLUSIVE_ENTEPRISE_REPOSITORY
|
||||
import com.facebook.react.utils.PropertyUtils.SCOPED_INCLUDE_JITPACK_REPOSITORY
|
||||
import java.io.File
|
||||
import java.net.URI
|
||||
@@ -30,12 +28,6 @@ internal object DependencyUtils {
|
||||
* party libraries which are auto-linked.
|
||||
*/
|
||||
fun configureRepositories(project: Project) {
|
||||
val exclusiveEnterpriseRepository = project.rootProject.exclusiveEnterpriseRepository()
|
||||
if (exclusiveEnterpriseRepository != null) {
|
||||
project.logger.lifecycle(
|
||||
"Replacing ALL Maven Repositories with: $exclusiveEnterpriseRepository")
|
||||
}
|
||||
|
||||
project.rootProject.allprojects { eachProject ->
|
||||
with(eachProject) {
|
||||
if (hasProperty(INTERNAL_REACT_NATIVE_MAVEN_LOCAL_REPO)) {
|
||||
@@ -44,16 +36,6 @@ internal object DependencyUtils {
|
||||
repo.content { it.excludeGroup("org.webkit") }
|
||||
}
|
||||
}
|
||||
|
||||
if (exclusiveEnterpriseRepository != null) {
|
||||
// We remove all previously set repositories and only configure the proxy provided by the
|
||||
// user.
|
||||
rootProject.repositories.clear()
|
||||
mavenRepoFromUrl(exclusiveEnterpriseRepository)
|
||||
// We return here as we don't want to configure other repositories as well.
|
||||
return@allprojects
|
||||
}
|
||||
|
||||
// We add the snapshot for users on nightlies.
|
||||
mavenRepoFromUrl("https://central.sonatype.com/repository/maven-snapshots/") { repo ->
|
||||
repo.content { it.excludeGroup("org.webkit") }
|
||||
@@ -199,13 +181,4 @@ internal object DependencyUtils {
|
||||
property(INCLUDE_JITPACK_REPOSITORY).toString().toBoolean()
|
||||
else -> INCLUDE_JITPACK_REPOSITORY_DEFAULT
|
||||
}
|
||||
|
||||
internal fun Project.exclusiveEnterpriseRepository() =
|
||||
when {
|
||||
hasProperty(SCOPED_EXCLUSIVE_ENTEPRISE_REPOSITORY) ->
|
||||
property(SCOPED_EXCLUSIVE_ENTEPRISE_REPOSITORY).toString()
|
||||
hasProperty(EXCLUSIVE_ENTEPRISE_REPOSITORY) ->
|
||||
property(EXCLUSIVE_ENTEPRISE_REPOSITORY).toString()
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
||||
-9
@@ -11,11 +11,9 @@ import com.facebook.react.ReactExtension
|
||||
import com.facebook.react.model.ModelPackageJson
|
||||
import com.facebook.react.utils.KotlinStdlibCompatUtils.lowercaseCompat
|
||||
import com.facebook.react.utils.KotlinStdlibCompatUtils.toBooleanStrictOrNullCompat
|
||||
import com.facebook.react.utils.PropertyUtils.EDGE_TO_EDGE_ENABLED
|
||||
import com.facebook.react.utils.PropertyUtils.HERMES_ENABLED
|
||||
import com.facebook.react.utils.PropertyUtils.NEW_ARCH_ENABLED
|
||||
import com.facebook.react.utils.PropertyUtils.REACT_NATIVE_ARCHITECTURES
|
||||
import com.facebook.react.utils.PropertyUtils.SCOPED_EDGE_TO_EDGE_ENABLED
|
||||
import com.facebook.react.utils.PropertyUtils.SCOPED_HERMES_ENABLED
|
||||
import com.facebook.react.utils.PropertyUtils.SCOPED_NEW_ARCH_ENABLED
|
||||
import com.facebook.react.utils.PropertyUtils.SCOPED_REACT_NATIVE_ARCHITECTURES
|
||||
@@ -61,13 +59,6 @@ internal object ProjectUtils {
|
||||
HERMES_FALLBACK
|
||||
}
|
||||
|
||||
internal val Project.isEdgeToEdgeEnabled: Boolean
|
||||
get() =
|
||||
(project.hasProperty(EDGE_TO_EDGE_ENABLED) &&
|
||||
project.property(EDGE_TO_EDGE_ENABLED).toString().toBoolean()) ||
|
||||
(project.hasProperty(SCOPED_EDGE_TO_EDGE_ENABLED) &&
|
||||
project.property(SCOPED_EDGE_TO_EDGE_ENABLED).toString().toBoolean())
|
||||
|
||||
internal val Project.useThirdPartyJSC: Boolean
|
||||
get() =
|
||||
(project.hasProperty(USE_THIRD_PARTY_JSC) &&
|
||||
|
||||
+1
-11
@@ -14,14 +14,10 @@ object PropertyUtils {
|
||||
const val NEW_ARCH_ENABLED = "newArchEnabled"
|
||||
const val SCOPED_NEW_ARCH_ENABLED = "react.newArchEnabled"
|
||||
|
||||
/** Public property that toggles Hermes */
|
||||
/** Public property that toggles the New Architecture */
|
||||
const val HERMES_ENABLED = "hermesEnabled"
|
||||
const val SCOPED_HERMES_ENABLED = "react.hermesEnabled"
|
||||
|
||||
/** Public property that toggles edge-to-edge */
|
||||
const val EDGE_TO_EDGE_ENABLED = "edgeToEdgeEnabled"
|
||||
const val SCOPED_EDGE_TO_EDGE_ENABLED = "react.edgeToEdgeEnabled"
|
||||
|
||||
/** Public property that excludes jsctooling from core */
|
||||
const val USE_THIRD_PARTY_JSC = "useThirdPartyJSC"
|
||||
const val SCOPED_USE_THIRD_PARTY_JSC = "react.useThirdPartyJSC"
|
||||
@@ -34,12 +30,6 @@ object PropertyUtils {
|
||||
const val INCLUDE_JITPACK_REPOSITORY = "includeJitpackRepository"
|
||||
const val SCOPED_INCLUDE_JITPACK_REPOSITORY = "react.includeJitpackRepository"
|
||||
|
||||
/**
|
||||
* Public property that allows to configure an enterprise repository proxy as exclusive repository
|
||||
*/
|
||||
const val EXCLUSIVE_ENTEPRISE_REPOSITORY = "exclusiveEnterpriseRepository"
|
||||
const val SCOPED_EXCLUSIVE_ENTEPRISE_REPOSITORY = "react.exclusiveEnterpriseRepository"
|
||||
|
||||
/** By default we include JitPack to avoid breaking user builds */
|
||||
internal const val INCLUDE_JITPACK_REPOSITORY_DEFAULT = true
|
||||
|
||||
|
||||
-5
@@ -55,7 +55,6 @@ class GenerateEntryPointTaskTest {
|
||||
|
||||
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
|
||||
import com.facebook.react.common.annotations.internal.LegacyArchitectureLogger;
|
||||
import com.facebook.react.views.view.WindowUtilKt;
|
||||
import com.facebook.react.soloader.OpenSourceMergedSoMapping;
|
||||
import com.facebook.soloader.SoLoader;
|
||||
|
||||
@@ -79,10 +78,6 @@ class GenerateEntryPointTaskTest {
|
||||
if (com.facebook.react.BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
|
||||
DefaultNewArchitectureEntryPoint.load();
|
||||
}
|
||||
|
||||
if (com.facebook.react.BuildConfig.IS_EDGE_TO_EDGE_ENABLED) {
|
||||
WindowUtilKt.setEdgeToEdgeFeatureFlagOn();
|
||||
}
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
+1
-3
@@ -233,7 +233,6 @@ class GeneratePackageListTaskTest {
|
||||
|
||||
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class PackageList {
|
||||
private Application application;
|
||||
private ReactNativeHost reactNativeHost;
|
||||
@@ -312,8 +311,7 @@ class GeneratePackageListTaskTest {
|
||||
import com.facebook.react.aPackage;
|
||||
// @react-native/another-package
|
||||
import com.facebook.react.anotherPackage;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
|
||||
public class PackageList {
|
||||
private Application application;
|
||||
private ReactNativeHost reactNativeHost;
|
||||
|
||||
+1
-44
@@ -10,7 +10,6 @@ package com.facebook.react.utils
|
||||
import com.facebook.react.tests.createProject
|
||||
import com.facebook.react.utils.DependencyUtils.configureDependencies
|
||||
import com.facebook.react.utils.DependencyUtils.configureRepositories
|
||||
import com.facebook.react.utils.DependencyUtils.exclusiveEnterpriseRepository
|
||||
import com.facebook.react.utils.DependencyUtils.getDependencySubstitutions
|
||||
import com.facebook.react.utils.DependencyUtils.mavenRepoFromURI
|
||||
import com.facebook.react.utils.DependencyUtils.mavenRepoFromUrl
|
||||
@@ -100,24 +99,6 @@ class DependencyUtilsTest {
|
||||
.isNotNull()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun configureRepositories_withExclusiveEnterpriseRepository_replacesAllRepositories() {
|
||||
val repositoryURI = URI.create("https://maven.myfabolousorganization.it")
|
||||
|
||||
val project = createProject()
|
||||
project.rootProject.extensions.extraProperties.set(
|
||||
"exclusiveEnterpriseRepository", repositoryURI.toString())
|
||||
|
||||
configureRepositories(project)
|
||||
|
||||
assertThat(project.repositories).hasSize(1)
|
||||
assertThat(
|
||||
project.repositories.firstOrNull {
|
||||
it is MavenArtifactRepository && it.url == repositoryURI
|
||||
})
|
||||
.isNotNull()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun configureRepositories_withIncludeJitpackRepositoryFalse_doesNotContainJitPack() {
|
||||
val repositoryURI = URI.create("https://www.jitpack.io")
|
||||
@@ -489,7 +470,7 @@ class DependencyUtilsTest {
|
||||
@Test
|
||||
fun shouldAddJitPack_withUnscopedProperty() {
|
||||
val project = createProject(tempFolder.root)
|
||||
project.extensions.extraProperties.set("includeJitpackRepository", "false")
|
||||
project.extensions.extraProperties.set("react.includeJitpackRepository", "false")
|
||||
assertThat(project.shouldAddJitPack()).isFalse()
|
||||
}
|
||||
|
||||
@@ -498,28 +479,4 @@ class DependencyUtilsTest {
|
||||
val project = createProject(tempFolder.root)
|
||||
assertThat(project.shouldAddJitPack()).isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun exclusiveEnterpriseRepository_withScopedProperty() {
|
||||
val project = createProject(tempFolder.root)
|
||||
project.extensions.extraProperties.set(
|
||||
"react.exclusiveEnterpriseRepository", "https://maven.myfabolousorganization.it")
|
||||
assertThat(project.exclusiveEnterpriseRepository())
|
||||
.isEqualTo("https://maven.myfabolousorganization.it")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun exclusiveEnterpriseRepository_withUnscopedProperty() {
|
||||
val project = createProject(tempFolder.root)
|
||||
project.extensions.extraProperties.set(
|
||||
"exclusiveEnterpriseRepository", "https://maven.myfabolousorganization.it")
|
||||
assertThat(project.exclusiveEnterpriseRepository())
|
||||
.isEqualTo("https://maven.myfabolousorganization.it")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun exclusiveEnterpriseRepository_defaultIsTrue() {
|
||||
val project = createProject(tempFolder.root)
|
||||
assertThat(project.exclusiveEnterpriseRepository()).isNull()
|
||||
}
|
||||
}
|
||||
|
||||
+1
-28
@@ -12,7 +12,6 @@ import com.facebook.react.model.ModelCodegenConfig
|
||||
import com.facebook.react.model.ModelPackageJson
|
||||
import com.facebook.react.tests.createProject
|
||||
import com.facebook.react.utils.ProjectUtils.getReactNativeArchitectures
|
||||
import com.facebook.react.utils.ProjectUtils.isEdgeToEdgeEnabled
|
||||
import com.facebook.react.utils.ProjectUtils.isHermesEnabled
|
||||
import com.facebook.react.utils.ProjectUtils.isNewArchEnabled
|
||||
import com.facebook.react.utils.ProjectUtils.needsCodegenFromPackageJson
|
||||
@@ -99,7 +98,7 @@ class ProjectUtilsTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isHermesEnabled_withDisabledViaProperty_returnsFalse() {
|
||||
fun isNewArchEnabled_withDisabledViaProperty_returnsFalse() {
|
||||
val project = createProject()
|
||||
project.extensions.extraProperties.set("hermesEnabled", "false")
|
||||
assertThat(project.isHermesEnabled).isFalse()
|
||||
@@ -151,32 +150,6 @@ class ProjectUtilsTest {
|
||||
assertThat(project.isHermesEnabled).isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isEdgeToEdgeEnabled_returnsFalseByDefault() {
|
||||
assertThat(createProject().isEdgeToEdgeEnabled).isFalse()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isEdgeToEdgeEnabled_withDisabledViaProperty_returnsFalse() {
|
||||
val project = createProject()
|
||||
project.extensions.extraProperties.set("edgeToEdgeEnabled", "false")
|
||||
assertThat(project.isEdgeToEdgeEnabled).isFalse()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isEdgeToEdgeEnabled_withEnabledViaProperty_returnsTrue() {
|
||||
val project = createProject()
|
||||
project.extensions.extraProperties.set("edgeToEdgeEnabled", "true")
|
||||
assertThat(project.isEdgeToEdgeEnabled).isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isEdgeToEdgeEnabled_withInvalidViaProperty_returnsFalse() {
|
||||
val project = createProject()
|
||||
project.extensions.extraProperties.set("edgeToEdgeEnabled", "¯\\_(ツ)_/¯")
|
||||
assertThat(project.isEdgeToEdgeEnabled).isFalse()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun needsCodegenFromPackageJson_withCodegenConfigInPackageJson_returnsTrue() {
|
||||
val project = createProject()
|
||||
|
||||
@@ -12,7 +12,6 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
plugins {
|
||||
alias(libs.plugins.kotlin.jvm)
|
||||
alias(libs.plugins.ktfmt)
|
||||
id("java-gradle-plugin")
|
||||
}
|
||||
|
||||
|
||||
@@ -10,10 +10,7 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
plugins {
|
||||
alias(libs.plugins.kotlin.jvm)
|
||||
alias(libs.plugins.ktfmt)
|
||||
}
|
||||
plugins { alias(libs.plugins.kotlin.jvm) }
|
||||
|
||||
repositories { mavenCentral() }
|
||||
|
||||
|
||||
@@ -10,10 +10,7 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
plugins {
|
||||
alias(libs.plugins.kotlin.jvm)
|
||||
alias(libs.plugins.ktfmt)
|
||||
}
|
||||
plugins { alias(libs.plugins.kotlin.jvm) }
|
||||
|
||||
repositories { mavenCentral() }
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/metro-config",
|
||||
"version": "0.81.0-main",
|
||||
"version": "0.80.0-main",
|
||||
"description": "Metro configuration for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -16,7 +16,7 @@
|
||||
],
|
||||
"bugs": "https://github.com/facebook/react-native/issues",
|
||||
"engines": {
|
||||
"node": ">= 20.19.4"
|
||||
"node": ">= 22.14.0"
|
||||
},
|
||||
"exports": {
|
||||
".": "./src/index.js",
|
||||
@@ -26,9 +26,9 @@
|
||||
"dist"
|
||||
],
|
||||
"dependencies": {
|
||||
"@react-native/js-polyfills": "0.81.0-main",
|
||||
"@react-native/metro-babel-transformer": "0.81.0-main",
|
||||
"metro-config": "^0.83.0",
|
||||
"metro-runtime": "^0.83.0"
|
||||
"@react-native/js-polyfills": "0.80.0-main",
|
||||
"@react-native/metro-babel-transformer": "0.80.0-main",
|
||||
"metro-config": "^0.82.4",
|
||||
"metro-runtime": "^0.82.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ const INTERNAL_CALLSITES_REGEX = new RegExp(
|
||||
|
||||
export {mergeConfig} from 'metro-config';
|
||||
|
||||
let frameworkDefaults: InputConfigT = {};
|
||||
let frameworkDefaults = {};
|
||||
export function setFrameworkDefaults(config: InputConfigT) {
|
||||
frameworkDefaults = config;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ export type * from './index.flow';
|
||||
*/
|
||||
|
||||
if (!process.env.BUILD_EXCLUDE_BABEL_REGISTER) {
|
||||
require('../../../scripts/shared/babelRegister').registerForMonorepo();
|
||||
require('../../../scripts/babel-register').registerForMonorepo();
|
||||
}
|
||||
|
||||
module.exports = require('./index.flow');
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/new-app-screen",
|
||||
"version": "0.81.0-main",
|
||||
"version": "0.80.0-main",
|
||||
"description": "NewAppScreen component for React Native",
|
||||
"keywords": [
|
||||
"react-native"
|
||||
@@ -30,6 +30,6 @@
|
||||
}
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 20.19.4"
|
||||
"node": ">= 22.14.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ const Links: Array<{
|
||||
},
|
||||
{
|
||||
title: 'Community',
|
||||
description: 'Explore & get help',
|
||||
description: 'Expore & get help',
|
||||
url: 'https://reactnative.dev/community/overview',
|
||||
},
|
||||
{
|
||||
|
||||
@@ -13,7 +13,10 @@ import {ThemedText, useTheme} from './Theme';
|
||||
import * as React from 'react';
|
||||
import {
|
||||
Image,
|
||||
Platform,
|
||||
SafeAreaView,
|
||||
ScrollView,
|
||||
StatusBar,
|
||||
StyleSheet,
|
||||
Text,
|
||||
TouchableHighlight,
|
||||
@@ -26,32 +29,24 @@ import {version as ReactNativeVersion} from 'react-native/Libraries/Core/ReactNa
|
||||
|
||||
export type NewAppScreenProps = $ReadOnly<{
|
||||
templateFileName?: string,
|
||||
safeAreaInsets?: $ReadOnly<{
|
||||
top: number,
|
||||
bottom: number,
|
||||
left: number,
|
||||
right: number,
|
||||
}>,
|
||||
}>;
|
||||
|
||||
const statusBarHeightOffset = Platform.select({
|
||||
android: StatusBar.currentHeight || 0,
|
||||
default: 0,
|
||||
});
|
||||
|
||||
export default function NewAppScreen({
|
||||
templateFileName = 'App.tsx',
|
||||
safeAreaInsets = {top: 0, bottom: 0, left: 0, right: 0},
|
||||
}: NewAppScreenProps): React.Node {
|
||||
const {colors} = useTheme();
|
||||
const isDarkMode = useColorScheme() === 'dark';
|
||||
const isLargeScreen = useWindowDimensions().width > 600;
|
||||
|
||||
return (
|
||||
<View
|
||||
style={{
|
||||
backgroundColor: colors.background,
|
||||
paddingTop: safeAreaInsets.top,
|
||||
paddingLeft: safeAreaInsets.left,
|
||||
paddingRight: safeAreaInsets.right,
|
||||
}}>
|
||||
<ScrollView style={{paddingBottom: safeAreaInsets.bottom}}>
|
||||
<View style={styles.container}>
|
||||
<SafeAreaView style={{backgroundColor: colors.background}}>
|
||||
<ScrollView>
|
||||
<View style={[styles.container, {paddingTop: statusBarHeightOffset}]}>
|
||||
<View style={styles.header}>
|
||||
<Image
|
||||
style={styles.logo}
|
||||
@@ -104,7 +99,7 @@ export default function NewAppScreen({
|
||||
</View>
|
||||
</View>
|
||||
</ScrollView>
|
||||
</View>
|
||||
</SafeAreaView>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
-8
@@ -11,14 +11,6 @@ import type * as React from 'react';
|
||||
|
||||
export type NewAppScreenProps = Readonly<{
|
||||
templateFileName?: string | undefined;
|
||||
safeAreaInsets?:
|
||||
| Readonly<{
|
||||
top: number;
|
||||
bottom: number;
|
||||
left: number;
|
||||
right: number;
|
||||
}>
|
||||
| undefined;
|
||||
}>;
|
||||
|
||||
export function NewAppScreen(props: NewAppScreenProps): React.ReactNode;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/normalize-colors",
|
||||
"version": "0.81.0-main",
|
||||
"version": "0.80.0-main",
|
||||
"description": "Color normalization for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
@@ -0,0 +1,277 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow strict-local
|
||||
* @format
|
||||
*/
|
||||
|
||||
const LOG_LEVELS = {
|
||||
trace: 0,
|
||||
info: 1,
|
||||
warn: 2,
|
||||
error: 3,
|
||||
};
|
||||
|
||||
describe('console', () => {
|
||||
describe('.table(data, rows)', () => {
|
||||
let originalNativeLoggingHook;
|
||||
let logFn;
|
||||
|
||||
beforeEach(() => {
|
||||
originalNativeLoggingHook = global.nativeLoggingHook;
|
||||
logFn = global.nativeLoggingHook = jest.fn();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
global.nativeLoggingHook = originalNativeLoggingHook;
|
||||
});
|
||||
|
||||
it('should print the passed array as a Markdown table', () => {
|
||||
console.table([
|
||||
{name: 'First', value: 500},
|
||||
{name: 'Second', value: 600},
|
||||
{name: 'Third', value: 700},
|
||||
{name: 'Fourth', value: 800, extraValue: true},
|
||||
]);
|
||||
|
||||
expect(logFn).toHaveBeenCalledTimes(1);
|
||||
expect(logFn.mock.lastCall).toEqual([
|
||||
`
|
||||
| (index) | name | value | extraValue |
|
||||
| ------- | -------- | ----- | ---------- |
|
||||
| 0 | 'First' | 500 | |
|
||||
| 1 | 'Second' | 600 | |
|
||||
| 2 | 'Third' | 700 | |
|
||||
| 3 | 'Fourth' | 800 | true |`,
|
||||
LOG_LEVELS.info,
|
||||
]);
|
||||
});
|
||||
|
||||
it('should print the passed dictionary as a Markdown table', () => {
|
||||
console.table({
|
||||
first: {name: 'First', value: 500},
|
||||
second: {name: 'Second', value: 600},
|
||||
third: {name: 'Third', value: 700},
|
||||
fourth: {name: 'Fourth', value: 800, extraValue: true},
|
||||
});
|
||||
|
||||
expect(logFn).toHaveBeenCalledTimes(1);
|
||||
expect(logFn.mock.lastCall).toEqual([
|
||||
`
|
||||
| (index) | name | value | extraValue |
|
||||
| ------- | -------- | ----- | ---------- |
|
||||
| first | 'First' | 500 | |
|
||||
| second | 'Second' | 600 | |
|
||||
| third | 'Third' | 700 | |
|
||||
| fourth | 'Fourth' | 800 | true |`,
|
||||
LOG_LEVELS.info,
|
||||
]);
|
||||
});
|
||||
|
||||
it('should work with different types of values', () => {
|
||||
console.table([
|
||||
{
|
||||
string: '',
|
||||
number: 0,
|
||||
boolean: true,
|
||||
function: () => {},
|
||||
object: {a: 1, b: 2},
|
||||
null: null,
|
||||
undefined: undefined,
|
||||
},
|
||||
{
|
||||
string: 'a',
|
||||
number: 1,
|
||||
boolean: true,
|
||||
function: () => {},
|
||||
object: {a: 1, b: 2},
|
||||
null: null,
|
||||
undefined: undefined,
|
||||
},
|
||||
{
|
||||
string: 'aa',
|
||||
number: 2,
|
||||
boolean: false,
|
||||
function: () => {},
|
||||
object: {a: 1, b: 2},
|
||||
null: null,
|
||||
undefined: undefined,
|
||||
},
|
||||
{
|
||||
string: 'aaa',
|
||||
number: 3,
|
||||
boolean: false,
|
||||
function: () => {},
|
||||
object: {a: 1, b: 2},
|
||||
null: null,
|
||||
undefined: undefined,
|
||||
},
|
||||
]);
|
||||
|
||||
expect(logFn).toHaveBeenCalledTimes(1);
|
||||
expect(logFn.mock.lastCall).toEqual([
|
||||
`
|
||||
| (index) | string | number | boolean | function | object | null | undefined |
|
||||
| ------- | ------ | ------ | ------- | -------- | ------ | ---- | --------- |
|
||||
| 0 | '' | 0 | true | ƒ | {…} | null | undefined |
|
||||
| 1 | 'a' | 1 | true | ƒ | {…} | null | undefined |
|
||||
| 2 | 'aa' | 2 | false | ƒ | {…} | null | undefined |
|
||||
| 3 | 'aaa' | 3 | false | ƒ | {…} | null | undefined |`,
|
||||
LOG_LEVELS.info,
|
||||
]);
|
||||
});
|
||||
|
||||
it('should print the keys in all the objects', () => {
|
||||
console.table([
|
||||
{name: 'foo'},
|
||||
{name: 'bar', value: 1},
|
||||
{value: 2, surname: 'baz'},
|
||||
{address: 'other'},
|
||||
]);
|
||||
|
||||
expect(logFn).toHaveBeenCalledTimes(1);
|
||||
expect(logFn.mock.lastCall).toEqual([
|
||||
`
|
||||
| (index) | name | value | surname | address |
|
||||
| ------- | ----- | ----- | ------- | ------- |
|
||||
| 0 | 'foo' | | | |
|
||||
| 1 | 'bar' | 1 | | |
|
||||
| 2 | | 2 | 'baz' | |
|
||||
| 3 | | | | 'other' |`,
|
||||
LOG_LEVELS.info,
|
||||
]);
|
||||
});
|
||||
|
||||
it('should print an empty string for empty arrays', () => {
|
||||
console.table([]);
|
||||
|
||||
expect(logFn).toHaveBeenCalledTimes(1);
|
||||
expect(logFn.mock.lastCall).toEqual([``, LOG_LEVELS.info]);
|
||||
});
|
||||
|
||||
it('should print an empty string for empty dictionaries', () => {
|
||||
console.table({});
|
||||
|
||||
expect(logFn).toHaveBeenCalledTimes(1);
|
||||
expect(logFn.mock.lastCall).toEqual([``, LOG_LEVELS.info]);
|
||||
});
|
||||
|
||||
// This test is currently failing
|
||||
it('should print an indices table for an array of empty objects', () => {
|
||||
console.table([{}, {}, {}, {}]);
|
||||
|
||||
expect(logFn).toHaveBeenCalledTimes(1);
|
||||
expect(logFn.mock.lastCall).toEqual([
|
||||
`
|
||||
| (index) |
|
||||
| ------- |
|
||||
| 0 |
|
||||
| 1 |
|
||||
| 2 |
|
||||
| 3 |`,
|
||||
LOG_LEVELS.info,
|
||||
]);
|
||||
});
|
||||
|
||||
it('should print an indices table for a dictionary of empty objects', () => {
|
||||
console.table({
|
||||
first: {},
|
||||
second: {},
|
||||
third: {},
|
||||
fourth: {},
|
||||
});
|
||||
|
||||
expect(logFn).toHaveBeenCalledTimes(1);
|
||||
expect(logFn.mock.lastCall).toEqual([
|
||||
`
|
||||
| (index) |
|
||||
| ------- |
|
||||
| first |
|
||||
| second |
|
||||
| third |
|
||||
| fourth |`,
|
||||
LOG_LEVELS.info,
|
||||
]);
|
||||
});
|
||||
|
||||
it('should not modify the logged value', () => {
|
||||
global.nativeLoggingHook = jest.fn();
|
||||
|
||||
const array = [
|
||||
{name: 'First', value: 500},
|
||||
{name: 'Second', value: 600},
|
||||
{name: 'Third', value: 700},
|
||||
{name: 'Fourth', value: 800, extraValue: true},
|
||||
];
|
||||
const originalArrayValue = JSON.parse(JSON.stringify(array));
|
||||
|
||||
console.table(array);
|
||||
|
||||
expect(array).toEqual(originalArrayValue);
|
||||
|
||||
const object = {
|
||||
first: {name: 'First', value: 500},
|
||||
second: {name: 'Second', value: 600},
|
||||
third: {name: 'Third', value: 700},
|
||||
fourth: {name: 'Fourth', value: 800, extraValue: true},
|
||||
};
|
||||
|
||||
const originalObjectValue = JSON.parse(JSON.stringify(object));
|
||||
|
||||
console.table(object);
|
||||
|
||||
expect(object).toEqual(originalObjectValue);
|
||||
});
|
||||
|
||||
it('should only print the selected columns, if specified (arrays)', () => {
|
||||
console.table(
|
||||
[
|
||||
{first: 1, second: 2, third: 3},
|
||||
{first: 4, second: 5},
|
||||
{third: 7, fourth: 8},
|
||||
{fifth: 9},
|
||||
],
|
||||
// $FlowExpectedError[extra-arg]
|
||||
['first', 'fifth'],
|
||||
);
|
||||
expect(logFn).toHaveBeenCalledTimes(1);
|
||||
expect(logFn.mock.lastCall).toEqual([
|
||||
`
|
||||
| (index) | first | fifth |
|
||||
| ------- | ----- | ----- |
|
||||
| 0 | 1 | |
|
||||
| 1 | 4 | |
|
||||
| 2 | | |
|
||||
| 3 | | 9 |`,
|
||||
LOG_LEVELS.info,
|
||||
]);
|
||||
});
|
||||
|
||||
it('should only print the selected columns, if specified (dictionaries)', () => {
|
||||
console.table(
|
||||
{
|
||||
a: {first: 1, second: 2, third: 3},
|
||||
b: {first: 4, second: 5},
|
||||
c: {third: 7, fourth: 8},
|
||||
d: {fifth: 9},
|
||||
},
|
||||
// $FlowExpectedError[extra-arg]
|
||||
['first', 'fifth'],
|
||||
);
|
||||
expect(logFn).toHaveBeenCalledTimes(1);
|
||||
expect(logFn.mock.lastCall).toEqual([
|
||||
`
|
||||
| (index) | first | fifth |
|
||||
| ------- | ----- | ----- |
|
||||
| a | 1 | |
|
||||
| b | 4 | |
|
||||
| c | | |
|
||||
| d | | 9 |`,
|
||||
LOG_LEVELS.info,
|
||||
]);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1,275 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow strict-local
|
||||
* @format
|
||||
*/
|
||||
|
||||
const LOG_LEVELS = {
|
||||
trace: 0,
|
||||
info: 1,
|
||||
warn: 2,
|
||||
error: 3,
|
||||
};
|
||||
|
||||
describe('console.table(data, rows)', () => {
|
||||
let originalNativeLoggingHook;
|
||||
let logFn;
|
||||
|
||||
beforeEach(() => {
|
||||
originalNativeLoggingHook = global.nativeLoggingHook;
|
||||
logFn = global.nativeLoggingHook = jest.fn();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
global.nativeLoggingHook = originalNativeLoggingHook;
|
||||
});
|
||||
|
||||
it('should print the passed array as a Markdown table', () => {
|
||||
console.table([
|
||||
{name: 'First', value: 500},
|
||||
{name: 'Second', value: 600},
|
||||
{name: 'Third', value: 700},
|
||||
{name: 'Fourth', value: 800, extraValue: true},
|
||||
]);
|
||||
|
||||
expect(logFn).toHaveBeenCalledTimes(1);
|
||||
expect(logFn.mock.lastCall).toEqual([
|
||||
`
|
||||
| (index) | name | value | extraValue |
|
||||
| ------- | -------- | ----- | ---------- |
|
||||
| 0 | 'First' | 500 | |
|
||||
| 1 | 'Second' | 600 | |
|
||||
| 2 | 'Third' | 700 | |
|
||||
| 3 | 'Fourth' | 800 | true |`,
|
||||
LOG_LEVELS.info,
|
||||
]);
|
||||
});
|
||||
|
||||
it('should print the passed dictionary as a Markdown table', () => {
|
||||
console.table({
|
||||
first: {name: 'First', value: 500},
|
||||
second: {name: 'Second', value: 600},
|
||||
third: {name: 'Third', value: 700},
|
||||
fourth: {name: 'Fourth', value: 800, extraValue: true},
|
||||
});
|
||||
|
||||
expect(logFn).toHaveBeenCalledTimes(1);
|
||||
expect(logFn.mock.lastCall).toEqual([
|
||||
`
|
||||
| (index) | name | value | extraValue |
|
||||
| ------- | -------- | ----- | ---------- |
|
||||
| first | 'First' | 500 | |
|
||||
| second | 'Second' | 600 | |
|
||||
| third | 'Third' | 700 | |
|
||||
| fourth | 'Fourth' | 800 | true |`,
|
||||
LOG_LEVELS.info,
|
||||
]);
|
||||
});
|
||||
|
||||
it('should work with different types of values', () => {
|
||||
console.table([
|
||||
{
|
||||
string: '',
|
||||
number: 0,
|
||||
boolean: true,
|
||||
function: () => {},
|
||||
object: {a: 1, b: 2},
|
||||
null: null,
|
||||
undefined: undefined,
|
||||
},
|
||||
{
|
||||
string: 'a',
|
||||
number: 1,
|
||||
boolean: true,
|
||||
function: () => {},
|
||||
object: {a: 1, b: 2},
|
||||
null: null,
|
||||
undefined: undefined,
|
||||
},
|
||||
{
|
||||
string: 'aa',
|
||||
number: 2,
|
||||
boolean: false,
|
||||
function: () => {},
|
||||
object: {a: 1, b: 2},
|
||||
null: null,
|
||||
undefined: undefined,
|
||||
},
|
||||
{
|
||||
string: 'aaa',
|
||||
number: 3,
|
||||
boolean: false,
|
||||
function: () => {},
|
||||
object: {a: 1, b: 2},
|
||||
null: null,
|
||||
undefined: undefined,
|
||||
},
|
||||
]);
|
||||
|
||||
expect(logFn).toHaveBeenCalledTimes(1);
|
||||
expect(logFn.mock.lastCall).toEqual([
|
||||
`
|
||||
| (index) | string | number | boolean | function | object | null | undefined |
|
||||
| ------- | ------ | ------ | ------- | -------- | ------ | ---- | --------- |
|
||||
| 0 | '' | 0 | true | ƒ | {…} | null | undefined |
|
||||
| 1 | 'a' | 1 | true | ƒ | {…} | null | undefined |
|
||||
| 2 | 'aa' | 2 | false | ƒ | {…} | null | undefined |
|
||||
| 3 | 'aaa' | 3 | false | ƒ | {…} | null | undefined |`,
|
||||
LOG_LEVELS.info,
|
||||
]);
|
||||
});
|
||||
|
||||
it('should print the keys in all the objects', () => {
|
||||
console.table([
|
||||
{name: 'foo'},
|
||||
{name: 'bar', value: 1},
|
||||
{value: 2, surname: 'baz'},
|
||||
{address: 'other'},
|
||||
]);
|
||||
|
||||
expect(logFn).toHaveBeenCalledTimes(1);
|
||||
expect(logFn.mock.lastCall).toEqual([
|
||||
`
|
||||
| (index) | name | value | surname | address |
|
||||
| ------- | ----- | ----- | ------- | ------- |
|
||||
| 0 | 'foo' | | | |
|
||||
| 1 | 'bar' | 1 | | |
|
||||
| 2 | | 2 | 'baz' | |
|
||||
| 3 | | | | 'other' |`,
|
||||
LOG_LEVELS.info,
|
||||
]);
|
||||
});
|
||||
|
||||
it('should print an empty string for empty arrays', () => {
|
||||
console.table([]);
|
||||
|
||||
expect(logFn).toHaveBeenCalledTimes(1);
|
||||
expect(logFn.mock.lastCall).toEqual([``, LOG_LEVELS.info]);
|
||||
});
|
||||
|
||||
it('should print an empty string for empty dictionaries', () => {
|
||||
console.table({});
|
||||
|
||||
expect(logFn).toHaveBeenCalledTimes(1);
|
||||
expect(logFn.mock.lastCall).toEqual([``, LOG_LEVELS.info]);
|
||||
});
|
||||
|
||||
// This test is currently failing
|
||||
it('should print an indices table for an array of empty objects', () => {
|
||||
console.table([{}, {}, {}, {}]);
|
||||
|
||||
expect(logFn).toHaveBeenCalledTimes(1);
|
||||
expect(logFn.mock.lastCall).toEqual([
|
||||
`
|
||||
| (index) |
|
||||
| ------- |
|
||||
| 0 |
|
||||
| 1 |
|
||||
| 2 |
|
||||
| 3 |`,
|
||||
LOG_LEVELS.info,
|
||||
]);
|
||||
});
|
||||
|
||||
it('should print an indices table for a dictionary of empty objects', () => {
|
||||
console.table({
|
||||
first: {},
|
||||
second: {},
|
||||
third: {},
|
||||
fourth: {},
|
||||
});
|
||||
|
||||
expect(logFn).toHaveBeenCalledTimes(1);
|
||||
expect(logFn.mock.lastCall).toEqual([
|
||||
`
|
||||
| (index) |
|
||||
| ------- |
|
||||
| first |
|
||||
| second |
|
||||
| third |
|
||||
| fourth |`,
|
||||
LOG_LEVELS.info,
|
||||
]);
|
||||
});
|
||||
|
||||
it('should not modify the logged value', () => {
|
||||
global.nativeLoggingHook = jest.fn();
|
||||
|
||||
const array = [
|
||||
{name: 'First', value: 500},
|
||||
{name: 'Second', value: 600},
|
||||
{name: 'Third', value: 700},
|
||||
{name: 'Fourth', value: 800, extraValue: true},
|
||||
];
|
||||
const originalArrayValue = JSON.parse(JSON.stringify(array));
|
||||
|
||||
console.table(array);
|
||||
|
||||
expect(array).toEqual(originalArrayValue);
|
||||
|
||||
const object = {
|
||||
first: {name: 'First', value: 500},
|
||||
second: {name: 'Second', value: 600},
|
||||
third: {name: 'Third', value: 700},
|
||||
fourth: {name: 'Fourth', value: 800, extraValue: true},
|
||||
};
|
||||
|
||||
const originalObjectValue = JSON.parse(JSON.stringify(object));
|
||||
|
||||
console.table(object);
|
||||
|
||||
expect(object).toEqual(originalObjectValue);
|
||||
});
|
||||
|
||||
it('should only print the selected columns, if specified (arrays)', () => {
|
||||
console.table(
|
||||
[
|
||||
{first: 1, second: 2, third: 3},
|
||||
{first: 4, second: 5},
|
||||
{third: 7, fourth: 8},
|
||||
{fifth: 9},
|
||||
],
|
||||
// $FlowExpectedError[extra-arg]
|
||||
['first', 'fifth'],
|
||||
);
|
||||
expect(logFn).toHaveBeenCalledTimes(1);
|
||||
expect(logFn.mock.lastCall).toEqual([
|
||||
`
|
||||
| (index) | first | fifth |
|
||||
| ------- | ----- | ----- |
|
||||
| 0 | 1 | |
|
||||
| 1 | 4 | |
|
||||
| 2 | | |
|
||||
| 3 | | 9 |`,
|
||||
LOG_LEVELS.info,
|
||||
]);
|
||||
});
|
||||
|
||||
it('should only print the selected columns, if specified (dictionaries)', () => {
|
||||
console.table(
|
||||
{
|
||||
a: {first: 1, second: 2, third: 3},
|
||||
b: {first: 4, second: 5},
|
||||
c: {third: 7, fourth: 8},
|
||||
d: {fifth: 9},
|
||||
},
|
||||
// $FlowExpectedError[extra-arg]
|
||||
['first', 'fifth'],
|
||||
);
|
||||
expect(logFn).toHaveBeenCalledTimes(1);
|
||||
expect(logFn.mock.lastCall).toEqual([
|
||||
`
|
||||
| (index) | first | fifth |
|
||||
| ------- | ----- | ----- |
|
||||
| a | 1 | |
|
||||
| b | 4 | |
|
||||
| c | | |
|
||||
| d | | 9 |`,
|
||||
LOG_LEVELS.info,
|
||||
]);
|
||||
});
|
||||
});
|
||||
@@ -1,41 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @flow strict-local
|
||||
* @format
|
||||
* @fantom_mode *
|
||||
* @fantom_flags fuseboxEnabledRelease:*
|
||||
*/
|
||||
|
||||
describe('console.timeStamp()', () => {
|
||||
it('installed', () => {
|
||||
expect(typeof console.timeStamp).toBe('function');
|
||||
});
|
||||
|
||||
it("doesn't throw when label is not specified", () => {
|
||||
// $FlowExpectedError[incompatible-call] not passing label intentionally
|
||||
expect(() => console.timeStamp()).not.toThrow();
|
||||
});
|
||||
|
||||
it("doesn't throw when label is specified", () => {
|
||||
expect(() => console.timeStamp('label')).not.toThrow();
|
||||
});
|
||||
|
||||
it("doesn't throw when additional arguments are specified", () => {
|
||||
expect(() =>
|
||||
console.timeStamp('label', 100, 500, 'Track', 'Group', 'error'),
|
||||
).not.toThrow();
|
||||
});
|
||||
|
||||
it("doesn't throw when invalid arguments are specified", () => {
|
||||
// $FlowExpectedError[incompatible-call]
|
||||
expect(() => console.timeStamp({})).not.toThrow();
|
||||
expect(() =>
|
||||
// $FlowExpectedError[incompatible-call]
|
||||
console.timeStamp('label', true, null, {}, [], () => {}),
|
||||
).not.toThrow();
|
||||
});
|
||||
});
|
||||
@@ -569,8 +569,6 @@ function consoleAssertPolyfill(expression, label) {
|
||||
}
|
||||
}
|
||||
|
||||
function stub() {}
|
||||
|
||||
if (global.nativeLoggingHook) {
|
||||
const originalConsole = global.console;
|
||||
// Preserve the original `console` as `originalConsole`
|
||||
@@ -582,11 +580,6 @@ if (global.nativeLoggingHook) {
|
||||
}
|
||||
|
||||
global.console = {
|
||||
time: stub,
|
||||
timeEnd: stub,
|
||||
timeStamp: stub,
|
||||
count: stub,
|
||||
countReset: stub,
|
||||
...(originalConsole ?? {}),
|
||||
error: getNativeLogFunction(LOG_LEVELS.error),
|
||||
info: getNativeLogFunction(LOG_LEVELS.info),
|
||||
@@ -677,6 +670,7 @@ if (global.nativeLoggingHook) {
|
||||
});
|
||||
}
|
||||
} else if (!global.console) {
|
||||
function stub() {}
|
||||
const log = global.print || stub;
|
||||
|
||||
global.console = {
|
||||
@@ -692,8 +686,6 @@ if (global.nativeLoggingHook) {
|
||||
}
|
||||
},
|
||||
clear: stub,
|
||||
count: stub,
|
||||
countReset: stub,
|
||||
dir: stub,
|
||||
dirxml: stub,
|
||||
group: stub,
|
||||
@@ -702,9 +694,6 @@ if (global.nativeLoggingHook) {
|
||||
profile: stub,
|
||||
profileEnd: stub,
|
||||
table: stub,
|
||||
time: stub,
|
||||
timeEnd: stub,
|
||||
timeStamp: stub,
|
||||
};
|
||||
|
||||
Object.defineProperty(console, '_isPolyfilled', {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/js-polyfills",
|
||||
"version": "0.81.0-main",
|
||||
"version": "0.80.0-main",
|
||||
"description": "Polyfills for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -18,7 +18,7 @@
|
||||
],
|
||||
"bugs": "https://github.com/facebook/react-native/issues",
|
||||
"engines": {
|
||||
"node": ">= 20.19.4"
|
||||
"node": ">= 22.14.0"
|
||||
},
|
||||
"files": [
|
||||
"console.js",
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user