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

Generated router with TS errors using new isolatedDeclarations #1630

Open
SimenB opened this issue May 18, 2024 · 2 comments
Open

Generated router with TS errors using new isolatedDeclarations #1630

SimenB opened this issue May 18, 2024 · 2 comments
Labels
information needed Further information is requested

Comments

@SimenB
Copy link
Contributor

SimenB commented May 18, 2024

Describe the bug

Using isolatedDeclarations in the TypeScript 5.5 beta gives errors as it's not explicitly typed. Generating (and exporting) the type annotations would be nice.

https://devblogs.microsoft.com/typescript/announcing-typescript-5-5-beta/#isolated-declarations

Your Example Website or App

https://github.com/SimenB/router-isolated-declarations

Steps to Reproduce the Bug or Issue

Run the TypeScript compiler in the linked reproduction

Expected behavior

No type errors.

Screenshots or Videos

No response

Platform

N/A

Additional context

No response

@SeanCassiere
Copy link
Contributor

@chorobin @schiller-manuel is isolatedDeclarations a flag we hope working with TSR?

Looking at the article linked, the solution to this seems to be the use of explicit types (and return types).

isolatedDeclarations should be adopted on a case-by-case basis.

They do also mention this though 👆🏼.

Should we be looking at this now? or should we wait for Typescript 5.5 to be released and then added into our type-matrix in CI?

@SeanCassiere SeanCassiere added the information needed Further information is requested label May 21, 2024
@SimenB
Copy link
Contributor Author

SimenB commented May 21, 2024

Note that this issue is specifically about the code generated by @tanstack/router-generator output into the user's code base, not necessarily the router's own code base.

(in theory, this might improve type checking performance as well as noted in https://typescript-eslint.io/rules/explicit-module-boundary-types/, but my point was mainly to help/not block users from using the flag)

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

No branches or pull requests

2 participants