Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: RN 0.72 Upgrade #902

Merged
merged 33 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
c0af0fa
chore: upgrade to RN 0.72
oscb Nov 28, 2023
21f3402
chore: missing readme
oscb Nov 28, 2023
a2512a7
chore: fix root jest config, set minimum package deps
oscb Nov 28, 2023
fb4bd0b
chore: remove pods from root
oscb Nov 28, 2023
7481e49
ci: enable CI for branch
oscb Nov 28, 2023
2fad9b2
ci: corepack enable
oscb Nov 28, 2023
4a5902e
ci: fix cmd order
oscb Nov 28, 2023
b26ba18
ci: yarn.lock
oscb Nov 28, 2023
5fcb6f3
ci: fix prebuild for yarn v4
oscb Nov 28, 2023
f423174
ci: fix example commands, macos version bump
oscb Nov 28, 2023
b916d0f
ci: fix ios e2e ci, android sim
oscb Nov 28, 2023
7b868a0
ci: change bootstrap ios
oscb Nov 28, 2023
cc27c10
ci: ios fixes
oscb Nov 29, 2023
d54e0e6
ci: switch to release buid for e2e
oscb Nov 29, 2023
d30a0dc
ci: switch to debug buid for e2e
oscb Nov 29, 2023
d4da6f2
ci: switch server order in ci
oscb Nov 30, 2023
eb41f19
ci: detox tweaks
oscb Nov 30, 2023
d10c8dc
ci: run server concurrently to detox tests
oscb Nov 30, 2023
8781866
ci: retrying detox if not working
oscb Nov 30, 2023
89e74d8
ci: check if release app launches properly
oscb Nov 30, 2023
2a5941f
ci: testing multiple macos versions, skip errors
oscb Dec 4, 2023
9bbb45a
ci: change macos version
oscb Dec 4, 2023
549ecc6
ci: split Example and E2E
oscb Dec 4, 2023
9a1479a
fix: simplify workspace link in examples
oscb Dec 5, 2023
18cd387
ci: gha update e2e commands
oscb Dec 5, 2023
785f6d0
chore: merge master
oscb Dec 5, 2023
b92f265
ci: switch e2e commands
oscb Dec 5, 2023
d9ad83f
chore: minor fixes and cleanups
oscb Dec 7, 2023
d1a746e
ci: jest runs on individual packages
oscb Dec 7, 2023
f91b56d
ci: remove automaticPodsInstallation
oscb Dec 7, 2023
dd257e4
ci: add E2E RN 0.73 (wip)
oscb Dec 7, 2023
0007ab1
ci: upgrade detox, new config test
oscb Dec 12, 2023
753433a
chore: merge branch 'master' into rnupgrade
oscb Dec 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 0 additions & 8 deletions .changeset/README.md

This file was deleted.

10 changes: 0 additions & 10 deletions .changeset/config.json

This file was deleted.

13 changes: 4 additions & 9 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true

[*]
end_of_line = lf
insert_final_newline = true

[*.{js,json,yml}]
charset = utf-8
indent_style = space
indent_size = 2

end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ node_modules/
coverage/
lib/
e2e/
example/
examples/


**/*.config.js
**/*.config.base.js
.eslintrc.js
constants-generator.js
9 changes: 6 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,14 @@ module.exports = {
},
// Jest
{
files: ['**/__tests__/**', '**/__mocks__/**'],
files: ['**/__tests__/**', '**/__mocks__/**', '**/__helpers__/**'],
plugins: ['jest'],

env: {
jest: true,
},
rules: {
"no-unused-vars": "off",
"@typescript-eslint/no-unsafe-call": "warn",
"@typescript-eslint/no-unused-vars": ["error"],
"@typescript-eslint/unbound-method": "warn",
"@typescript-eslint/no-unsafe-assignment": "warn",
Expand All @@ -54,6 +57,6 @@ module.exports = {
},
],
parserOptions: {
project: ['./tsconfig.json'],
project: ['./tsconfig.linter.json'],
},
};
7 changes: 4 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.pbxproj -text
# specific for windows script files
*.bat text eol=crlf
/.yarn/** linguist-vendored
/.yarn/releases/* binary
/.yarn/plugins/**/* binary
/.pnp.* binary linguist-generated
84 changes: 49 additions & 35 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: CI
on:
push:
branches: [master]
branches: [master, rnupgrade]
pull_request:
branches: [master]
branches: [master, rnupgrade]
workflow_dispatch:
jobs:
cancel_previous:
Expand All @@ -16,11 +16,19 @@ jobs:
needs: cancel_previous
runs-on: 'ubuntu-latest'
steps:
# Workaround for corepack enable in node
# Source: (https://github.com/actions/setup-node/issues/899#issuecomment-1828798029)
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/setup-node@v4
with:
node-version: '16'
cache: 'yarn'
node-version: 20
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
# End workaround

- name: Install
run: yarn install --frozen-lockfile
- name: Build
Expand All @@ -32,46 +40,44 @@ jobs:
run: yarn test --coverage

run-e2e-ios:
needs: cancel_previous
runs-on: 'macos-12'
runs-on: 'macos-13'
steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v2
with:
node-version: '16'
cache: 'yarn'

- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 14.1

xcode-version: latest-stable
- name: Install applesimutils
run: |
HOMEBREW_NO_AUTO_UPDATE=1 brew tap wix/brew >/dev/null
HOMEBREW_NO_AUTO_UPDATE=1 brew install applesimutils >/dev/null

# Workaround for corepack enable in node
# Source: (https://github.com/actions/setup-node/issues/899#issuecomment-1828798029)
- uses: actions/checkout@v2
- uses: actions/setup-node@v4
with:
node-version: 20
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
# End workaround

- name: Bootstrap
run: yarn bootstrap
run: yarn install && yarn e2e install && yarn e2e pods

- name: Bundle Build
run: yarn build

- name: Run Server (with mocks)
run: yarn example start:e2e &

- name: Detox - Build
run: yarn example build:ios
run: RCT_NO_LAUNCH_PACKAGER=1 yarn e2e build:ios

- name: Detox - Test
run: |
yarn example detox clean-framework-cache
yarn example detox build-framework-cache
yarn example test:ios
continue-on-error: true
run: yarn e2e test:ios

run-e2e-android:
needs: cancel_previous
runs-on: 'macos-11' # This is important, linux cannot run the emulator graphically for e2e tests
runs-on: 'macos-latest' # This is important, linux cannot run the emulator graphically for e2e tests
strategy:
matrix:
api-level: [21]
Expand Down Expand Up @@ -114,21 +120,29 @@ jobs:
disable-animations: false
script: echo "Generated AVD snapshot for caching."

- uses: actions/setup-node@v2
# Workaround for corepack enable in node
# Source: (https://github.com/actions/setup-node/issues/899#issuecomment-1828798029)
- uses: actions/setup-node@v4
with:
node-version: 20
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: '16'
cache: 'yarn'
node-version: 20
cache: yarn
# End workaround

- name: Bootstrap
run: yarn install && yarn example install # No need to run bootstrap here since we don't need cocoapods
run: yarn install && yarn e2e install # No need to run bootstrap here since we don't need cocoapods

- name: Bundle build
run: yarn build
- name: Run Server (with mocks)
run: yarn example start:e2e &

- name: Detox - Build
run: yarn example build:android
run: RCT_NO_LAUNCH_PACKAGER=1 yarn e2e build:android

- name: Detox - Test
continue-on-error: true
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
Expand All @@ -138,4 +152,4 @@ jobs:
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: yarn example test:android
script: yarn e2e test:android
18 changes: 17 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
.pnp.*
**/.yarn

# Swap the comments on the following lines if you don't wish to use zero-installs
# Documentation here: https://yarnpkg.com/features/zero-installs
!.yarn/cache
#.pnp.*

# OSX
#
.DS_Store
Expand Down Expand Up @@ -75,4 +89,6 @@ coverage/
tsconfig.tsbuildinfo

# Library Info Auto Generated file
packages/core/src/info.ts
packages/core/src/info.ts

.pnpm/
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
16 changes: 4 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,12 @@ The hassle-free way to add Segment analytics to your React-Native app.
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):

```sh
yarn add @segment/analytics-react-native @segment/sovran-react-native react-native-get-random-values
yarn add @segment/analytics-react-native @segment/sovran-react-native react-native-get-random-values @react-native-async-storage/async-storage
# or
npm install --save @segment/analytics-react-native @segment/sovran-react-native react-native-get-random-values
npm install --save @segment/analytics-react-native @segment/sovran-react-native react-native-get-random-values @react-native-async-storage/async-storage
```

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).

```sh
yarn add @react-native-async-storage/async-storage
# or
npm install --save @react-native-async-storage/async-storage
```

*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)*
*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)*

For iOS, install native modules with:

Expand Down Expand Up @@ -761,4 +753,4 @@ Before contributing, please also see our [code of conduct](CODE_OF_CONDUCT.md).
MIT

[circleci-image]: https://circleci.com/gh/segmentio/analytics-react-native.svg?style=shield&circle-token=c08ac0da003f36b2a8901be421a6998124e1d352
[circleci-url]: https://app.circleci.com/pipelines/github/segmentio/analytics-react-native
[circleci-url]: https://app.circleci.com/pipelines/github/segmentio/analytics-react-native
56 changes: 0 additions & 56 deletions example/.detoxrc.json

This file was deleted.

37 changes: 0 additions & 37 deletions example/CONTRIBUTING.md

This file was deleted.

Loading
Loading