diff --git a/.github/workflows/demo.yaml b/.github/workflows/demo.yaml index dececd7a..9359f902 100644 --- a/.github/workflows/demo.yaml +++ b/.github/workflows/demo.yaml @@ -1,5 +1,21 @@ name: Demo CI -on: [ push, pull_request ] +on: + # Pull requests run on pull_request only; push covers master, so a PR isn't checked twice. + push: + branches: [ master ] + paths: [ 'sdk/**', 'demo/**', '.github/workflows/demo.yaml' ] + pull_request: + paths: [ 'sdk/**', 'demo/**', '.github/workflows/demo.yaml' ] + +permissions: + contents: read + +# A new push to a PR cancels its runs for older commits. Each push to master gets its own +# group, so master runs are never cancelled or replaced while pending. +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.sha }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + jobs: demo-android-build: runs-on: ubuntu-latest @@ -25,13 +41,13 @@ jobs: with: node-version: '24' - - name: Build and pack SDK + # The demo uses the SDK from ../sdk, and installing it runs the SDK's build. + - name: Install SDK dependencies working-directory: sdk - run: npm run build_pack_1 + run: npm ci - - name: Install SDK into demo app - working-directory: sdk - run: npm run build_demo_2 + - name: Install demo dependencies + run: npm ci - name: Build Android app run: | @@ -57,13 +73,13 @@ jobs: with: node-version: '24' - - name: Build and pack SDK + # The demo uses the SDK from ../sdk, and installing it runs the SDK's build. + - name: Install SDK dependencies working-directory: sdk - run: npm run build_pack_1 + run: npm ci - - name: Install SDK into demo app - working-directory: sdk - run: npm run build_demo_2 + - name: Install demo dependencies + run: npm ci - name: Install CocoaPods dependencies working-directory: demo/ios diff --git a/.github/workflows/expo-demo.yaml b/.github/workflows/expo-demo.yaml new file mode 100644 index 00000000..56e73f1a --- /dev/null +++ b/.github/workflows/expo-demo.yaml @@ -0,0 +1,90 @@ +name: Expo Demo CI +on: + # Pull requests run on pull_request only; push covers master, so a PR isn't checked twice. + push: + branches: [ master ] + paths: [ 'sdk/**', 'ExpoDemo/**', '.github/workflows/expo-demo.yaml' ] + pull_request: + paths: [ 'sdk/**', 'ExpoDemo/**', '.github/workflows/expo-demo.yaml' ] + +permissions: + contents: read + +# A new push to a PR cancels its runs for older commits. Each push to master gets its own +# group, so master runs are never cancelled or replaced while pending. +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.sha }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +jobs: + expo-demo-android-build: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v7 + + - name: Setup Java + uses: actions/setup-java@v6.0.1 + with: + java-version: 17 + distribution: temurin + cache: gradle + + - name: Setup Node + uses: actions/setup-node@v7 + with: + node-version: '24' + + # ExpoDemo uses the SDK from ../sdk, and installing it runs the SDK's build. + - name: Install SDK dependencies + working-directory: sdk + run: npm ci + + - name: Install ExpoDemo dependencies + working-directory: ExpoDemo + run: npm ci + + - name: Generate the Android project + working-directory: ExpoDemo + run: npx expo prebuild --platform android --no-install + + - name: Build Android app + working-directory: ExpoDemo/android + run: ./gradlew assembleDebug + + expo-demo-ios-build: + runs-on: macos-26 + steps: + - name: Checkout repository + uses: actions/checkout@v7 + + # Expo SDK 56 and later need Xcode 26.4 or later. + - name: Select Xcode + run: | + sudo xcode-select -switch /Applications/Xcode_26.6.app + xcodebuild -version + + - name: Setup Node + uses: actions/setup-node@v7 + with: + node-version: '24' + + # ExpoDemo uses the SDK from ../sdk, and installing it runs the SDK's build. + - name: Install SDK dependencies + working-directory: sdk + run: npm ci + + - name: Install ExpoDemo dependencies + working-directory: ExpoDemo + run: npm ci + + - name: Generate the iOS project and install pods + working-directory: ExpoDemo + run: npx expo prebuild --platform ios + + - name: Build iOS app + working-directory: ExpoDemo/ios + run: > + xcodebuild -workspace ExpoDemo.xcworkspace -scheme ExpoDemo -configuration Debug + -sdk iphonesimulator -destination 'generic/platform=iOS Simulator' + CODE_SIGNING_ALLOWED=NO build diff --git a/.github/workflows/sdk.yaml b/.github/workflows/sdk.yaml index 996a1269..2d061f14 100644 --- a/.github/workflows/sdk.yaml +++ b/.github/workflows/sdk.yaml @@ -1,5 +1,21 @@ name: SDK CI -on: [ push, pull_request ] +on: + # Pull requests run on pull_request only; push covers master, so a PR isn't checked twice. + push: + branches: [ master ] + paths: [ 'sdk/**', '.github/workflows/sdk.yaml' ] + pull_request: + paths: [ 'sdk/**', '.github/workflows/sdk.yaml' ] + +permissions: + contents: read + +# A new push to a PR cancels its runs for older commits. Each push to master gets its own +# group, so master runs are never cancelled or replaced while pending. +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.sha }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + jobs: sdk-checks: runs-on: ubuntu-latest @@ -18,30 +34,14 @@ jobs: - name: Install dependencies run: npm ci + - name: Check formatting + run: npx prettier --check "**/*.{js,ts,tsx}" + - name: Run ESLint run: npm run eslint + - name: Type-check + run: npx tsc --noEmit -p tsconfig.test.json + - name: Run unit tests run: npm run test - - # Checks code formatting, fails if there are changes after applying prettier. - # Based on this example here: - # https://github.com/creyD/prettier_action?tab=readme-ov-file#example-4-dry-run - prettier: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v7 - with: - # Make sure the actual branch is checked out when running on pull requests - ref: ${{ github.head_ref }} - # Make sure the value of GITHUB_TOKEN will not be persisted in repo's config - persist-credentials: false - - - name: Prettify code - uses: creyD/prettier_action@8c18391fdc98ed0d884c6345f03975edac71b8f0 # v4.6 - with: - # "dry" causes that if any file is modified, the job fails - dry: True - # "write" performs changes in place - prettier_options: --write sdk/**/*.js sdk/**/*.ts sdk/**/*.tsx diff --git a/CHANGELOG.md b/CHANGELOG.md index d8b6a8d9..38db09dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,43 @@ +## 2.0.0 + +This release raises the minimum supported versions to React Native 0.81, Android `compileSdk` 36 and iOS 15.1, updates the Android SDK to `raygun4android` 6.2.3, restores Real User Monitoring network timing on React Native 0.80 and later, and fixes a crash when an app uses `@react-native-async-storage/async-storage` v3. The published package no longer has any runtime dependencies, and no longer ships test or config files. + +### Breaking changes + +- React Native 0.81 or later and React 19.1 or later are required. Both are now declared as peer dependencies. +- Android apps must compile against Android SDK 36 or higher, which `raygun4android` 6 requires. React Native 0.81 and later use SDK 36 by default. The library's `minSdk` is now 24, and it builds with Java 17. +- iOS 15.1 or later is required. +- `@react-native-async-storage/async-storage` is now a peer dependency (`^1.13.0 || ^2.0.0 || ^3.0.0`). Add it to your app's dependencies if it isn't there already; the SDK uses your app's copy. +- Node 20.19.4 or later is required, as declared in `engines`. + +Everything below landed in #269, except where another pull request is named. + +### Fixes + +- Real User Monitoring network timing is restored on React Native 0.80 and later, by intercepting XMLHttpRequest in the SDK instead of loading React Native's private XHRInterceptor +- Real User Monitoring captures `fetch` requests on Expo SDK 56 and later, where `fetch` no longer uses XMLHttpRequest +- Real User Monitoring network events are named with the method upper-cased and without the query string or fragment, as Raygun's other SDKs do, so tokens in URLs aren't sent and each endpoint is reported under one name +- Importing the SDK no longer crashes apps that use async-storage v3 (#252) +- Android crash reports for uncaught native exceptions are no longer lost when the process stops before the report is queued. They are saved before the app exits and sent after it restarts ([raygun4android#322](https://github.com/MindscapeHQ/raygun4android/issues/322)) +- Android apps no longer stop with a `NoClassDefFoundError` from React Native's cookie jar. raygun4android requires okhttp 5, which left React Native's `okhttp-urlconnection` on 4.x; raygun4android 6.2.3 now aligns the okhttp artifacts to one version ([raygun4android#324](https://github.com/MindscapeHQ/raygun4android/issues/324)) +- The podspec points at the MindscapeHQ repository +- The iOS sources no longer produce 8 compiler warnings in every app build +- The Native Crash Reporting documentation had `disableNativeCrashReporting` inverted + +### Packaging + +- No runtime dependencies: monitored requests are keyed by the request itself, so `uuid` is gone +- `dist` is built on pack, and only runtime files are published +- The MIT license ships with the package +- The Android SDK is `raygun4android` 6.2.3 + +### Internal + +- Development toolchain, CI and dependency updates (#242, #243, #244, #247, #251, and the Dependabot updates #239 to #268) + ## 1.7.1 -This release fixes an Android build failure for consumers whose Kotlin compiler is older than the version `raygun4android` was compiled against (notably Expo SDK 55 / React Native 0.81, which pin Kotlin 2.1.20). +This release fixes an Android build failure for consumers whose Kotlin compiler is older than the version `raygun4android` was compiled against (notably Expo SDK 55 / React Native 0.83, which pin Kotlin 2.1.20). - fix: exclude `kotlin-stdlib` from `raygun4android` to avoid forcing a stdlib upgrade on the host app (#237) diff --git a/ExpoDemo/README.md b/ExpoDemo/README.md index 89436430..bf472fea 100644 --- a/ExpoDemo/README.md +++ b/ExpoDemo/README.md @@ -15,13 +15,20 @@ This is an [Expo](https://expo.dev) project created following the instructions i }; ``` -2. Install dependencies +2. Install the SDK's dependencies. ExpoDemo uses the SDK from `../sdk`, and installing it runs the SDK's build, + which needs them + + ```bash + cd ../sdk && npm install && cd ../ExpoDemo + ``` + +3. Install dependencies ```bash npm install ``` -3. Start the app +4. Start the app ```bash npx expo start diff --git a/ExpoDemo/app.json b/ExpoDemo/app.json index 4734d1a7..1bbd6aac 100644 --- a/ExpoDemo/app.json +++ b/ExpoDemo/app.json @@ -7,7 +7,6 @@ "icon": "./assets/images/icon.png", "scheme": "myapp", "userInterfaceStyle": "automatic", - "newArchEnabled": true, "ios": { "supportsTablet": true, "bundleIdentifier": "com.raygun.expodemo" @@ -25,7 +24,6 @@ "favicon": "./assets/images/favicon.png" }, "plugins": [ - "./plugins/withRaygunAndroid", "expo-router", [ "expo-splash-screen", @@ -37,7 +35,8 @@ } ], "expo-font", - "expo-web-browser" + "expo-web-browser", + "expo-status-bar" ], "experiments": { "typedRoutes": true diff --git a/ExpoDemo/app/index.tsx b/ExpoDemo/app/index.tsx index d896ae3a..a15e1cde 100644 --- a/ExpoDemo/app/index.tsx +++ b/ExpoDemo/app/index.tsx @@ -10,6 +10,7 @@ const options: RaygunClientOptions = { apiKey: "INSERT_YOUR_API_KEY_HERE", version: "0.1.2", enableCrashReporting: true, + enableRealUserMonitoring: true, logLevel: LogLevel.verbose, }; @@ -46,6 +47,25 @@ export default function Index() { onPress={() => RaygunClient.sendError(Error("Error from Expo app"))} /> +