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: Use Typescript 5 types with Typescript 5+ #2108
Conversation
Why is this change necessary? |
It seems it doesn't. I can create an example repo, but, if you do this in a folder:
your
Edit: Fine I'll give you an example repo |
That's probably because of the moduleResolution in the tsconfig... |
I'm not a TS expert... what do you think @marcalexiei ? |
if you have the v4 types it's a problem |
like assumed... setting the moduleResolution to NodeNext, uses v5 types... |
Those who want TS v4 or v5? |
I have a proposal: We change that to prefer TS v5... |
The map of used types Without this changeModuleResolution:
|
If I test in the examples/typescript project with your change I get: ModuleResolution:
|
I'll investigate why the editor (and probably a build) differs from what |
In our app we use Now that you point out that types was referring to Here there are a few considerations:
ConclusionsThe only compromise I see is that:
Clearly there isn't a right solution that fits all, so this is the best compromise I could think of. |
Then I'm fine as long as the documentation clearly states which combinations of ModuleResolution+Typescript+i18next versions the types are incorrect (well...older) for. |
I just verified... @Gr3q is right... with tsc the correct types are used... only the editor seems to navigate to the wrong definition... but imo this is ok... |
will wait for another pr to be merged, and then I'll create a new version |
@Gr3q v23.7.16 has just been released |
Checklist
npm run test
Tests are still passing because the v5 types are also valid. I'm not sure how should I write a test to check if the type file used matches the typescript version.