ecyrbe / zodios

typescript http client and server with zod validation
https://www.zodios.org/
MIT License
1.71k stars 46 forks source link

Zodios has issues with older typescript versions #156

Closed ecyrbe closed 2 years ago

ecyrbe commented 2 years ago

So it seems that zodios has issues with typescript v4.5.4.

Identify which version of typescript zodios is compatible with and make this a peer dependency.

QzCurious commented 2 years ago

I'm identifying the problem by inspecting alias query. The incompatible typescript version would fail to infer the alias query hook. image

The very first version that works find is v4.7.0-beta. Targeting on typescript@4.7.2 might be a good choice, as other v4.7 before it seem like unstable versions (postpending some notion after version tag). image

In addition, note the comments on my screenshots. The problem only occured on @zodios/react.

ecyrbe commented 2 years ago

Thank you, i'll check first if i can fixe this issue, as it seems to be only on query. I might have an Idea where this is coming from.

ecyrbe commented 2 years ago

ok, i identified the issue. I was using a feature only available in ts 4.7. @zodios/react should now work again in v9.4.1 starting from ts 4.5 (should work with earlier versions also, but ts 4.5 tail recursion optimisation will limit the size of the declared api, so i'll advertise ts 4.5 only support.