Skip to content

Convert @bugsnag/core/lib/callback-runner to TypeScript#2438

Merged
gingerbenw merged 13 commits intointegration/typescriptfrom
PLAT-13697-callback-runner
Jul 7, 2025
Merged

Convert @bugsnag/core/lib/callback-runner to TypeScript#2438
gingerbenw merged 13 commits intointegration/typescriptfrom
PLAT-13697-callback-runner

Conversation

@AnastasiiaSvietlova
Copy link
Copy Markdown
Contributor

Goal

Convert @bugsnag/core/lib/callback-runner to TypeScript

Testing

Covered by existing end to end and unit tests

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 12, 2025

@bugsnag/browser bundle size diff

Minified Minfied + Gzipped
Before 80.07 kB 18.16 kB
After 79.92 kB 18.10 kB
± -158 bytes -60 bytes

code coverage diff

<temporarily disabled>

Generated by 🚫 dangerJS against 259ce15

@AnastasiiaSvietlova AnastasiiaSvietlova marked this pull request as ready for review May 12, 2025 15:34
@AnastasiiaSvietlova AnastasiiaSvietlova marked this pull request as draft May 26, 2025 14:11
type NodeCallbackType<T = any> = (error?: Error | null, result?: T) => void;

const runCallbacks = <T>(
callbacks: any[],
Copy link
Copy Markdown
Contributor Author

@AnastasiiaSvietlova AnastasiiaSvietlova Jun 9, 2025

Choose a reason for hiding this comment

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

Wanted to specify the type here based on usage of this function.

Suggested change
callbacks: any[],
callbacks: (OnErrorCallback | undefined)[],

But got errors from callback-runner.test as we are using other types there. I'm assuming that we expecting any type of callbacks.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this is okay to be any here - we don't necessarily know that what we're providing is even a function and we're handling it when it's not - happy to leave it 👍🏻

@AnastasiiaSvietlova AnastasiiaSvietlova marked this pull request as ready for review June 9, 2025 14:20
@gingerbenw gingerbenw force-pushed the PLAT-13697-callback-runner branch 2 times, most recently from 4d10b2e to 1ffb4a4 Compare June 24, 2025 09:37
@gingerbenw gingerbenw force-pushed the PLAT-13697-callback-runner branch from d8b5e70 to 8ef69af Compare June 27, 2025 14:41
gingerbenw
gingerbenw previously approved these changes Jun 27, 2025
@gingerbenw gingerbenw requested a review from hamudi-ahmed June 27, 2025 15:29
@gingerbenw gingerbenw enabled auto-merge June 27, 2025 15:30
Copy link
Copy Markdown
Contributor

@hamudi-ahmed hamudi-ahmed 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 0852a76 into integration/typescript Jul 7, 2025
48 checks passed
@gingerbenw gingerbenw deleted the PLAT-13697-callback-runner branch July 7, 2025 14:52
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