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: change overload order to not show the deprecation per default [HOMER-1999] #1841

Merged
merged 5 commits into from
May 31, 2023

Conversation

Chaoste
Copy link
Contributor

@Chaoste Chaoste commented May 26, 2023

Summary

In some IDEs, it will only pick up the JSDoc of the first overload for a function. By moving the deprecated overload to the end, we hope to mitigate the wrongly shown deprecation warning.

Description

We need to change the order of function overloads for createClient. In some cases, the IDE will pick up only the JSDoc for the first overload and even mark the usage as deprecated as shown in this issue. Weirdly, we can't reproduce this consistently with the same version of VSC & TS. In some cases, it works as expected. In a few other cases, the TS engine appears to pick up only the first overload and render any usage of the function as being deprecated.

This is a reported issue for VSC (issue) and WebStorm (issue). It appears we can mitigate this scenario by changing the order of overloads.

We also tested this on the TS playground (see here) but couldn't reproduce it there as well.

Example from the linked issue:
image

Interestingly, there is yet no way to check for deprecated usages via the console just with TS. See this issue.

@Chaoste Chaoste requested a review from a team as a code owner May 26, 2023 09:43
@Chaoste Chaoste force-pushed the fix/HOMER-1999-deprecated-client branch from c441f94 to 7974447 Compare May 26, 2023 09:47
@Chaoste
Copy link
Contributor Author

Chaoste commented May 30, 2023

@denkristoffer do you know whether someone is looking into the broken CI pipeline for this repo?

@denkristoffer
Copy link
Contributor

@Chaoste I don't know, no 😞

@Chaoste Chaoste enabled auto-merge (squash) May 31, 2023 13:28
@Chaoste Chaoste merged commit e9c63ac into master May 31, 2023
@Chaoste Chaoste deleted the fix/HOMER-1999-deprecated-client branch May 31, 2023 13:37
@contentful-automation
Copy link
Contributor

🎉 This PR is included in version 10.35.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants