Skip to content

fix: remove componentStack attachment override#22

Merged
bobbyg603 merged 3 commits intomainfrom
fix/use-file-for-componentstack
Apr 18, 2026
Merged

fix: remove componentStack attachment override#22
bobbyg603 merged 3 commits intomainfrom
fix/use-file-for-componentstack

Conversation

@bobbyg603
Copy link
Copy Markdown
Member

@bobbyg603 bobbyg603 commented Apr 18, 2026

Summary

  • Removes setCreateComponentStackAttachment / getCreateComponentStackAttachment from Scope
  • Reverts Scope to its original shape (just holds the BugSplat client)
  • Uses inline new Blob([componentStack]) in ErrorBoundary.dispatchPost()
  • Removes Scope and CreateComponentStackAttachment from public exports

The override mechanism was added to work around RN's Blob not serializing correctly in FormData + fetch. The actual fix is expo-blob — a web-standards-compliant Blob polyfill for React Native (part of Expo SDK 55). With @bugsplat/expo importing expo-blob, the default new Blob() works correctly on both web and native, making the override unnecessary.

Test plan

  • All 19 unit tests pass
  • Integration test (requires env vars, runs in CI)

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings April 18, 2026 16:12
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 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 CreateComponentStackAttachment and the getter/setter override API from Scope.
  • Updated ErrorBoundary to build the componentStack attachment inline and simplified the scope contract to only require getClient().
  • Removed Scope from 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.

Comment thread src/index.ts
Comment thread src/ErrorBoundary.tsx Outdated
Comment thread spec/ErrorBoundary.spec.tsx
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>
Also strengthens test assertion to verify the MIME type.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bobbyg603 bobbyg603 merged commit 2aaee62 into main Apr 18, 2026
4 checks passed
@bobbyg603 bobbyg603 deleted the fix/use-file-for-componentstack branch April 18, 2026 18:13
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