Migration Story and Appreciation Thread #970
Replies: 4 comments
-
Wow, thank you so much for sharing this :)
Thanks again, this was great! |
Beta Was this translation helpful? Give feedback.
-
I started with non-CLI and didn't find it too bad, even with manually nesting declare module '@tanstack/react-router' {
- interface Register {
- router: typeof router
- }
+ interface FileRoutesByPath {
+ '/': {
+ preLoaderRoute: typeof IndexRouteImport
+ parentRoute: typeof rootRoute
+ }
+ /* ... */
+ }
} Parsing those route IDs through So I took a few hours to switch to the file-based generation and was very impressed. Then I used auto codesplitting and was blown away. This is absolutely phenomenal! It does seem to be better for TS performance overall, and it's really nice that I still have fine-grain control over when to auto split, use Interestingly enough, the code splitting pattern is very similar to how I had structured my app with React Router so the implementation felt eerily familiar. |
Beta Was this translation helpful? Give feedback.
-
Hello @benweier, I have been struggling with the performance as described in: #1091 file-based routes didn't help me as they did for you. Can you please share some tips that helped you get better performance? What TS are you running? Do you have some performance metrics? |
Beta Was this translation helpful? Give feedback.
-
@ToTeTo I initially had some reasonably strict type-checking rules as part of my eslint config, I'm opinionated in that way so it wasn't all TS's fault... That was where performance was hit the hardest because the TS engine was working overtime. Removing the TS rules in the eslint config addressed most of my performance issues, and I now use Using the Vite plugin to generate the route tree also wasn't doing any favours because changes to routes would regenerate the router declaration often and cause heavy spikes in processing. I now tend to avoid running |
Beta Was this translation helpful? Give feedback.
-
I want to say congrats and thank you to @tannerlinsley and the TSR contributors for shipping an amazing library. I love me some SPAs and client-side rendering so seeing a new tool come out in such a great 1.0 state is really refreshing.
This past weekend I decided to see what it was all about, thinking that TSR would be "good" but "not quite a React Router replacement.. yet". I was very wrong. In 2 days I was able to migrate my whole app (approx 12k-14k LOC, about 13 unique routes), including some "interesting" integration details... with minor patches to a couple things I got wrong on the first pass in the following 2 days.
Once I worked out the new patterns with TSR it all seemed to fall into place. Although there's a few rough edges left - TS is painfully slow sometimes, and
RouteApi
could do with a few improvements - the end result is quite amazing. Compared to my React Router version it:loader
functions but not lazy in TSR)Thank you thank you thank you. I can't wait to see where this goes next!
Beta Was this translation helpful? Give feedback.
All reactions