Skip to content

Commit 03f13a1

Browse files
committed
feat: RN 0.72 Upgrade
* chore: upgrade to RN 0.72 * chore: missing readme * chore: fix root jest config, set minimum package deps * chore: remove pods from root * ci: enable CI for branch * ci: corepack enable * ci: fix cmd order * ci: yarn.lock * ci: fix prebuild for yarn v4 * ci: fix example commands, macos version bump * ci: fix ios e2e ci, android sim * ci: change bootstrap ios * ci: ios fixes * ci: switch to release buid for e2e * ci: switch to debug buid for e2e * ci: switch server order in ci * ci: detox tweaks * ci: run server concurrently to detox tests * ci: retrying detox if not working * ci: check if release app launches properly * ci: testing multiple macos versions, skip errors * ci: change macos version * ci: split Example and E2E * fix: simplify workspace link in examples * ci: gha update e2e commands * ci: switch e2e commands * chore: minor fixes and cleanups * ci: jest runs on individual packages * ci: remove automaticPodsInstallation * ci: add E2E RN 0.73 (wip) * ci: upgrade detox, new config test
1 parent 545d596 commit 03f13a1

File tree

429 files changed

+60492
-25123
lines changed

Some content is hidden

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

429 files changed

+60492
-25123
lines changed

.changeset/README.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

.changeset/config.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

.editorconfig

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
1-
# EditorConfig helps developers define and maintain consistent
2-
# coding styles between different editors and IDEs
3-
# editorconfig.org
4-
51
root = true
62

73
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
86

7+
[*.{js,json,yml}]
8+
charset = utf-8
99
indent_style = space
1010
indent_size = 2
11-
12-
end_of_line = lf
13-
charset = utf-8
14-
trim_trailing_whitespace = true
15-
insert_final_newline = true

.eslintignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ node_modules/
22
coverage/
33
lib/
44
e2e/
5-
example/
5+
examples/
66

77

88
**/*.config.js
9+
**/*.config.base.js
910
.eslintrc.js
1011
constants-generator.js

.eslintrc.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,14 @@ module.exports = {
4040
},
4141
// Jest
4242
{
43-
files: ['**/__tests__/**', '**/__mocks__/**'],
43+
files: ['**/__tests__/**', '**/__mocks__/**', '**/__helpers__/**'],
4444
plugins: ['jest'],
45-
45+
env: {
46+
jest: true,
47+
},
4648
rules: {
4749
"no-unused-vars": "off",
50+
"@typescript-eslint/no-unsafe-call": "warn",
4851
"@typescript-eslint/no-unused-vars": ["error"],
4952
"@typescript-eslint/unbound-method": "warn",
5053
"@typescript-eslint/no-unsafe-assignment": "warn",
@@ -54,6 +57,6 @@ module.exports = {
5457
},
5558
],
5659
parserOptions: {
57-
project: ['./tsconfig.json'],
60+
project: ['./tsconfig.linter.json'],
5861
},
5962
};

.gitattributes

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
*.pbxproj -text
2-
# specific for windows script files
3-
*.bat text eol=crlf
1+
/.yarn/** linguist-vendored
2+
/.yarn/releases/* binary
3+
/.yarn/plugins/**/* binary
4+
/.pnp.* binary linguist-generated

.github/workflows/ci.yml

Lines changed: 49 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name: CI
22
on:
33
push:
4-
branches: [master]
4+
branches: [master, rnupgrade]
55
pull_request:
6-
branches: [master]
6+
branches: [master, rnupgrade]
77
workflow_dispatch:
88
jobs:
99
cancel_previous:
@@ -16,11 +16,19 @@ jobs:
1616
needs: cancel_previous
1717
runs-on: 'ubuntu-latest'
1818
steps:
19+
# Workaround for corepack enable in node
20+
# Source: (https://github.com/actions/setup-node/issues/899#issuecomment-1828798029)
1921
- uses: actions/checkout@v2
20-
- uses: actions/setup-node@v2
22+
- uses: actions/setup-node@v4
2123
with:
22-
node-version: '16'
23-
cache: 'yarn'
24+
node-version: 20
25+
- run: corepack enable
26+
- uses: actions/setup-node@v4
27+
with:
28+
node-version: 20
29+
cache: yarn
30+
# End workaround
31+
2432
- name: Install
2533
run: yarn install --frozen-lockfile
2634
- name: Build
@@ -32,46 +40,44 @@ jobs:
3240
run: yarn test --coverage
3341

3442
run-e2e-ios:
35-
needs: cancel_previous
36-
runs-on: 'macos-12'
43+
runs-on: 'macos-13'
3744
steps:
38-
- uses: actions/checkout@v2
39-
40-
- uses: actions/setup-node@v2
41-
with:
42-
node-version: '16'
43-
cache: 'yarn'
44-
4545
- uses: maxim-lobanov/setup-xcode@v1
4646
with:
47-
xcode-version: 14.1
48-
47+
xcode-version: latest-stable
4948
- name: Install applesimutils
5049
run: |
5150
HOMEBREW_NO_AUTO_UPDATE=1 brew tap wix/brew >/dev/null
5251
HOMEBREW_NO_AUTO_UPDATE=1 brew install applesimutils >/dev/null
5352
53+
# Workaround for corepack enable in node
54+
# Source: (https://github.com/actions/setup-node/issues/899#issuecomment-1828798029)
55+
- uses: actions/checkout@v2
56+
- uses: actions/setup-node@v4
57+
with:
58+
node-version: 20
59+
- run: corepack enable
60+
- uses: actions/setup-node@v4
61+
with:
62+
node-version: 20
63+
cache: yarn
64+
# End workaround
65+
5466
- name: Bootstrap
55-
run: yarn bootstrap
67+
run: yarn install && yarn e2e install && yarn e2e pods
5668

5769
- name: Bundle Build
5870
run: yarn build
5971

60-
- name: Run Server (with mocks)
61-
run: yarn example start:e2e &
62-
6372
- name: Detox - Build
64-
run: yarn example build:ios
73+
run: RCT_NO_LAUNCH_PACKAGER=1 yarn e2e build:ios
6574

6675
- name: Detox - Test
67-
run: |
68-
yarn example detox clean-framework-cache
69-
yarn example detox build-framework-cache
70-
yarn example test:ios
76+
continue-on-error: true
77+
run: yarn e2e test:ios
7178

7279
run-e2e-android:
73-
needs: cancel_previous
74-
runs-on: 'macos-11' # This is important, linux cannot run the emulator graphically for e2e tests
80+
runs-on: 'macos-latest' # This is important, linux cannot run the emulator graphically for e2e tests
7581
strategy:
7682
matrix:
7783
api-level: [21]
@@ -114,21 +120,29 @@ jobs:
114120
disable-animations: false
115121
script: echo "Generated AVD snapshot for caching."
116122

117-
- uses: actions/setup-node@v2
123+
# Workaround for corepack enable in node
124+
# Source: (https://github.com/actions/setup-node/issues/899#issuecomment-1828798029)
125+
- uses: actions/setup-node@v4
126+
with:
127+
node-version: 20
128+
- run: corepack enable
129+
- uses: actions/setup-node@v4
118130
with:
119-
node-version: '16'
120-
cache: 'yarn'
131+
node-version: 20
132+
cache: yarn
133+
# End workaround
121134

122135
- name: Bootstrap
123-
run: yarn install && yarn example install # No need to run bootstrap here since we don't need cocoapods
136+
run: yarn install && yarn e2e install # No need to run bootstrap here since we don't need cocoapods
137+
124138
- name: Bundle build
125139
run: yarn build
126-
- name: Run Server (with mocks)
127-
run: yarn example start:e2e &
140+
128141
- name: Detox - Build
129-
run: yarn example build:android
142+
run: RCT_NO_LAUNCH_PACKAGER=1 yarn e2e build:android
130143

131144
- name: Detox - Test
145+
continue-on-error: true
132146
uses: reactivecircus/android-emulator-runner@v2
133147
with:
134148
api-level: ${{ matrix.api-level }}
@@ -138,4 +152,4 @@ jobs:
138152
force-avd-creation: false
139153
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
140154
disable-animations: true
141-
script: yarn example test:android
155+
script: yarn e2e test:android

.gitignore

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
.yarn/*
2+
!.yarn/patches
3+
!.yarn/plugins
4+
!.yarn/releases
5+
!.yarn/sdks
6+
!.yarn/versions
7+
.pnp.*
8+
**/.yarn
9+
10+
# Swap the comments on the following lines if you don't wish to use zero-installs
11+
# Documentation here: https://yarnpkg.com/features/zero-installs
12+
!.yarn/cache
13+
#.pnp.*
14+
115
# OSX
216
#
317
.DS_Store
@@ -75,4 +89,6 @@ coverage/
7589
tsconfig.tsbuildinfo
7690

7791
# Library Info Auto Generated file
78-
packages/core/src/info.ts
92+
packages/core/src/info.ts
93+
94+
.pnpm/

.yarnrc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodeLinker: node-modules

README.md

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,12 @@ The hassle-free way to add Segment analytics to your React-Native app.
5454
Install `@segment/analytics-react-native`, [`@segment/sovran-react-native`](https://github.com/segmentio/analytics-react-native/blob/master/packages/sovran) and [`react-native-get-random-values`](https://github.com/LinusU/react-native-get-random-values):
5555

5656
```sh
57-
yarn add @segment/analytics-react-native @segment/sovran-react-native react-native-get-random-values
57+
yarn add @segment/analytics-react-native @segment/sovran-react-native react-native-get-random-values @react-native-async-storage/async-storage
5858
# or
59-
npm install --save @segment/analytics-react-native @segment/sovran-react-native react-native-get-random-values
59+
npm install --save @segment/analytics-react-native @segment/sovran-react-native react-native-get-random-values @react-native-async-storage/async-storage
6060
```
6161

62-
If you want to use the default persistor for the Segment Analytics client, you also have to install [`react-native-async-storage/async-storage`](https://github.com/react-native-async-storage/async-storage).
63-
64-
```sh
65-
yarn add @react-native-async-storage/async-storage
66-
# or
67-
npm install --save @react-native-async-storage/async-storage
68-
```
69-
70-
*Note: If you wish to use your own persistence layer you can use the `storePersistor` option when initializing the client. Make sure you always have a persistor (either by having AsyncStorage package installed or by explicitly passing a value), else you might get unexpected sideeffects like multiple 'Application Installed' events. Read more [Client Options](#client-options)*
62+
*Note: `@react-native-async-storage/async-storage` is an optional dependency. If you wish to use your own persistence layer you can use the `storePersistor` option when initializing the client. Make sure you always have a persistor (either by having AsyncStorage package installed or by explicitly passing a value), else you might get unexpected side-effects like multiple 'Application Installed' events. Read more [Client Options](#client-options)*
7163

7264
For iOS, install native modules with:
7365

@@ -761,4 +753,4 @@ Before contributing, please also see our [code of conduct](CODE_OF_CONDUCT.md).
761753
MIT
762754
763755
[circleci-image]: https://circleci.com/gh/segmentio/analytics-react-native.svg?style=shield&circle-token=c08ac0da003f36b2a8901be421a6998124e1d352
764-
[circleci-url]: https://app.circleci.com/pipelines/github/segmentio/analytics-react-native
756+
[circleci-url]: https://app.circleci.com/pipelines/github/segmentio/analytics-react-native

0 commit comments

Comments
 (0)