Skip to content

fix(replay): Add missing rrweb type declarations #6464

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

Merged
merged 2 commits into from
Dec 7, 2022

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Dec 7, 2022

This PR fixes a TypeScript error we encountered when using the 7.24.1 NPM package:

To generate type declarations, we use tsc (yarn build:types) which doesn't pull external type declarations into the resulting .d.ts files. We import types from rrweb which our internal types rely on. Because we now vendor rrweb, the rrweb-internal types are no longer getting installed in our users node_modules, producing typescript errors when they build their projects. To fix this, this PR vendors a "light" version of the two rrweb types we use.

@Lms24 Lms24 requested review from mydea and billyvg December 7, 2022 17:30
Copy link
Member

@mydea mydea left a comment

Choose a reason for hiding this comment

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

LGTM! I'd maybe move the file to a different place, but no strong opinion on that. Great quick fix! IMHO we can later explore if we can make tsc somehow inline the types, but that's for a later point...!

@github-actions
Copy link
Contributor

github-actions bot commented Dec 7, 2022

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 19.68 KB (-0.01% 🔽)
@sentry/browser - ES5 CDN Bundle (minified) 60.94 KB (0%)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 18.46 KB (+0.01% 🔺)
@sentry/browser - ES6 CDN Bundle (minified) 54.49 KB (0%)
@sentry/browser - Webpack (gzipped + minified) 20.26 KB (0%)
@sentry/browser - Webpack (minified) 66.24 KB (0%)
@sentry/react - Webpack (gzipped + minified) 20.29 KB (0%)
@sentry/nextjs Client - Webpack (gzipped + minified) 47.08 KB (-0.13% 🔽)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 26.5 KB (-0.12% 🔽)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 24.92 KB (-0.14% 🔽)
@sentry/replay ES6 CDN Bundle (gzipped + minified) 41.79 KB (-0.01% 🔽)
@sentry/replay - Webpack (gzipped + minified) 37.91 KB (0%)

@Lms24 Lms24 merged commit c68d429 into master Dec 7, 2022
@Lms24 Lms24 deleted the lms-replay-vendor-rrweb-types branch December 7, 2022 17:56
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.

2 participants