Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cloudflare)!: add better type handling for additional context #15276

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

chanceaclark
Copy link

@chanceaclark chanceaclark commented Feb 3, 2025

What/Why?

Adds better handling of Cloudflare context for types. Using any and unknown in an interface was causing type mismatch, so even though it's more verbose, we should match the types needed from Cloudflare:
Screenshot 2025-02-03 at 12 11 58

Noticed a v9 is coming soon, so thought it's a good opportunity to add a BC now.

BREAKING CHANGE:
Updates the cloudflare withSentry handler generic type to allow passing in additional types used by ExportedHandler.

Before:

Sentry.withSentry<ExportedHandler<Env>>(...)

After:

Sentry.withSentry<Env>(...)

Before submitting a pull request, please take a look at our
Contributing guidelines and verify:

  • If you've added code that should be tested, please add tests.
  • Ensure your code lints and the test suite passes (yarn lint) & (yarn test).

Screenshot 2025-02-03 at 12 18 28

BREAKING CHANGE:
Updates the cloudflare withSentry handler generic type to allow passing in additional
types used by ExportedHandler.

Before:
```
Sentry.withSentry<ExportedHandler<Env>>(...)
```

After:
```
Sentry.withSentry<Env>(...)
```
@chanceaclark chanceaclark marked this pull request as ready for review February 3, 2025 17:23
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.

1 participant