fix(core): Version carrier rather than use SDK version #15132
+17
−16
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.
The carrier was originally versioned in this PR:
We chose to use the SDK version as the key for the carrier. This means that if any SDK versions don't match, weird behaviour occurs where things just don't work:
While debugging the above issue myself, I also managed to install incompatible versions and it took me forever to work out what was going on.
The issues linked in #12188 were all caused by changes in the carrier interface between v7 and v8 and users upgrading. We don't need to update the carrier version on every release, only when the interface changes. This does add some extra things to consider in PR's and reviews but we're often thinking about semver everywhere anyway. I think this is preferable to what we have now where all versions have to match exactly.
This PR keeps
__SENTRY__.version
and how the versioning works so I don't think this would require changes in Spotlight or the loader.Alternative Approaches
If we end up with multiple versions of
@sentry/core
, we could log warnings to the console. The downside here is it's not always easy to guide users in fixing this problem.