Repository navigation
feat(browser): add LoaderSentry type - #25357
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1c7706b. Configure here.
|
Hi @Lms24, thanks for approving the TypeScript-only approach on #21806. I've opened #25357, added the focused type tests, and addressed the BugBot feedback. The latest BugBot review found no issues, and the focused type tests pass locally. The GitHub Actions workflows appear to be awaiting approval for this fork PR. Could you or another maintainer approve them so CI can run? Thanks for your time! |
|
I made some changes to this PR to get it passing with our lint rules and also make the type imports and exports a bit simpler.
|
Replace the `typeof import()` type annotations, which the consistent-type-imports lint rule rejects, with named type imports and an explicit interface. Type `withScope` with only its callback overload, since inferring from the overloaded function kept just the two-argument form. Add a usage example and rename the file to loader-types.ts. Run the type tests with the shared tsconfig.test.json and ignoreSourceErrors, like the cloudflare package does. Refs getsentry#21806 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Inside an `onLoad` callback the full SDK is loaded, but the loader calls the callback without arguments, so the type can't express this. Document casting `window.Sentry` to the full SDK type instead. Refs getsentry#21806 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
9d21b2a to
14abcc2
Compare

Summary
Adds an exported
LoaderSentrytype for TypeScript users of the CDN loader.Changes
LoaderSentry.voidreturn types for queued methods to match the loader's runtime behavior.This is a TypeScript-only solution and does not change the loader runtime behavior or expand the loader's queued method list.
Related to #21806.