-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Types are breaking #1275
Comments
Please provide a reproduction first. |
I'll add one asap |
Happened to us too. Offending code:
Replacing |
Hope this is enough.
This is the TS error:
I would like to highlight the fact that the error did not appear on version |
It was a bug fix. Bug fixes are by definition backwards incompatible and thus a breaking change for everybody relying on the bug. The change is compliant with Semantic Versioning. The fix is described in #1275 (comment) Closing as working as intended. |
Thanks for your hard work, this library is awesome. |
How should we handle bug fixes instead? |
As a reiteration, since this was already used by others, changing this specific behaviour essentially creates a bug for all of them. This is true even if the original intended behaviour was different, because people where already relying on it. If this is not possible, an alternative could be to extend the existing contract instead of changing it e.g.:
This way you do not create issues for people relying on this behaviour and offer a way for whomever want's to take advantage of the new behaviour. |
But I'm also not fixing it for the people that want to rely on the intended behavior. Every bug fix would have to be a major release. That's not how semantic versioning works for very practical reasons. If you want to rely on existing behavior and don't want any bug fixes, you should pin your dependencies to an exact version. That way we cannot break your code. |
Just to be clear I have nothing against this library in particular or against anyone maintaining it, I understand you have a tough job, I'm just trying to get a point across and eventually find some common ground.
Not necessarily, it depends on the bug. This specific bug fix requires a change in an API, which makes it backwards incompatible.
From here: https://github.com/semver/semver/blob/master/semver.md?plain=1#L12 |
Oh wow that's not how I remember it. Bug fixes cannot be backwards compatible by definition since they change behavior. This change didn't change the API. The types are not equivalent with the API. They are a description of that but we can always make mistakes describing the API with types. This change is an instant where the description of the API via types was buggy. |
I honestly don't know where this is coming from. Why is this a rule and who established it?
I strongly disagree here. These types where exported for everyone to use therefore they are an interface or API.
Mistakes happen, we all make mistakes. I just gave you an alternative to creating a breaking change in order to fix them though. |
@testing-library/react
version: 14.2.1What you did:
No changes
What happened:
Typescript started to throw errors
Reproduction:
I do not have a reproduction as the code is proprietary
Problem description:
This is the stacktrace
Suggested solution:
Revert this change
The text was updated successfully, but these errors were encountered: