Conversation
|
so that we can reuse this for typescript plugin
a9a8aae to
f9325ab
Compare
f9325ab to
f20414d
Compare
f20414d to
2d5e406
Compare
|
|
||
| For other APIs you don't own — like third party libraries — you expect types to be provided for you. | ||
| That way, you can stick to annotating your own APIs when necessary but let type inference do the heavy lifting everywhere else. | ||
| So it feels unnatural to do so for React Router's route export API. |
There was a problem hiding this comment.
This sentence is a little awkward, maybe something like
| So it feels unnatural to do so for React Router's route export API. | |
| That's why it feels unnatural to annotate React Router's route export API. |
| Remix and React Router already use Vite to compile and bundle your code. | ||
| So delegating typechecking to TypeScript programmatically is less of a departure from `tsc` than using Vite is. |
There was a problem hiding this comment.
I think this should just be 1 sentence
| Remix and React Router already use Vite to compile and bundle your code. | |
| So delegating typechecking to TypeScript programmatically is less of a departure from `tsc` than using Vite is. | |
| Remix and React Router already use Vite to compile and bundle your code, so delegating typechecking to TypeScript programmatically is less of a departure from `tsc` than using Vite is. |
| One reason you might want to do this is if your project uses tools that independently inspect types in your app. | ||
| For example, [typescript-eslint](https://typescript-eslint.io/) will think that route export args are typed as `any`. |
There was a problem hiding this comment.
I don't know the implications of this exactly, but my understanding is this is a very popular package, so I'm a bit nervous about this disclaimer. Not sure if there are patterns or an eslint plugin or something we can provide to help smooth adoption, but as it's written this basically sounds likes
if you want to use
typescript-eslintyou don't get automatic typing at all, you have to manually type everything
Is that correct?
|
closing as we think we have a better, simpler approach that doesn't require injecting types for route modules and has better interop with other tools. still fun to see how far this experiment could push things! |
Depends on #12019
nothing to see here, move along
TODO