Skip to content

Commit 51c9b3d

Browse files
committed
Merge branch 'main' into patch-2
2 parents e1e1e76 + f51335f commit 51c9b3d

File tree

219 files changed

+7173
-2563
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

219 files changed

+7173
-2563
lines changed

.babelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"presets": [
3-
"module:metro-react-native-babel-preset"
3+
"module:@react-native/babel-preset"
44
],
55
"plugins": [
66
"babel-plugin-transform-flow-enums"

.circleci/Dockerfiles/Dockerfile.android

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# and build a Android application that can be used to run the
1515
# tests specified in the scripts/ directory.
1616
#
17-
FROM reactnativecommunity/react-native-android:9.0
17+
FROM reactnativecommunity/react-native-android:v10.0
1818

1919
LABEL Description="React Native Android Test Image"
2020
LABEL maintainer="Meta Open Source <[email protected]>"

.circleci/config.yml

Lines changed: 143 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ version: 2.1
66

77
orbs:
88
win: circleci/[email protected]
9+
android: circleci/[email protected]
910

1011
# -------------------------
1112
# REFERENCES
@@ -113,7 +114,7 @@ executors:
113114
reactnativeandroid:
114115
<<: *defaults
115116
docker:
116-
- image: reactnativecommunity/react-native-android:9.0
117+
- image: reactnativecommunity/react-native-android:v10.0
117118
resource_class: "xlarge"
118119
environment:
119120
- TERM: "dumb"
@@ -259,7 +260,7 @@ commands:
259260
command: cp packages/rn-tester/Podfile.lock packages/rn-tester/Podfile.lock.bak
260261
- restore_cache:
261262
keys:
262-
# The committed lockfile is generated using USE_FRAMEWORKS=0 and USE_HERMES=1 so it could load an outdated cache if a change
263+
# The committed lockfile is generated using static libraries and USE_HERMES=1 so it could load an outdated cache if a change
263264
# only affects the frameworks or hermes config. To help prevent this also cache based on the content of Podfile.
264265
- *pods_cache_key
265266
- steps: << parameters.steps >>
@@ -724,6 +725,136 @@ jobs:
724725
path: ./reports/junit
725726

726727
# -------------------------
728+
# JOBS: iOS E2E Tests
729+
# -------------------------
730+
test_e2e_ios:
731+
executor: reactnativeios
732+
parameters:
733+
ruby_version:
734+
default: "2.7.7"
735+
description: The version of ruby that must be used
736+
type: string
737+
steps:
738+
- checkout_code_with_cache
739+
- run_yarn
740+
- attach_workspace:
741+
at: .
742+
- run:
743+
name: Install appium
744+
command: npm install [email protected] -g
745+
- run:
746+
name: Install appium drivers
747+
command: |
748+
appium driver install uiautomator2
749+
appium driver install xcuitest
750+
- run:
751+
name: Start Appium server
752+
command: appium --base-path /wd/hub
753+
background: true
754+
- run:
755+
name: Start Metro
756+
command: |
757+
cd packages/rn-tester
758+
yarn start
759+
background: true
760+
- brew_install:
761+
package: cmake
762+
- setup_ruby:
763+
ruby_version: << parameters.ruby_version >>
764+
- run:
765+
name: Install Bundler
766+
command: |
767+
cd packages/rn-tester
768+
bundle check || bundle install
769+
bundle exec pod setup
770+
bundle exec pod install --verbose
771+
- run:
772+
name: Boot iOS Simulator
773+
command: source scripts/.tests.env && xcrun simctl boot "$IOS_DEVICE" || true
774+
- run:
775+
name: Build app
776+
command: |
777+
xcodebuild build \
778+
-workspace packages/rn-tester/RNTesterPods.xcworkspace \
779+
-configuration Debug \
780+
-scheme RNTester \
781+
-sdk iphonesimulator \
782+
-derivedDataPath /tmp/e2e/
783+
- run:
784+
name: Move app to correct directory
785+
command: mv /tmp/e2e/Build/Products/Debug-iphonesimulator/RNTester.app packages/rn-tester-e2e/apps/rn-tester.app
786+
- run:
787+
name: Check Appium server status
788+
command: |
789+
if ! nc -z 127.0.0.1 4723; then
790+
echo Could not find Appium server!
791+
exit 1
792+
fi
793+
- run:
794+
name: Run E2E tests
795+
command: |
796+
cd packages/rn-tester-e2e
797+
yarn test-ios-e2e
798+
799+
# -------------------------
800+
# JOBS: Android E2E Tests
801+
# -------------------------
802+
test_e2e_android:
803+
executor:
804+
name: android/android-machine
805+
tag: 2023.07.1
806+
steps:
807+
- checkout_code_with_cache
808+
- run_yarn
809+
- android/create-avd:
810+
avd-name: e2e_emulator
811+
system-image: system-images;android-33;google_apis;x86_64
812+
install: true
813+
- android/start-emulator:
814+
avd-name: e2e_emulator
815+
no-window: true
816+
restore-gradle-cache-prefix: v1a
817+
post-emulator-launch-assemble-command: ""
818+
- run:
819+
name: Install appium
820+
command: npm install [email protected] -g
821+
- run:
822+
name: Install appium drivers
823+
command: |
824+
appium driver install uiautomator2
825+
appium driver install xcuitest
826+
- run:
827+
name: Start Appium server
828+
command: appium --base-path /wd/hub
829+
background: true
830+
- run:
831+
name: Start Metro
832+
command: |
833+
cd packages/rn-tester
834+
yarn start
835+
background: true
836+
- attach_workspace:
837+
at: .
838+
- run:
839+
name: Build app
840+
command: |
841+
./gradlew :packages:rn-tester:android:app:assembleHermesDebug -PreactNativeArchitectures=x86_64
842+
- run:
843+
name: Move app to correct directory
844+
command: mv packages/rn-tester/android/app/build/outputs/apk/hermes/debug/app-hermes-x86_64-debug.apk packages/rn-tester-e2e/apps/rn-tester.apk
845+
- run:
846+
name: Check Appium server status
847+
command: |
848+
if ! nc -z 127.0.0.1 4723; then
849+
echo Could not find Appium server
850+
exit 1
851+
fi
852+
- run:
853+
name: Run E2E tests
854+
command: |
855+
cd packages/rn-tester-e2e
856+
yarn test-android-e2e
857+
# -------------------------
727858
# JOBS: Test Android
728859
# -------------------------
729860
test_android:
@@ -847,7 +978,7 @@ jobs:
847978
default: "StaticLibraries"
848979
description: Which kind of option we want to use for `use_frameworks!`
849980
type: enum
850-
enum: ["StaticLibraries", "StaticFrameworks", "DynamicFrameworks"]
981+
enum: ["StaticLibraries", "DynamicFrameworks"]
851982
ruby_version:
852983
default: "2.6.10"
853984
description: The version of ruby that must be used
@@ -898,9 +1029,7 @@ jobs:
8981029
export NO_FLIPPER=1
8991030
fi
9001031
901-
if [[ << parameters.use_frameworks >> == "StaticFrameworks" ]]; then
902-
export USE_FRAMEWORKS=static
903-
elif [[ << parameters.use_frameworks >> == "DynamicFrameworks" ]]; then
1032+
if [[ << parameters.use_frameworks >> == "DynamicFrameworks" ]]; then
9041033
export USE_FRAMEWORKS=dynamic
9051034
fi
9061035
@@ -960,9 +1089,9 @@ jobs:
9601089
enum: ["NewArch", "OldArch"]
9611090
use_frameworks:
9621091
default: "StaticLibraries"
963-
description: The dependency building and linking strategy to use. Must be one of "StaticLibraries", "StaticFrameworks", "DynamicFrameworks"
1092+
description: The dependency building and linking strategy to use. Must be one of "StaticLibraries", "DynamicFrameworks"
9641093
type: enum
965-
enum: ["StaticLibraries", "StaticFrameworks", "DynamicFrameworks"]
1094+
enum: ["StaticLibraries", "DynamicFrameworks"]
9661095
ruby_version:
9671096
default: "2.6.10"
9681097
description: The version of ruby that must be used
@@ -997,11 +1126,6 @@ jobs:
9971126
export USE_HERMES=0
9981127
fi
9991128
1000-
if [[ << parameters.use_frameworks >> == "StaticFrameworks" ]]; then
1001-
export NO_FLIPPER=1
1002-
export USE_FRAMEWORKS=static
1003-
fi
1004-
10051129
if [[ << parameters.use_frameworks >> == "DynamicFrameworks" ]]; then
10061130
export NO_FLIPPER=1
10071131
export USE_FRAMEWORKS=dynamic
@@ -1034,7 +1158,7 @@ jobs:
10341158
- ANDROID_HOME: "C:\\Android\\android-sdk"
10351159
- ANDROID_NDK: "C:\\Android\\android-sdk\\ndk\\20.1.5948944"
10361160
- ANDROID_BUILD_VERSION: 33
1037-
- ANDROID_TOOLS_VERSION: 33.0.0
1161+
- ANDROID_TOOLS_VERSION: 33.0.1
10381162
- GRADLE_OPTS: -Dorg.gradle.daemon=false
10391163
- CHOCO_CACHE_DIR: "C:\\ChocoCache"
10401164
steps:
@@ -1653,6 +1777,9 @@ workflows:
16531777
run_disabled_tests: false
16541778
- test_android
16551779
- test_android_docker_image
1780+
- test_e2e_ios:
1781+
ruby_version: "2.7.7"
1782+
- test_e2e_android
16561783
- test_android_template:
16571784
requires:
16581785
- build_npm_package
@@ -1661,13 +1788,6 @@ workflows:
16611788
architecture: ["NewArch", "OldArch"]
16621789
jsengine: ["Hermes", "JSC"]
16631790
flavor: ["Debug", "Release"]
1664-
- test_ios_template:
1665-
requires:
1666-
- build_npm_package
1667-
name: "Test Template with Ruby 2.7.7"
1668-
ruby_version: "2.7.7"
1669-
architecture: "NewArch"
1670-
flavor: "Debug"
16711791
- test_ios_template:
16721792
requires:
16731793
- build_npm_package
@@ -1684,18 +1804,13 @@ workflows:
16841804
flavor: ["Debug", "Release"]
16851805
jsengine: ["Hermes", "JSC"]
16861806
flipper: ["WithFlipper", "WithoutFlipper"]
1687-
use_frameworks: ["StaticLibraries", "StaticFrameworks", "DynamicFrameworks"]
1807+
use_frameworks: ["StaticLibraries", "DynamicFrameworks"]
16881808
exclude:
16891809
- architecture: "NewArch"
16901810
flavor: "Release"
16911811
jsengine: "Hermes"
16921812
flipper: "WithFlipper"
16931813
use_frameworks: "StaticLibraries"
1694-
- architecture: "NewArch"
1695-
flavor: "Release"
1696-
jsengine: "Hermes"
1697-
flipper: "WithFlipper"
1698-
use_frameworks: "StaticFrameworks"
16991814
- architecture: "NewArch"
17001815
flavor: "Release"
17011816
jsengine: "Hermes"
@@ -1706,11 +1821,6 @@ workflows:
17061821
jsengine: "JSC"
17071822
flipper: "WithFlipper"
17081823
use_frameworks: "StaticLibraries"
1709-
- architecture: "NewArch"
1710-
flavor: "Release"
1711-
jsengine: "JSC"
1712-
flipper: "WithFlipper"
1713-
use_frameworks: "StaticFrameworks"
17141824
- architecture: "NewArch"
17151825
flavor: "Release"
17161826
jsengine: "JSC"
@@ -1721,11 +1831,6 @@ workflows:
17211831
jsengine: "Hermes"
17221832
flipper: "WithFlipper"
17231833
use_frameworks: "StaticLibraries"
1724-
- architecture: "OldArch"
1725-
flavor: "Release"
1726-
jsengine: "Hermes"
1727-
flipper: "WithFlipper"
1728-
use_frameworks: "StaticFrameworks"
17291834
- architecture: "OldArch"
17301835
flavor: "Release"
17311836
jsengine: "Hermes"
@@ -1736,36 +1841,11 @@ workflows:
17361841
jsengine: "JSC"
17371842
flipper: "WithFlipper"
17381843
use_frameworks: "StaticLibraries"
1739-
- architecture: "OldArch"
1740-
flavor: "Release"
1741-
jsengine: "JSC"
1742-
flipper: "WithFlipper"
1743-
use_frameworks: "StaticFrameworks"
17441844
- architecture: "OldArch"
17451845
flavor: "Release"
17461846
jsengine: "JSC"
17471847
flipper: "WithFlipper"
17481848
use_frameworks: "DynamicFrameworks"
1749-
- architecture: "NewArch"
1750-
flavor: "Debug"
1751-
jsengine: "Hermes"
1752-
flipper: "WithFlipper"
1753-
use_frameworks: "StaticFrameworks"
1754-
- architecture: "NewArch"
1755-
flavor: "Debug"
1756-
jsengine: "JSC"
1757-
flipper: "WithFlipper"
1758-
use_frameworks: "StaticFrameworks"
1759-
- architecture: "OldArch"
1760-
flavor: "Debug"
1761-
jsengine: "Hermes"
1762-
flipper: "WithFlipper"
1763-
use_frameworks: "StaticFrameworks"
1764-
- architecture: "OldArch"
1765-
flavor: "Debug"
1766-
jsengine: "JSC"
1767-
flipper: "WithFlipper"
1768-
use_frameworks: "StaticFrameworks"
17691849
- architecture: "NewArch"
17701850
flavor: "Debug"
17711851
jsengine: "Hermes"
@@ -1786,12 +1866,6 @@ workflows:
17861866
jsengine: "JSC"
17871867
flipper: "WithFlipper"
17881868
use_frameworks: "DynamicFrameworks"
1789-
- test_ios_rntester:
1790-
requires:
1791-
- build_hermes_macos
1792-
name: "Test RNTester with Ruby 2.7.7"
1793-
ruby_version: "2.7.7"
1794-
architecture: "NewArch"
17951869
- test_ios_rntester:
17961870
requires:
17971871
- build_hermes_macos
@@ -1805,13 +1879,7 @@ workflows:
18051879
parameters:
18061880
architecture: ["NewArch", "OldArch"]
18071881
jsengine: ["Hermes", "JSC"]
1808-
use_frameworks: ["StaticLibraries", "StaticFrameworks", "DynamicFrameworks"]
1809-
- test_ios:
1810-
name: "Test iOS with Ruby 2.7.7"
1811-
run_unit_tests: true
1812-
requires:
1813-
- build_hermes_macos
1814-
ruby_version: "2.7.7"
1882+
use_frameworks: ["StaticLibraries", "DynamicFrameworks"]
18151883
- test_ios:
18161884
name: "Test iOS with Ruby 3.2.0"
18171885
run_unit_tests: true

.flowconfig

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,8 @@ packages/react-native/interface.js
3030
packages/react-native/flow/
3131

3232
[options]
33+
experimental.global_find_ref=true
3334
enums=true
34-
conditional_type=true
35-
mapped_type=true
36-
type_guards=true
3735

3836
emoji=true
3937

@@ -78,4 +76,4 @@ untyped-import
7876
untyped-type-import
7977

8078
[version]
81-
^0.212.0
79+
^0.213.1

0 commit comments

Comments
 (0)