-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Typesafety improvements #12019
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
Typesafety improvements #12019
Conversation
🦋 Changeset detectedLatest commit: 7e87c5d The changes in this PR will be included in the next version bump. This PR includes changesets to release 10 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
so that we can reuse this for typescript plugin
ebe9d0a
to
0f09764
Compare
0f09764
to
624093f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feedback on "Type inference" decision doc
decisions/0012-type-inference.md
Outdated
> But in the initial SSR render, the `clientLoader` doesn't run, so really you'd need `typeof loader | typeof clientLoader`. | ||
> Unless you also set `clientLoader.hydrate = true` _AND_ provided a `HydrateFallback`. Then `clientLoader` always runs so you'd want just `typeof clientLoader` | ||
|
||
That `useLoaderData` generic starts to feel a lot like doing your taxes: there's only one right answer, Remix knows what it is, but you're going to get quizzed on it anyway. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this is a universal experience or more US-centric 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can confirm that in Brazil it's exactly like that too
Looking forward to this feature. I enjoyed reading the decision doc. I wasn't familiar with TS LSP plugins, so I looked them up and found this in the TS wiki:
If this is true, then it seems like a big downside of the plugin approach that's worth addressing. If it is not true and Edit: Ok, and that's why you don't comment on work in progress: react-router/decisions/0013-zero-effort-typesafety.md Lines 79 to 87 in 2d5e406
|
For onlookers: its worth calling out that everything in this decision doc ( |
I think what threw me off is that the first paragraph of the Typegen section makes it sound like typegen is primarily about file-based route config. react-router/decisions/0012-type-inference.md Lines 161 to 166 in 624093f
But from doc 13 it sounds like the language service is still leveraging the typegen directory behind the scenes for programmatic routing, you just don't have to annotate the route exports yourself. react-router/decisions/0013-zero-effort-typesafety.md Lines 119 to 128 in 2d5e406
|
fd8a0a0
to
76ef8a1
Compare
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
22 similar comments
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
See the included decision doc
TODO
react-router/dev/routes
resolution errorroutes.ts
config (delete typegen'd file when route no longer exists).d.ts
instead of.ts
for typegen'd filesapp/
dirFollow-on work