From d74455418244112562599ef528384fe80cab0851 Mon Sep 17 00:00:00 2001 From: Matthew Richardson Date: Tue, 14 Apr 2026 12:47:13 +0100 Subject: [PATCH 1/4] chore: bump version to 1.7.0 --- CHANGELOG.md | 36 ++++++++++++++++++++++++++++++++++++ demo/package-lock.json | 8 ++++---- demo/package.json | 2 +- sdk/package.json | 2 +- 4 files changed, 42 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 97bc7c2..3061ca6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,39 @@ +## 1.7.0 + +This release adds a new `RaygunErrorBoundary` React component for capturing render-time errors with the React `componentStack`, upgrades the underlying native SDKs (`raygun4android` 5.2.1, `raygun4apple` 2.1.6), modernises the Android build for Gradle 9 / AGP 8.x (`compileSdkVersion 36`), and refreshes the demo projects to React Native 0.84. + +- feat: Add `RaygunErrorBoundary` component for capturing React render-time errors with `componentStack` (#228) +- feat: bump raygun4apple to 2.1.6 (#226) (2026-03-12) +- feat: bump to raygun4android v5.2.1 (#224) (2026-03-03) +- fix: breaking changes in raygun4android 5.2.1 (#225) (2026-03-03) +- fix: use compileSdkVersion 36 (#223) (2026-03-03) +- fix: unhandled exception tag and fatal tag overwrite in CrashReporter (#217) (2026-02-10) +- chore: upgrade demo projects and align dependencies (#227) (2026-03-19) +- chore(deps): bump react-native from 0.83.1 to 0.84.1 in /demo (#220) (2026-03-02) +- chore(deps): bump react-native from 0.80.1 to 0.83.1 in /demo (#209) (2026-01-06) +- chore(deps): bump @react-navigation/native from 7.1.31 to 7.2.2 in /demo (#232) (2026-04-01) +- chore(deps): bump @react-navigation/bottom-tabs in /demo (#219, #207, #203, #196, #189, #181) (2025-08 → 2026-03) +- chore(deps): bump react-native-screens (#205, #193) (2025-11 → 2026-01) +- chore(deps): bump react and @types/react in /demo (#201, #183, plus 2026-02-02) (2025-08 → 2026-02) +- chore(deps-dev): bump @react-native-community/cli-platform-android (#229, #195) (2025-11, 2026-04) +- chore(deps-dev): bump @react-native-community/cli-platform-ios in /demo (#230, #211) (2026-02, 2026-04) +- chore(deps-dev): bump @react-native-community/cli (#188, plus 2026-02-02) (2025-10 → 2026-02) +- chore(deps-dev): bump @react-native/babel-preset in /demo (#221, #182) (2025-08, 2026-03) +- chore(deps-dev): bump @react-native/metro-config in /demo (#218, #202) (2025-12, 2026-03) +- chore(deps-dev): bump @react-native/eslint-config in /demo (#222, #185) (2025-10, 2026-03) +- chore(deps-dev): bump @react-native/typescript-config in /demo (#204) (2025-12-10) +- chore(deps-dev): bump eslint from 8.57.1 to 9.39.2 in /demo (#208) (2026-01-02) +- chore(deps-dev): bump typescript (#180, plus 2026-02-02) (2025-08 → 2026-02) +- chore(deps-dev): bump prettier (#184, #206, plus 2026-02-02) (2025-08 → 2026-02) +- chore(deps-dev): bump @babel/core from 7.28.5 to 7.29.0 in /demo (#233) (2026-04-01) +- chore(deps-dev): bump @babel/preset-env from 7.28.0 to 7.28.5 in /demo (#194) (2025-11-01) +- chore(deps-dev): bump @babel/runtime from 7.27.6 to 7.28.4 in /demo (#187) (2025-10-01) +- chore(deps): bump on-headers and compression in /demo and /ExpoDemo (#178, #179) (2025-07-22) +- chore(deps): bump gradle/actions from 4 to 6 (#199, #234) (2025-11, 2026-04) +- chore(deps): bump actions/checkout from 4 to 6 (#191, #200) (2025-10, 2025-12) +- chore(deps): bump actions/setup-node from 4 to 6 (#190, #198) (2025-10, 2025-11) +- chore(deps): bump actions/setup-java from 4 to 5 (#192) (2025-10-01) + ## 1.6.0 This release fixes compatibility issues with the recent React-Native versions 0.79+, and it is backwards compatible with older versions as well. diff --git a/demo/package-lock.json b/demo/package-lock.json index 7245e23..ca1d797 100644 --- a/demo/package-lock.json +++ b/demo/package-lock.json @@ -12,7 +12,7 @@ "@react-native-community/checkbox": "^0.5.20", "@react-navigation/bottom-tabs": "^7.15.2", "@react-navigation/native": "^7.2.2", - "raygun4reactnative": "file:raygun4reactnative-1.6.0.tgz", + "raygun4reactnative": "file:raygun4reactnative-1.7.0.tgz", "react": "19.2.3", "react-native": "^0.84.1", "react-native-safe-area-context": "^5.4.1", @@ -9290,9 +9290,9 @@ } }, "node_modules/raygun4reactnative": { - "version": "1.6.0", - "resolved": "file:raygun4reactnative-1.6.0.tgz", - "integrity": "sha512-0kp2Ti0IEO9jYNL9Td+7llUR6oj3rP3Pkmvt7ewoIWZdoS5F6gIhCGxM7mhgRpdsHzpHw8e5lm9zV/yK8ns5ug==", + "version": "1.7.0", + "resolved": "file:raygun4reactnative-1.7.0.tgz", + "integrity": "sha512-7zup0wyVsTNuQ3gyXjCIghmkJT78NLmdGntbHaB4G87naIlDEpgMRVE0SVkorQl6NKWenUzXM1xauO+BNeRXcA==", "license": "MIT", "dependencies": { "@react-native-async-storage/async-storage": "^2.2.0", diff --git a/demo/package.json b/demo/package.json index 73e9aa3..640d868 100644 --- a/demo/package.json +++ b/demo/package.json @@ -13,7 +13,7 @@ "@react-native-community/checkbox": "^0.5.20", "@react-navigation/bottom-tabs": "^7.15.2", "@react-navigation/native": "^7.2.2", - "raygun4reactnative": "file:raygun4reactnative-1.6.0.tgz", + "raygun4reactnative": "file:raygun4reactnative-1.7.0.tgz", "react": "19.2.3", "react-native": "^0.84.1", "react-native-safe-area-context": "^5.4.1", diff --git a/sdk/package.json b/sdk/package.json index 6ee2b47..09d0594 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -1,7 +1,7 @@ { "name": "raygun4reactnative", "title": "Raygun4reactnative", - "version": "1.6.0", + "version": "1.7.0", "description": "Raygun React Native SDK", "main": "dist/index.js", "typescript": { From 176448b5d5e1f6fa9605c559cad722fb1406f799 Mon Sep 17 00:00:00 2001 From: Matthew Richardson Date: Tue, 14 Apr 2026 12:46:41 +0100 Subject: [PATCH 2/4] feat: add error boundary component --- sdk/README.md | 57 ++++++++ sdk/__tests__/RaygunErrorBoundary.test.tsx | 156 +++++++++++++++++++++ sdk/src/RaygunErrorBoundary.tsx | 82 +++++++++++ sdk/src/index.ts | 7 + 4 files changed, 302 insertions(+) create mode 100644 sdk/__tests__/RaygunErrorBoundary.test.tsx create mode 100644 sdk/src/RaygunErrorBoundary.tsx diff --git a/sdk/README.md b/sdk/README.md index be1f425..ef21eee 100644 --- a/sdk/README.md +++ b/sdk/README.md @@ -25,6 +25,8 @@ - [sendError](#senderrorerror-error-details-manualcrashreportdetails) - [setMaxReportsStoredOnDevice](#setmaxreportsstoredondevicesize-number) - [sendRUMTimingEvent](#sendrumtimingeventeventtype-realusermonitoringtimings-name-string-timeusedinms-number) + - [Components](#components) + - [RaygunErrorBoundary](#raygunerrorboundary) - [Raygun specific types](#raygun-specific-types) - [BeforeSendHandler](#beforesendhandler) - [GroupingKeyHandler](#groupingkeyhandler) @@ -468,6 +470,8 @@ can utilize this method, and send the error through to Raygun. Appended to this ManualCrashReportDetails object. This non-mandatory object can apply specific tags and CustomData to the error you are sending away as well as the global tags and CustomData. +For React render-time errors, see [RaygunErrorBoundary](#raygunerrorboundary). + See also:
[CustomData](#customdata)
@@ -582,6 +586,59 @@ RaygunClient.sendRUMTimingEvent(RealUserMonitoringTimings.ViewLoaded, 'name of t RaygunClient.sendRUMTimingEvent(RealUserMonitoringTimings.NetworkCall, 'name of the network event', 255); ``` +
+ +## Components + +### RaygunErrorBoundary + +`RaygunErrorBoundary` is a React [error boundary](https://react.dev/reference/react/Component#catching-rendering-errors-with-an-error-boundary) component that catches render-time errors anywhere in its child tree, reports them to Raygun (with the React `componentStack` attached as custom data), and renders a fallback UI in place of the crashed subtree. + +Use this for render-time errors. For errors caught manually in event handlers or async code, continue to use [sendError](#senderrorerror-error-details-manualcrashreportdetails). + +The boundary does **not** catch errors thrown by the `fallback` itself, errors in event handlers, or errors thrown asynchronously. For those, use `try/catch` with `RaygunClient.sendError`, and nest another `RaygunErrorBoundary` above if your `fallback` can throw. + +#### Props + +| Prop | Type | Description | +| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `children` | `ReactNode` | The subtree to protect. | +| `fallback?` | `ReactNode \| ({ error, componentStack, reset }) => ReactNode` | UI to render after an error. As a function, receives the captured error, the React `componentStack`, and a `reset` callback that clears the error and remounts `children`. If omitted, the boundary renders `null` after an error (report-only mode). On the very first fallback render, `componentStack` may be an empty string before being populated on the immediately-following re-render. The function must not throw. | +| `tags?` | `string[]` | Tags to attach to the report. Always merged (de-duplicated) with `'error-boundary'`. | +| `customData?` | `CustomData` | Custom data to attach to the report. The captured `componentStack` is always merged in under the `componentStack` key and overrides any user-supplied value with the same key. | +| `onError?` | `(error: Error, info: ErrorInfo) => void` | Called after the error is captured. | +| `onReset?` | `(error: Error \| null, info: ErrorInfo \| null) => void` | Called when `reset` is invoked from the fallback. | + +#### Basic example + +```tsx +import { RaygunErrorBoundary } from 'raygun4reactnative'; + +}> + + +``` + +#### Render-prop fallback with reset + +```tsx +import { RaygunErrorBoundary } from 'raygun4reactnative'; + + ( + + Something went wrong: {error.message} +