Skip to content

Commit

Permalink
feat: RN 0.72 Upgrade
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
oscb authored Dec 12, 2023
1 parent 017c5ef commit 3dafa18
Show file tree
Hide file tree
Showing 429 changed files with 60,492 additions and 25,123 deletions.
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

0 comments on commit 3dafa18

Please sign in to comment.