Skip to content

Fix bivariance issues in Sentry.Options TS type #4234

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

Merged
merged 2 commits into from
Dec 6, 2021

Conversation

twavv
Copy link
Contributor

@twavv twavv commented Dec 3, 2021

Fixes #4233 (at least in just this one file -- haven't checked anything else, but this seems like the most important since it's the place people are most likely to pass in their own functions).

Before submitting a pull request, please take a look at our
Contributing guidelines and verify:

  • If you've added code that should be tested, please add tests.
  • Ensure your code lints and the test suite passes (yarn lint) & (yarn test).

Fixes getsentry#4233 (at least in just this one file -- haven't checked anything else, but this seems like the most important since it's the place people are most likely to pass in their own functions).
@AbhiPrasad AbhiPrasad self-requested a review December 4, 2021 23:49
@AbhiPrasad
Copy link
Member

Awesome, thank you for your contribution!

The only concern here would be if many users would have to make code changes after we change the typing, but I guess that is also dependent on them using — strictFunctionTypes. If this is the case though, we probably have to save the change for a major bump to reduce friction for sdk users.

What do you think?

@twavv
Copy link
Contributor Author

twavv commented Dec 6, 2021

I'd be inclined to just release with a patch bump but I don't have strong opinions. I doubt the majority of people are impacted by this (and if they are, then it's ostensibly a bug in their code).

Copy link
Member

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be inclined to just release with a patch bump but I don't have strong opinions. I doubt the majority of people are impacted by this (and if they are, then it's ostensibly a bug in their code).

Yeah we discussed internally and came to a similar conclusion.

We probably will add a custom eslint rule to catch these cases (methods under publically exported types/interfaces)

For now let's ship this and improve as we go!

@AbhiPrasad AbhiPrasad enabled auto-merge (squash) December 6, 2021 18:25
@AbhiPrasad AbhiPrasad merged commit dd11cde into getsentry:master Dec 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TS types allow bivariant function parameters
2 participants