Skip to content
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

fix: reorder overloads so typescript doesn't prefer deprecations #5996

Closed
wants to merge 11 commits into from

Conversation

Raiondesu
Copy link

@Raiondesu Raiondesu commented Feb 4, 2021

Description:
This is mostly a reordering of overloads, which moves deprecated overloads to the bottom, which in turn makes TS evaluate them last and solves most "false-positives" for usages of deprecated overloads.

As a bonus, this PR also solves inability of pipe and some other functions to accept unrestricted amounts of arguments, while maintaining the type integrity.
As a cost for this, however, the pipe function does not explicitly error on incorrect operator type chains and simply defaults to Observable<unknown>.

All current unit tests pass.

However, some tests actively use deprecated functions, and I don't know if its intentional or not, so I didn't take the courage of rewriting those (specifically, the forkJoin ones that use deprecated "...spread" overloads) and adjusted overloads accordingly.

Related issue (if exists):
fixes #5064, fixes #5966, fixes #5557, fixes #4177, fixes #3989, and many, many more.

Most discussions in related issues have become stale or full of workarounds instead of solutions, so this PR aims to resolve a bunch of them at once.

@Raiondesu Raiondesu marked this pull request as draft February 4, 2021 11:34
@Raiondesu Raiondesu closed this Feb 4, 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
1 participant