ref(replay): Restructure event type export naming #8866
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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