fix: remove componentStack attachment override#22
Merged
Conversation
The setCreateComponentStackAttachment / getCreateComponentStackAttachment on Scope was added to work around RN's Blob not serializing in FormData. The real fix is expo-blob (a web-standards Blob polyfill for RN), which makes new Blob() work correctly with FormData + fetch on native. With expo-blob handling the polyfill in @bugsplat/expo, bugsplat-react can use plain new Blob() everywhere — no override mechanism needed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR removes the componentStack attachment override mechanism from the library API, simplifying Scope back to only holding a BugSplat client and inlining Blob creation inside ErrorBoundary.dispatchPost() (with the expectation that React Native serialization issues are now handled by expo-blob).
Changes:
- Removed
CreateComponentStackAttachmentand the getter/setter override API fromScope. - Updated
ErrorBoundaryto build thecomponentStackattachment inline and simplified thescopecontract to only requiregetClient(). - Removed
Scopefrom the public barrel export and updated unit tests accordingly.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/scope.ts | Simplifies Scope back to only storing and returning the BugSplat client. |
| src/index.ts | Removes scope from public exports. |
| src/ErrorBoundary.tsx | Drops attachment-builder override usage; creates Blob inline and switches default scope wiring. |
| spec/ErrorBoundary.spec.tsx | Updates tests to reflect removal of the override mechanism and relaxed attachment assertions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Requires the version with injectable _fetch, needed by @bugsplat/expo to inject expo/fetch for React Native Blob support. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
daveplunkett
approved these changes
Apr 18, 2026
Also strengthens test assertion to verify the MIME type. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
setCreateComponentStackAttachment/getCreateComponentStackAttachmentfromScopeScopeto its original shape (just holds the BugSplat client)new Blob([componentStack])inErrorBoundary.dispatchPost()ScopeandCreateComponentStackAttachmentfrom public exportsThe override mechanism was added to work around RN's
Blobnot serializing correctly inFormData+fetch. The actual fix isexpo-blob— a web-standards-compliantBlobpolyfill for React Native (part of Expo SDK 55). With@bugsplat/expoimportingexpo-blob, the defaultnew Blob()works correctly on both web and native, making the override unnecessary.Test plan
🤖 Generated with Claude Code