Draft: Backwards compatible transport types #156
Closed
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.
I've started looking at #142.
Question; how far back do we want backward compatibility in the types?
Currently, looking at the code comments in
createSentryTransport
it looks like we're trying to support all the way back to v4? Or are we only interested in v6 and v7 nowadays? Asking because more backwards compatibility = more work. :)Progress so far;
I've added some type tests for the transport, these will currently pass due to the
any
return type oncreateSentryTransport
. If you were to remove theany
return then you'd see the new test file passing for v7 but failing for 6, 5 and 4.I've had to add these tests as a separate
build-test
script with it's own TypeScript project because the tests can't type-check without a build producingdist/**
(due to the CJS and ESM tests usingdist
) and doing a build runs the tests; a catch-22.