Skip to content

Commit 42a1387

Browse files
authored
Merge up to 0.76-stable branch cut (#2190)
## Summary: Merge up to the `0.76-stable` branch cut. ## Interesting commits: - (Not a specific commit): CSS style box shadows are supported by React Native now! I got them.. mostly working on macOS. There's some matrix flipping / coordinate transforms that need to be done to get them completely correct. - facebook@cdab537 (RCTTextInputView.mm) - Adam touched the same code in #2159. Moving the else of `_selectTextOnFocus` for macOS to the reactFocus method - facebook@84fe531 (RCTRedbox.mm) - Meta’s experimenting with Mac Catalyst, and is ignoring safeArea insets on there because it crashes. While macOS doesn’t have a crash using safeAreaInsets, let’s just follow the pattern and not use them in RCTRedbox too - facebook@7653f76 - Border drawing code has significantly changed in RCTViewComponentView - facebook@8d0cbbf - Publish-npm and it's tested needed to be updated to account for this. - facebook@3572ef3 - A fix for RCTImageView.mm that didn't look like it applied to macOS ## Test Plan Box Shadows work! <img width="908" alt="Screenshot 2024-10-20 at 9 12 42 PM" src="https://github.com/user-attachments/assets/194fd907-c4d0-44fd-aacf-e0cbc5de5fbf"> ... but are different in some areas <img width="902" alt="Screenshot 2024-10-20 at 9 13 16 PM" src="https://github.com/user-attachments/assets/23a9cf8b-4f91-4f0b-bcbc-1b5acee95764"> ## Full merge conflict log ``` [react-native-macos] git merge 143f1ad 0.76-merge Auto-merging .github/workflows/autorebase.yml CONFLICT (content): Merge conflict in .github/workflows/autorebase.yml Auto-merging .gitignore Auto-merging Gemfile.lock Auto-merging jest.config.js Auto-merging package.json CONFLICT (content): Merge conflict in package.json Auto-merging packages/babel-plugin-codegen/package.json CONFLICT (content): Merge conflict in packages/babel-plugin-codegen/package.json Auto-merging packages/community-cli-plugin/package.json Auto-merging packages/core-cli-utils/package.json CONFLICT (content): Merge conflict in packages/core-cli-utils/package.json Auto-merging packages/helloworld/package.json Auto-merging packages/react-native-babel-preset/package.json CONFLICT (content): Merge conflict in packages/react-native-babel-preset/package.json Auto-merging packages/react-native-bots/package.json CONFLICT (content): Merge conflict in packages/react-native-bots/package.json Auto-merging packages/react-native-codegen-typescript-test/package.json CONFLICT (content): Merge conflict in packages/react-native-codegen-typescript-test/package.json Auto-merging packages/react-native-codegen/package.json CONFLICT (content): Merge conflict in packages/react-native-codegen/package.json Auto-merging packages/react-native-test-library/package.json CONFLICT (content): Merge conflict in packages/react-native-test-library/package.json Auto-merging packages/react-native-test-renderer/package.json Auto-merging packages/react-native/Libraries/Alert/Alert.js CONFLICT (modify/delete): packages/react-native/Libraries/Animated/NativeAnimatedHelper.js deleted in 143f1ad and modified in HEAD. Version HEAD of packages/react-native/Libraries/Animated/NativeAnimatedHelper.js left in tree. Auto-merging packages/react-native/Libraries/AppDelegate/RCTAppDelegate.h Auto-merging packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm Auto-merging packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.mm Auto-merging packages/react-native/Libraries/Components/ScrollView/ScrollView.js Auto-merging packages/react-native/Libraries/Components/ScrollView/__tests__/__snapshots__/ScrollView-test.js.snap Auto-merging packages/react-native/Libraries/Components/StatusBar/StatusBar.js Auto-merging packages/react-native/Libraries/Components/TextInput/TextInput.d.ts Auto-merging packages/react-native/Libraries/Components/TextInput/TextInput.js Auto-merging packages/react-native/Libraries/Components/View/ReactNativeViewAttributes.js Auto-merging packages/react-native/Libraries/Components/View/ViewPropTypes.js Auto-merging packages/react-native/Libraries/Image/Image.ios.js Auto-merging packages/react-native/Libraries/Image/RCTImageLoader.mm CONFLICT (content): Merge conflict in packages/react-native/Libraries/Image/RCTImageLoader.mm Auto-merging packages/react-native/Libraries/Image/RCTImageView.mm CONFLICT (content): Merge conflict in packages/react-native/Libraries/Image/RCTImageView.mm Auto-merging packages/react-native/Libraries/Image/RCTResizeMode.h Auto-merging packages/react-native/Libraries/Image/React-RCTImage.podspec CONFLICT (content): Merge conflict in packages/react-native/Libraries/Image/React-RCTImage.podspec Auto-merging packages/react-native/Libraries/Image/__tests__/__snapshots__/Image-test.js.snap Auto-merging packages/react-native/Libraries/Inspector/NetworkOverlay.js Auto-merging packages/react-native/Libraries/LinkingIOS/React-RCTLinking.podspec Auto-merging packages/react-native/Libraries/Lists/FlatList.js Auto-merging packages/react-native/Libraries/Lists/SectionList.js Auto-merging packages/react-native/Libraries/Lists/SectionListModern.js CONFLICT (content): Merge conflict in packages/react-native/Libraries/Lists/SectionListModern.js Auto-merging packages/react-native/Libraries/LogBox/UI/LogBoxInspectorHeader.js Auto-merging packages/react-native/Libraries/Modal/Modal.js Auto-merging packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedModule.mm Auto-merging packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.h Auto-merging packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.mm Auto-merging packages/react-native/Libraries/Network/React-RCTNetwork.podspec Auto-merging packages/react-native/Libraries/StyleSheet/StyleSheetTypes.d.ts Auto-merging packages/react-native/Libraries/StyleSheet/StyleSheetTypes.js Auto-merging packages/react-native/Libraries/Text/BaseText/RCTBaseTextViewManager.mm Auto-merging packages/react-native/Libraries/Text/RCTTextAttributes.h Auto-merging packages/react-native/Libraries/Text/RCTTextAttributes.mm Auto-merging packages/react-native/Libraries/Text/React-RCTText.podspec CONFLICT (content): Merge conflict in packages/react-native/Libraries/Text/React-RCTText.podspec Auto-merging packages/react-native/Libraries/Text/Text/RCTTextShadowView.mm Auto-merging packages/react-native/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.mm Auto-merging packages/react-native/Libraries/Text/TextInput/RCTBaseTextInputView.mm CONFLICT (content): Merge conflict in packages/react-native/Libraries/Text/TextInput/RCTBaseTextInputView.mm Auto-merging packages/react-native/Libraries/Text/TextNativeComponent.js Auto-merging packages/react-native/Libraries/Utilities/Appearance.js CONFLICT (content): Merge conflict in packages/react-native/Libraries/Utilities/Appearance.js Auto-merging packages/react-native/Libraries/Utilities/HMRClient.js Auto-merging packages/react-native/Libraries/Utilities/ReactNativeTestTools.js Auto-merging packages/react-native/Libraries/WebSocket/WebSocket.js Auto-merging packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap CONFLICT (content): Merge conflict in packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap Auto-merging packages/react-native/React/Base/RCTBridge.mm Auto-merging packages/react-native/React/Base/RCTConvert.h CONFLICT (content): Merge conflict in packages/react-native/React/Base/RCTConvert.h Auto-merging packages/react-native/React/Base/RCTConvert.mm CONFLICT (content): Merge conflict in packages/react-native/React/Base/RCTConvert.mm Auto-merging packages/react-native/React/Base/RCTKeyCommands.m CONFLICT (content): Merge conflict in packages/react-native/React/Base/RCTKeyCommands.m Auto-merging packages/react-native/React/CoreModules/RCTAppearance.mm Auto-merging packages/react-native/React/CoreModules/RCTDevLoadingView.mm Auto-merging packages/react-native/React/CoreModules/RCTDevMenu.mm Auto-merging packages/react-native/React/CoreModules/RCTDeviceInfo.mm CONFLICT (content): Merge conflict in packages/react-native/React/CoreModules/RCTDeviceInfo.mm Auto-merging packages/react-native/React/CoreModules/RCTPerfMonitor.mm CONFLICT (content): Merge conflict in packages/react-native/React/CoreModules/RCTPerfMonitor.mm Auto-merging packages/react-native/React/CoreModules/RCTPlatform.mm Auto-merging packages/react-native/React/CoreModules/RCTRedBox.mm CONFLICT (content): Merge conflict in packages/react-native/React/CoreModules/RCTRedBox.mm Auto-merging packages/react-native/React/CoreModules/RCTStatusBarManager.mm Auto-merging packages/react-native/React/CoreModules/React-CoreModules.podspec Auto-merging packages/react-native/React/CxxBridge/RCTCxxBridge.mm Auto-merging packages/react-native/React/DevSupport/RCTInspectorDevServerHelper.mm CONFLICT (content): Merge conflict in packages/react-native/React/DevSupport/RCTInspectorDevServerHelper.mm Auto-merging packages/react-native/React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.mm Auto-merging packages/react-native/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.mm CONFLICT (content): Merge conflict in packages/react-native/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.mm Auto-merging packages/react-native/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.mm Auto-merging packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.h Auto-merging packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm CONFLICT (content): Merge conflict in packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm Auto-merging packages/react-native/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm CONFLICT (content): Merge conflict in packages/react-native/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm Auto-merging packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm Auto-merging packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.mm Auto-merging packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm CONFLICT (content): Merge conflict in packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm Auto-merging packages/react-native/React/Fabric/Mounting/RCTMountingManager.mm Auto-merging packages/react-native/React/Fabric/RCTSurfacePresenter.mm Auto-merging packages/react-native/React/Modules/RCTRedBoxExtraDataViewController.m Auto-merging packages/react-native/React/React-RCTFabric.podspec Auto-merging packages/react-native/React/Views/RCTBorderDrawing.h Auto-merging packages/react-native/React/Views/RCTBorderDrawing.m Auto-merging packages/react-native/React/Views/RCTComponentData.m Auto-merging packages/react-native/React/Views/RCTModalHostView.m Auto-merging packages/react-native/React/Views/RCTModalHostViewController.m CONFLICT (content): Merge conflict in packages/react-native/React/Views/RCTModalHostViewController.m Auto-merging packages/react-native/React/Views/RCTModalHostViewManager.m Auto-merging packages/react-native/React/Views/RCTView.m CONFLICT (content): Merge conflict in packages/react-native/React/Views/RCTView.m Auto-merging packages/react-native/React/Views/RCTViewManager.h Auto-merging packages/react-native/React/Views/RCTViewManager.m Auto-merging packages/react-native/React/Views/RefreshControl/RCTRefreshControl.m Auto-merging packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactTextInputManager.java Auto-merging packages/react-native/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleTurboModule.mm Auto-merging packages/react-native/ReactCommon/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.mm CONFLICT (content): Merge conflict in packages/react-native/ReactCommon/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.mm Auto-merging packages/react-native/ReactCommon/react/renderer/components/view/BaseViewProps.h Auto-merging packages/react-native/ReactCommon/react/renderer/components/view/conversions.h Auto-merging packages/react-native/ReactCommon/react/renderer/components/view/primitives.h Auto-merging packages/react-native/ReactCommon/react/renderer/graphics/React-graphics.podspec Auto-merging packages/react-native/ReactCommon/react/renderer/graphics/platform/ios/react/renderer/graphics/HostPlatformColor.mm Auto-merging packages/react-native/ReactCommon/react/renderer/imagemanager/platform/ios/react/renderer/imagemanager/RCTImagePrimitivesConversions.h Auto-merging packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.h Auto-merging packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.mm Auto-merging packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTFontUtils.mm Auto-merging packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextLayoutManager.mm Auto-merging packages/react-native/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTTextPrimitivesConversions.h Auto-merging packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHermesInstance.h Auto-merging packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.h Auto-merging packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm Auto-merging packages/react-native/index.js Auto-merging packages/react-native/package.json CONFLICT (content): Merge conflict in packages/react-native/package.json Auto-merging packages/react-native/react-native.config.js CONFLICT (content): Merge conflict in packages/react-native/react-native.config.js Auto-merging packages/react-native/scripts/cocoapods/__tests__/codegen_utils-test.rb Auto-merging packages/react-native/scripts/cocoapods/helpers.rb Auto-merging packages/react-native/scripts/cocoapods/utils.rb Auto-merging packages/react-native/scripts/react-native-xcode.sh Auto-merging packages/react-native/scripts/react_native_pods.rb Auto-merging packages/react-native/sdks/hermes-engine/hermes-engine.podspec CONFLICT (modify/delete): packages/react-native/template/package.json deleted in 143f1ad and modified in HEAD. Version HEAD of packages/react-native/template/package.json left in tree. Auto-merging packages/rn-tester/Podfile.lock CONFLICT (content): Merge conflict in packages/rn-tester/Podfile.lock Auto-merging packages/rn-tester/RNTester/AppDelegate.mm Auto-merging packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj CONFLICT (content): Merge conflict in packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj Auto-merging packages/rn-tester/RNTesterUnitTests/RCTAllocationTests.m Auto-merging packages/rn-tester/js/components/RNTPressableRow.js CONFLICT (content): Merge conflict in packages/rn-tester/js/components/RNTPressableRow.js Auto-merging packages/rn-tester/js/components/RNTesterModuleContainer.js Auto-merging packages/rn-tester/js/components/RNTesterModuleList.js CONFLICT (content): Merge conflict in packages/rn-tester/js/components/RNTesterModuleList.js Auto-merging packages/rn-tester/js/examples/Accessibility/AccessibilityExample.js Auto-merging packages/rn-tester/js/examples/Border/BorderExample.js Auto-merging packages/rn-tester/js/examples/Image/ImageExample.js Auto-merging packages/rn-tester/js/examples/Layout/LayoutEventsExample.js Auto-merging packages/rn-tester/js/examples/PlatformColor/PlatformColorExample.js CONFLICT (content): Merge conflict in packages/rn-tester/js/examples/PlatformColor/PlatformColorExample.js Auto-merging packages/rn-tester/js/examples/Pressable/PressableExample.js Auto-merging packages/rn-tester/js/examples/ScrollView/ScrollViewExample.js Auto-merging packages/rn-tester/js/examples/Snapshot/SnapshotExample.js Auto-merging packages/rn-tester/js/examples/Text/TextExample.ios.js Auto-merging packages/rn-tester/js/examples/TextInput/TextInputSharedExamples.js Auto-merging packages/rn-tester/js/examples/Touchable/TouchableExample.js Auto-merging packages/rn-tester/js/types/RNTesterTypes.js Auto-merging packages/rn-tester/js/utils/RNTesterList.ios.js Auto-merging packages/rn-tester/package.json CONFLICT (content): Merge conflict in packages/rn-tester/package.json Auto-merging packages/virtualized-lists/Lists/VirtualizedList.js Auto-merging packages/virtualized-lists/Lists/VirtualizedListCellRenderer.js Auto-merging packages/virtualized-lists/Lists/VirtualizedListProps.js Auto-merging packages/virtualized-lists/package.json CONFLICT (content): Merge conflict in packages/virtualized-lists/package.json Auto-merging scripts/releases-ci/__tests__/publish-npm-test.js CONFLICT (content): Merge conflict in scripts/releases-ci/__tests__/publish-npm-test.js Auto-merging scripts/releases-ci/publish-npm.js CONFLICT (content): Merge conflict in scripts/releases-ci/publish-npm.js Auto-merging scripts/releases/utils/release-utils.js CONFLICT (content): Merge conflict in scripts/releases/utils/release-utils.js Auto-merging yarn.lock CONFLICT (content): Merge conflict in yarn.lock Automatic merge failed; fix conflicts and then commit the result. ```
2 parents cfa611f + 87c5bfe commit 42a1387

File tree

1,665 files changed

+48759
-43366
lines changed

Some content is hidden

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

1,665 files changed

+48759
-43366
lines changed

.ado/apple-pr.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ stages:
2929

3030
- template: /.ado/jobs/npm-publish-dry-run.yml@self
3131

32-
- stage: Integration
33-
dependsOn: []
34-
jobs:
35-
- template: /.ado/jobs/test-react-native-macos-init.yml@self
32+
# - stage: Integration
33+
# dependsOn: []
34+
# jobs:
35+
#- template: /.ado/jobs/test-react-native-macos-init.yml@self
3636

3737
# - template: /.ado/jobs/react-native-test-app-integration.yml@self

.circleci/README.md

Lines changed: 2 additions & 170 deletions
Original file line numberDiff line numberDiff line change
@@ -1,172 +1,4 @@
11
# Circle CI
22

3-
This directory is home to the Circle CI configuration files. Circle is our continuous integration service provider. You can see the overall status of React Native's builds at https://circleci.com/gh/facebook/react-native
4-
5-
You may also see an individual PR's build status by scrolling down to the Checks section in the PR.
6-
7-
## Purposes
8-
9-
We use CircleCI for mainly 3 purposes:
10-
11-
1. Testing changes
12-
2. Release Nightlies
13-
3. Release Stable Versions of React Native
14-
15-
When testing changes, we run all the tests on commits that lands on `main`. For commits in PR, we try to understand which kind of changes the PR is about and we try to selectively run only the relevant tests. so, for example, if a PR only touches iOS files, we are going to run only iOS tests.
16-
17-
A Nighly job runs every day at around 9:00 PM, GMT. They run from `main` and they publish a version of React Native using the current state of the codebase, creating a version number that follows the format: `0.<current-version+1>.0-nightly-<YYYYMMDD>-<short-commit-hash>`.
18-
The nightly job also publish all the monorepo packages, taking care of updating the transitive dependencies of those packages.
19-
20-
Stable versions are released manually by the Release Crew and they run from a stable branch. Stable branches have the shape of `0.<version>-stable`.
21-
22-
## How It Works?
23-
24-
CircleCI execution is now split in two steps:
25-
- Setup
26-
- Testing
27-
28-
The setup step takes care of analyzing the changes in the PR and of deciding which jobs needs to run.
29-
30-
The testing flow is a set of workflows that executes the required tests.
31-
32-
### Setup
33-
34-
The code of the setup workflow lives in the root [`config.yml`](https://github.com/facebook/react-native/blob/main/.circleci/config.yml) file.
35-
It uses the `Continuation orb` from CircleCI to start a CI flow that depends on the changes present in the PR.
36-
37-
If the changes are not coming from a PR (either a simple commit or if the CI is running on main) **we always run all the tests** as a cautionary measure.
38-
39-
The setup job has also to expose all the pipeline parameters that we would need to pass to the actual workflow. Those parameters are **automatically forwarded** to the workflows that are started as a result of the setup.
40-
41-
The setup job uses a JS script to carry on its logic. The [`pipeline_selection.js`](https://github.com/facebook/react-native/blob/main/scripts/circleci/pipeline_selection.js) script can be invoked with two commands:
42-
- `filter-jobs`
43-
- `create-configs`
44-
45-
The **`filter-jobs`** command takes care of creating a JSON representation of the tests we need to run based on the changes in the PR.
46-
47-
The **`create-configs`** command consumes the JSON representation to create a CircleCI configuration that can then executes all the required tests.
48-
49-
#### Creating a Configuration
50-
51-
To create a configuration, the `pipeline-selection` scripts collates together various pieces of `YML` files that lives in the [`Configurations` folder](https://github.com/facebook/react-native/tree/main/.circleci/configurations).
52-
53-
The order in which these files are appended is **important** and it always contains the following.:
54-
55-
1. `top_level.yml`: this file contains some high level directives for CircleCI, like the version, the list of orbs, the cache-keys, and the pipeline parameters that can be used by the workflows.
56-
2. `executors.yml`: this file contains the list of the executors used in our jobs and their configurations.
57-
3. `commands.yml`: this file contains all the commands that can be used by jobs to executes. Commands are reusable functions that are shared by multiple jobs.
58-
4. `jobs.yml`: this file contains the jobs that are used by workflows to carry on some specific tasks. They are composed of sequential commands.
59-
5. `workflows.yml`: this file contains the shared workflows that needs to (or can) be always executed, no matter which kind of changes are pushed to CI. An example of these workflows is `analysis` (which is always executed) or `nightly` (which can be executed if a specific pipeline parameter is passed to the CI).
60-
61-
Then, the `pipeline_selection create-configs` attach some specific test workflows, depending on the changes that are present in the PR. These change-dependent workflows live in the [`test_workflows`](https://github.com/facebook/react-native/tree/main/.circleci/configurations/test_workflows) folder.
62-
These workflows are:
63-
* `testAll.yml` => runs all the possible tests. This workflow is executed on main and on PRs which change set touches both iOS and Android
64-
* `testAndroid.yml` => runs all the build steps and Android tests. This is used on changes that happens on the Android codebase and infra (`ReactAndroid` folder)
65-
* `testIOS.yml` => runs all the build steps and iOS tests. This is used on changes that happens on the iOS codebase and infra (`React` folder)
66-
* `testE2E.yml` => runs the E2E tests. As of today, E2E tests can be triggered if the commit message contains the `#run-e2e-tests` tag.
67-
* `testJS.yml` => For all the changes that do not touch native/platform code, we only run JS tests.
68-
69-
Notice that if there are changes on files that do not represents code (for example `.md` files like this one or the `Changelog`) we don't run any CI.
70-
71-
## Test workflows
72-
73-
The test workflows for native code are composed of 2 parts:
74-
- building React Native
75-
- testing
76-
77-
Building React Native requires us to build several parts of it:
78-
1. We need to build the Hermes JS engine
79-
2. We need to build Android to create prebuilds
80-
3. We need to package everything in an npm package that will mimic a React native release
81-
4. We need to create a local maven repository
82-
83-
### Building Hermes Engine
84-
85-
#### Android
86-
The `build_android` workflows takes care of building the Android version of Hermes and to put it properly in a local maven repository.
87-
See the [Build Android](#build_android) section below.
88-
89-
#### iOS
90-
Hermes is a very complicated item to build for iOS.
91-
It is composed of the Hermes compiler (HermesC) and of the actual engine.
92-
93-
Hermes is shipped as a universal XCFramework. This means that we need to build all the architecture slices and then put them together in the XCFramework archive.
94-
We also need to build 2 configurations: Debug and Release.
95-
96-
In order to be efficient and to save costs, we parallelize the process as much as possible:
97-
98-
1. We prepare the environment for building Hermes.
99-
2. We build HermesC which is required by all the slices.
100-
3. We start 8 jobs to build all the required slices in parallel:
101-
1. `iphone` slice, Debug mode
102-
1. `iphonesimulator` slice, Debug mode
103-
1. `macos` slice, Debug mode
104-
1. `catalyst` slice, Debug mode
105-
1. `iphone` slice, Release mode
106-
1. `iphonesimulator` slice, Release mode
107-
1. `macos` slice, Release mode
108-
1. `catalyst` slice, Release mode
109-
4. We then have 2 jobs to create the Debug and Release tarballs in parallel.
110-
1. The Debug job receives the 4 Debug slices
111-
1. The Release job receives the 4 Release slices
112-
113-
The `Debug` and `Release` tarball are then uploaded as artifacts. Notice that these we use these artifacts to **test the release** of React Native.
114-
115-
While building Hermes, we take also care of building the dSYMs. A dSYM (Debug Symbols) is an archive that contains the Debug Symbols that users can load to de-symbolicate the Hermes Stack traces. These symbols are published when we create a React Native release.
116-
117-
A lot of these build steps are automated by some shell scripts that lives in the [`react-native/packages/react-native/sdks/hermes-engine/utils` folder](https://github.com/facebook/react-native/tree/main/packages/react-native/sdks/hermes-engine/utils).
118-
119-
### Build Android
120-
121-
The android build is all managed by Gradle, so building android should be as easy as calling a [`gradle` command](https://github.com/facebook/react-native/blob/main/.circleci/configurations/jobs.yml#L268-L274).
122-
123-
The relevant part here is that the build android generates a `maven-local` repository that is passed to the [`build_npm_package`](https://github.com/facebook/react-native/blob/main/.circleci/configurations/jobs.yml#L1182) and that we use to test the releases.
124-
125-
### Build NPM package
126-
127-
This job is the responsible to create an NPM package that is suitable to be released or tested in CI.
128-
If we are in a release flow (for example the Nightly workflow), it also proceed with the publication.
129-
130-
The job can be invoked with different parameters:
131-
- `dry-run` => it does not publish anything, but prepare the artifacts to be used for testing
132-
- `nightly` => it creates the artifacts and publish a nightly version of React Native.
133-
- `release` => it creates the artifacts and publish a stable version of React Native.
134-
135-
The build NPM package takes all the artifacts produced in the previous steps (iOS' Hermes, iOS' Hermes dSYMs, Android's `maven-local`) and creates an npm package packing all the code.
136-
137-
If in a release mode, it also proceed publishing the NPM package to NPM, and the artifacts to Maven central, which we use to distribute all the artifacts.
138-
139-
This job also uploads the `maven-local` repository and a zipped version of the npm package to CircleCI's artifacts. We use these artifacts to **test the release** of React Native.
140-
141-
## Testing React Native
142-
React Native tests runs in two different scenarios:
143-
- RNTester
144-
- A New App
145-
146-
### RNTester
147-
RNTester is our internal testing app. It is a fully working React Native app that lives in the [`react-native/packages/rn-tester` folder](https://github.com/facebook/react-native/tree/main/packages/rn-tester) of the repository.
148-
RNTester is an app which contains code that exercise most part of the React Native frameworks.
149-
It also has the feature of building React Native **from source**. For that reason, it does not have to wait for the NPM package to be ready, but RNTester's tests can start as soon as the `build_android` step and the step that builds Hermes for iOS are done.
150-
151-
Notice the Tests on RNTester for iOS consumes the Hermes engine that is built in the previous steps.
152-
153-
For Android, these tests creates an APK that is uploaded as an artifact in CircleCI. We use these artifacts to **test the releases** of React Native..
154-
155-
### A New App
156-
The React Native repo contains a template app in the [`react-native/packages/react-native/template` folder]() that is used to spin up a new application that is preconfigured with React Native.
157-
158-
We have several tests that we run starting from the template, testing various configurations:
159-
- Debug/Release
160-
- JSC/Hermes (two different JS engine we support)
161-
- New/Old Architecture (two different Architectures for React Native)
162-
163-
We want to test all the React Native changes against the template, but we can't publish a React native version on each change that is merged. Therefore, to run tests on the template we use a NPM registry proxy called [Verdaccio](https://verdaccio.org/).
164-
165-
When running a Template test our CI follows roughly these steps:
166-
1. Prepare the executor
167-
2. Start a Verdaccio server
168-
3. Publish on Verdaccio all the monorepo [packages](https://github.com/facebook/react-native/tree/main/packages) on which React Native depends on.
169-
4. Publish on Verdaccio the react-native NPM package that has been created in the NPM step
170-
5. Spin up a new React native apps from the template, downloading react-native from Verdaccio.
171-
172-
In this way, we are sure that we can test all the changes that happen in React Native on a new React Native app.
3+
This directory was home to the Circle CI configuration files.
4+
In July 2024 we moved to GitHub Actions, and week this folder for backward compatibility, as we want to keep on using Circle CI for the release of React Native <= 0.74.

.circleci/config.yml

Lines changed: 7 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -1,114 +1,13 @@
11
version: 2.1
2-
3-
# this allows you to use CircleCI's dynamic configuration feature
4-
setup: true
5-
6-
orbs:
7-
continuation: circleci/[email protected]
8-
9-
parameters:
10-
# Real pipelines parameters
11-
run_release_workflow:
12-
default: false
13-
type: boolean
14-
15-
run_nightly_workflow:
16-
default: false
17-
type: boolean
18-
19-
release_version:
20-
default: ""
21-
type: string
22-
23-
release_monorepo_packages_version:
24-
default: ""
25-
type: string
26-
27-
release_tag:
28-
default: ""
29-
type: string
30-
31-
release_dry_run:
32-
default: false
33-
type: boolean
2+
workflows:
3+
version: 2
4+
stub:
5+
jobs:
6+
- circleci-stub
347

358
jobs:
36-
choose_ci_jobs:
9+
circleci-stub:
3710
docker:
3811
- image: debian:bullseye
39-
resource_class: small
4012
steps:
41-
- run:
42-
name: Install Yarn
43-
command: |
44-
apt update
45-
apt install -y wget git curl jq
46-
47-
apt-get update
48-
apt-get install -y ca-certificates curl gnupg
49-
mkdir -p /etc/apt/keyrings
50-
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
51-
52-
NODE_MAJOR=18
53-
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
54-
apt-get update
55-
56-
apt install -y nodejs
57-
npm install --global yarn
58-
- checkout
59-
- run:
60-
name: Yarn Install
61-
command: yarn install
62-
- when:
63-
condition:
64-
or:
65-
- equal: [ main, << pipeline.git.branch >> ]
66-
- matches:
67-
pattern: /0\.[0-9]+[\.[0-9]+]?-stable/
68-
value: << pipeline.git.branch >>
69-
steps:
70-
- run:
71-
name: "[Main or Stable] Create input for config to test everything"
72-
command: |
73-
mkdir -p /tmp/circleci/
74-
echo '{ "run_all": true }' > /tmp/circleci/pipeline_config.json
75-
- when:
76-
condition:
77-
not:
78-
or:
79-
- equal: [ main, << pipeline.git.branch >> ]
80-
- matches:
81-
pattern: /0\.[0-9]+[\.[0-9]+]?-stable/
82-
value: << pipeline.git.branch >>
83-
steps:
84-
- run:
85-
name: "[PR Branch] Filter jobs"
86-
command: |
87-
if [[ -z "$CIRCLE_PULL_REQUEST" ]]; then
88-
echo "Not in a PR. Can't filter properly outside a PR. Please open a PR so that we can run the proper CI tests."
89-
echo "For safety, we run all the tests!"
90-
mkdir -p /tmp/circleci/
91-
echo '{ "run_all": true }' > /tmp/circleci/pipeline_config.json
92-
else
93-
PR_NUMBER="${CIRCLE_PULL_REQUEST##*/}"
94-
node ./scripts/circleci/pipeline_selection.js filter-jobs
95-
fi
96-
- run:
97-
name: Create config
98-
description: Generates a configuration on the fly, depending on the files that have been modified
99-
command: |
100-
node ./scripts/circleci/pipeline_selection.js create-configs
101-
- store_artifacts:
102-
path: .circleci/generated_config.yml
103-
destination: generated_config.yml
104-
- continuation/continue:
105-
configuration_path: .circleci/generated_config.yml
106-
107-
# our single workflow, that triggers the setup job defined above
108-
workflows:
109-
always-run:
110-
jobs:
111-
- choose_ci_jobs:
112-
filters:
113-
tags:
114-
only: /.*/
13+
- run: echo "There is nothing here, just an empty job. Everything has been moved to GitHub Action"

0 commit comments

Comments
 (0)