Skip to content

ref(replay): Restructure event type export naming #8866

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 1 commit into from
Aug 29, 2023

Conversation

mydea
Copy link
Member

@mydea mydea commented Aug 25, 2023

This renames & restructures the type exports from @sentry/replay.

We want to deprecate the @sentry/replay package eventually - users should import everything they need directly from e.g. @sentry/browser or @sentry/react.

For this to be possible, we need to re-export everything we need from the replay package in the browser package. However, due to the generic naming of some of the type exports, this may become confusing - so I renamed the type exports to ReplayXXX to make it clear what it is for. For now, the old types are still exported as well, but they are deprecated. Ideally you move directly to import from e.g. @sentry/react for them.

While at this, I also got rid of the rrweb-specific naming of types (they are not in PascalCase), as IMHO this does not have to be fully aligned with the rrweb naming - we are exporting this as replay types, not rrweb types, so I think this is fine. I also got rid of the type enum and replaced it with a more simple enum, which has a more compact bundle size. This also lead to me refactoring all the TEST_EVENT = {...} calls we have in order for them to be type safe, which is probably a good thing anyhow (as it is much clearer now if we are looking at a checkout or incremental event etc., even if it doesn't matter much for most tests, but 🤷 ).

ref #8864

Copy link
Member

@billyvg billyvg left a comment

Choose a reason for hiding this comment

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

🙌

@mydea mydea merged commit 31cef09 into develop Aug 29, 2023
@mydea mydea deleted the fn/move-replay-types branch August 29, 2023 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: replay Issues related to the Sentry Replay SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants