fix(browser): Add replay and profiling options to BrowserClientOptions
#8921
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 PR adds missing replay and profiling options to the
BrowserClientOptions
interface. Previously, we only exposed these types toBrowserOptions
. This led to type errors for users who directly create a client, without usingSentry.init
(as reported in #8857).While one would think that
BrowserClientOptions
is basically a superset ofBrowserOptions
(leaving asidestackparser
,integrations
andtransport
) this is in fact not the case, which IMO is the core problem here.BrowserClientOptions
only inherits the baseOptions
(which are shared between browser and node), in addition to transport options. However, changing this so that,BrowserClientOptions
inherits fromBrowserOptions
is a breaking change, so I opted to just add the missing options toBrowserClientOptions
.Happy to change this if someone has an idea how to properly fix this without a breaking change.
Furthermore, I'm not sure how to best test this. We could simply add a unit test but having such a test without assertions feels a little awkward to me. Integration tests would probably be the better choice but ours aren't type checked.
I'll leave it untested for the time being (afaik we don't explicitly test types) but if reviewers prefer a test, I'm happy to come up with something.
closes #8857