Skip to content

Conversation

gingerbenw
Copy link
Member

@gingerbenw gingerbenw commented Aug 15, 2025

Goal

This PR refactors the Electron plugin to use the registerPreloadScript API instead of the deprecated setPreloads API when it is available for injecting Bugsnag's preload script into Electron sessions.

Design

Retain usage of setPreloads when registerPreloadScript is not available, for backwards compatibility

Changeset

  • Use session.registerPreloadScript when available, falling back to session.setPreloads
  • Fixes TypeScript export definitions in package.json

Testing

Covered by existing CI

gingerbenw and others added 3 commits August 15, 2025 11:13
if not i'm getting typescript errors when importing
fix also other exports
Copy link

github-actions bot commented Aug 15, 2025

@bugsnag/browser bundle size diff

Minified Minfied + Gzipped
Before 47.11 kB 14.09 kB
After 47.11 kB 14.09 kB
± No change No change

code coverage diff

<temporarily disabled>

Generated by 🚫 dangerJS against 055d3d6

@gingerbenw gingerbenw requested a review from Copilot August 15, 2025 12:16
Copilot

This comment was marked as resolved.

@gingerbenw gingerbenw changed the title refactor: ♻️ swap out deprecated setPreloads API for registerP… Use registerPreloadScript for electron sessions Aug 15, 2025
@gingerbenw gingerbenw marked this pull request as ready for review August 15, 2025 14:18
@gingerbenw gingerbenw enabled auto-merge (squash) August 18, 2025 09:22
Copy link
Contributor

@yousif-bugsnag yousif-bugsnag left a comment

Choose a reason for hiding this comment

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

LGTM

@gingerbenw gingerbenw merged commit 5e794bd into next Aug 20, 2025
21 checks passed
@gingerbenw gingerbenw deleted the gingerbenw/electron-fix branch August 20, 2025 09:26
@gingerbenw gingerbenw mentioned this pull request Aug 29, 2025
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