Skip to content

Ship React Native and Expo SDK support#155

Merged
niemyjski merged 2 commits into
mainfrom
feature/react-native-expo-audit
May 31, 2026
Merged

Ship React Native and Expo SDK support#155
niemyjski merged 2 commits into
mainfrom
feature/react-native-expo-audit

Conversation

@niemyjski
Copy link
Copy Markdown
Member

@niemyjski niemyjski commented May 31, 2026

Summary

Ships first-class React Native and Expo support for the Exceptionless JavaScript SDK.

This adds a new @exceptionless/react-native package with:

  • React Native client startup, queue/storage integration, environment data, lifecycle handling, and global JS error capture.
  • Hermes/Metro stack parsing that produces structured Exceptionless stack frames and keeps the signature target on the real app frame.
  • React Native and React error-boundary component stack capture under @error.data["@component_stack"].
  • iOS native crash reporting through the native module and PLCrashReporter bridge.
  • Expo autolinking/config-plugin packaging plus a dogfood Expo sample app.
  • Agent skill documentation for adding/configuring the React Native and Expo client.

Review Fixes

  • Replaced the regex-heavy React Native stack parser with deterministic string parsing to address the CodeQL polynomial-regex findings.
  • Fixed the React Native error boundary so a missing fallback renders null after capture instead of re-rendering the crashing subtree.
  • Fixed the Expo sample reset flow by remounting the boundary when the demo is reset.
  • Forced Expo iOS dogfood scripts to use localhost Metro URLs so simulator stack frames do not regress to LAN IPs.
  • Corrected the exported native crash frame type so image can be null.
  • Prevented native crash slots from being cleared when the native parser reports a pending crash but returns no reports.
  • Avoided duplicate session-end handling on iOS by ignoring transient inactive and ending only on background.
  • Cleaned up the Expo plugin initialization warning and README copy.
  • Added client-react-native.md to the Exceptionless JavaScript agent skill so future client-integration prompts route to the correct React Native package, Expo plugin, native crash caveats, localhost guidance, and source anchors.

Validation

  • npm test - 342 passing
  • npm run build - passed across packages and examples
  • npm run lint - passed
  • npm pack --workspace=packages/react-native --dry-run - package contents verified
  • pod install in example/expo/ios - succeeded
  • XcodeBuildMCP iPad Air 11-inch (M3) simulator build/run - succeeded
  • npx tsc --noEmit -p example/expo/tsconfig.json - passed after the localhost script fix
  • npm run start --workspace=example/expo -- --port 8099 - verified Metro waits on http://localhost:8099
  • Manual Expo dogfood on iPad:
    • opened the dev build on Metro 8082
    • triggered the error boundary
    • dismissed the RN redbox
    • verified the fallback renders
    • tapped Reset and verified the trigger button returns
    • confirmed the event was enqueued and sent to http://localhost:7110

Notes

The pasted Hermes stack shape is now the expected one: the first parsed frame is the app frame (CrashyComponent, throwUnhandledError, or submitCaughtError), React/internal frames follow, native frames stay explicit, and synthetic Hermes ?anon_... wrappers no longer leak into the signature method when a real suffix exists.

Copilot AI review requested due to automatic review settings May 31, 2026 02:59
Comment thread packages/react-native/src/plugins/ReactNativeErrorPlugin.ts Fixed
Comment thread packages/react-native/src/plugins/ReactNativeErrorPlugin.ts Fixed
Comment thread packages/react-native/src/plugins/ReactNativeErrorPlugin.ts Fixed
Comment thread packages/react-native/src/plugins/ReactNativeErrorPlugin.ts Fixed
Comment thread packages/react-native/src/plugins/ReactNativeErrorPlugin.ts Fixed
Comment thread packages/react-native/expo-plugin/withExceptionless.cjs Fixed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds first-class React Native/Expo support to the SDK, including a new @exceptionless/react-native package with native iOS crash reporting, React Native stack parsing, lifecycle/global error handling, AsyncStorage-backed persistence, and an Expo sample app.

Changes:

  • Added the React Native package, plugins, native iOS bridge, Expo plugin, docs, and test coverage.
  • Updated React error-boundary data shape and React package peer/build metadata.
  • Updated examples, local server URLs, workspace/test configuration, and React dependency pins.

Reviewed changes

Copilot reviewed 66 out of 74 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
vitest.config.ts Adds React Native test project and mocks.
README.md Documents React Native/Expo usage and updated local server URL.
packages/react/src/ExceptionlessErrorBoundary.tsx Stores React component stack directly.
packages/react/package.json Externalizes React in bundles and adds peer dependency.
packages/react-native/tsconfig.json Adds package TypeScript config.
packages/react-native/test/** Adds unit tests and React Native/AsyncStorage mocks.
packages/react-native/src/** Adds RN client, plugins, storage, logging, error boundary, and exports.
packages/react-native/ios/** Adds iOS native module and PLCrashReporter wrapper.
packages/react-native/expo-plugin/** Adds Expo config plugin entrypoint.
packages/react-native/package.json Defines new package metadata, exports, scripts, peers, and files.
packages/react-native/README.md Adds package-specific documentation.
packages/react-native/LICENSE Adds package license file.
packages/react-native/react-native.config.cjs Adds RN CLI autolinking config.
packages/react-native/exceptionless-react-native.podspec Adds iOS podspec.
packages/core/src/ExceptionlessClient.ts Fixes startup callback/string union type.
packages/browser/src/BrowserExceptionlessClient.ts Fixes startup callback/string union type.
packages/node/src/NodeExceptionlessClient.ts Fixes startup callback/string union type.
packages/core/test/ExceptionlessClient.test.ts Updates expected local server URL.
package.json Adds RN workspace and root React dev deps.
example/** Updates server URLs and React pins in existing examples.
example/expo/** Adds Expo sample app for RN SDK testing.
eslint.config.mjs Ignores RN config/plugin files.
.vscode/launch.json Adds Expo iOS launch profile.
.prettierignore Ignores Expo generated folders.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/react-native/src/ExceptionlessErrorBoundary.tsx
Comment thread example/expo/screens/ErrorsScreen.tsx
Comment thread packages/react-native/src/native/ExceptionlessNativeModule.ts
Comment thread packages/react-native/src/plugins/NativeCrashPlugin.ts
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 68 out of 76 changed files in this pull request and generated 4 comments.

Comment thread packages/react-native/src/plugins/ReactNativeLifeCyclePlugin.ts Outdated
Comment thread example/expo/screens/ErrorsScreen.tsx
Comment thread packages/react-native/src/plugins/ReactNativeErrorPlugin.ts
Comment thread README.md
@niemyjski niemyjski changed the title Fix React Native Expo integration Ship React Native and Expo SDK support May 31, 2026
@niemyjski niemyjski requested a review from Copilot May 31, 2026 03:31
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 70 out of 78 changed files in this pull request and generated 2 comments.

Comment thread packages/react-native/src/plugins/NativeCrashPlugin.ts
Comment thread README.md
@niemyjski niemyjski force-pushed the feature/react-native-expo-audit branch from b945982 to 5d3c9fc Compare May 31, 2026 03:48
chore: remove inline require-import eslint suppressions

Fix React Native Expo integration

Attach React component stacks to error data

Fix React Native PR review findings

Add React Native client agent skill docs

Force localhost for Expo iOS dogfooding

Add native crash plugin review coverage

Fix React Native README startup wording
@niemyjski niemyjski force-pushed the feature/react-native-expo-audit branch from 5d3c9fc to 832fd0f Compare May 31, 2026 03:48
@niemyjski niemyjski merged commit 457cd39 into main May 31, 2026
10 checks passed
@niemyjski niemyjski deleted the feature/react-native-expo-audit branch May 31, 2026 03:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants