Skip to content

Conversation

@mydea
Copy link
Member

@mydea mydea commented Mar 13, 2023

This ensures we only export generic code from @sentry/types that works both in node & browser.

  • Replace fetch/XMLHttpRequest stuff with unknown in types - ensure to type this at call site
  • Ensure eslint & tsconfig for @sentry/types is setup correctly
  • Add a node/express/TS E2E test that actually tests this works as expected.

Fixes #7422

@mydea mydea self-assigned this Mar 13, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Mar 13, 2023

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 20.24 KB (+0.01% 🔺)
@sentry/browser - ES5 CDN Bundle (minified) 62.95 KB (0%)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 18.87 KB (+0.01% 🔺)
@sentry/browser - ES6 CDN Bundle (minified) 55.87 KB (0%)
@sentry/browser - Webpack (gzipped + minified) 20.62 KB (0%)
@sentry/browser - Webpack (minified) 67.39 KB (0%)
@sentry/react - Webpack (gzipped + minified) 20.65 KB (0%)
@sentry/nextjs Client - Webpack (gzipped + minified) 48.54 KB (0%)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 27.51 KB (+0.01% 🔺)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 25.76 KB (0%)
@sentry/replay ES6 CDN Bundle (gzipped + minified) 43.17 KB (+0.01% 🔺)
@sentry/replay - Webpack (gzipped + minified) 37.19 KB (0%)
@sentry/browser + @sentry/tracing + @sentry/replay - ES6 CDN Bundle (gzipped + minified) 61.18 KB (+0.01% 🔺)
@sentry/browser + @sentry/replay - ES6 CDN Bundle (gzipped + minified) 54.35 KB (+0.01% 🔺)


"compilerOptions": {
// package-specific options
"lib": ["ES6"]
Copy link
Member Author

Choose a reason for hiding this comment

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

Note: This setting actually leads to the old code failing at build time, so this should also prevent this happening again for types, at least.

@mydea mydea marked this pull request as ready for review March 13, 2023 11:50
@mydea mydea requested a review from Lms24 March 13, 2023 12:02
@mydea mydea requested review from AbhiPrasad and lforst March 13, 2023 12:02
@mydea mydea changed the title Fix node types & add E2E test fix(types): Fix node types & add E2E test Mar 13, 2023
@mydea mydea added Type: Bug Package: node Issues related to the Sentry Node SDK labels Mar 13, 2023
@AbhiPrasad AbhiPrasad merged commit 161b8f0 into develop Mar 13, 2023
@AbhiPrasad AbhiPrasad deleted the fn/fix-types branch March 13, 2023 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Package: node Issues related to the Sentry Node SDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TypeScript error in @sentry/types introduced in 7.42.0

3 participants