-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add runtime checks to ensure Sentry dependencies have matching versions #5310
Comments
We could also add a Edit: After thinking about this a bit, it's probably not the best of ideas to have a postinstall script. Some ppl don't like em, some have them disabled, and blocking npm i or yarn add is a bit iffy |
Another idea: We could send meta-information on this to Sentry so we can display some warnings directly in the interface. |
Still not sure what is the best approach. Runtime and meta-info both have the minor downside of slightly more code in the bundle although I doubt it will be that significant. For the JavaScript SDKs outside of this repository, we'd probably want to ensure all the core dependencies match the pinned version too. |
Crazy idea: What if we ship complete packages - with that I mean when we package |
link: #5886 |
That would work but I guess we'd need to split We'd also need to re-export more things from core/types/utils at the top level so customers can access everything. Or maybe the dependencies could be exported as named exports: |
I'll close this, because this is way less of a problem since v8, where almost everything is now re-exported anyhow! |
Problem Statement
When users upgrade Sentry, it's key that all the Sentry dependencies get updated to the same version otherwise weird hard-to-debug things happen.
This could be checked at runtime.
Solution Brainstorm
Currently,
SDK_VERSION
exists only in@sentry/core
.We could add a
checkVersion(version: String)
function to core that is called from the packages further up the dependency tree and throws if the versions don't match. The packages further up the dependency tree would need their ownSDK_VERSION
to call this function with.This wouldn't check any versions "below" core in the dependency tree although I doubt this will be an issue since users rarely depend on anything below core directly.
The text was updated successfully, but these errors were encountered: