Sean
TTCTheo's Typesafe Cult
•Created by Gary, el Pingüino Artefacto on 2/24/2025 in #questions
Migrating from a Create Next App to TurboRepo
Create new turbo repo project with a template, and then just look how the eslint, prettier, package.json, turbo.json are being configured and do the same for your react app
4 replies
TTCTheo's Typesafe Cult
•Created by vpjm on 2/11/2025 in #questions
Passing generic inside tRPC query
Should be something like
useQuery<TPayload, unknown, TResponse>
8 replies
TTCTheo's Typesafe Cult
•Created by vpjm on 2/11/2025 in #questions
Passing generic inside tRPC query
Hey, I’m not familiar with trpc but I do with react query.
In your front, provide the types for the useQuery generics.
If im not mistaken it receives 4 different types.
Payload Type
Error Type
Response Type
Another type I always forgets
8 replies
TTCTheo's Typesafe Cult
•Created by eSkaar on 2/10/2025 in #questions
I'm sorry, but angular, react, migration, thoughts?
Unfortunately I disagree with you… Although angular has good structure and limits you to work in a specific way, but as devs tends to think that users are “stupid” and try to do similar things, same thing with devs and angular.
The codebase I had in Angular was so awful, it took DAYS to add a simple tiny feature and it was very hard for other people to understand the code base.
I’ll be also guilty and tbh I wrote shit code in Angular too lol. Tried my best to actually learn angular but it wasn’t it and I just wrote so things could work.
Each team and each code are different, but it could happen to anyone
9 replies
TTCTheo's Typesafe Cult
•Created by eSkaar on 2/10/2025 in #questions
I'm sorry, but angular, react, migration, thoughts?
About number 3, read about webpack module federation and how you can implement it with angular and react.
We were 4 devs and 1 qa. Yeah all of the team knew angular but only half of the team knew react. So part of the team learned react on the go and we were very strict on code reviews.
Also we only refactored the frontend and didn’t touch anything in the backend so that was a relief.
If you’re going to refactor, I suggest to choose a design system like mui or anything similar, it will help you reduce duplicate code and work on a lot of functionality.
Also try to make as many small tasks as you can so you would know what are the pain points and what’s going to take time and also know how much you can estimate it. The snaller the task is, the easier it is to estimate it.
Take a note that it will take time and if you’re thinking it will take 2 months, give it another month or two for just in case.
Also idk what are the work hours in your work place but we worked a l o t. Like 10-12 hours a day lol
9 replies
TTCTheo's Typesafe Cult
•Created by eSkaar on 2/10/2025 in #questions
I'm sorry, but angular, react, migration, thoughts?
About 4 years ago I was working in a team with Angular 9 and tbh I hated it from the beginning lol
We upgraded from 9 to 10 and then from 10 to 11 and we sticked with it for almost 2 more years. Then we got a new design for the system and we just wrote everything in react and it took us about a 1-2 months doing so (The code base was huge and we didn't deliver any new features).
So couple things I learned from this process are:
1. if the code ain't that bad and it's just you can't get used to Angular, maybe you need to give it a better try. It's very easy to get a code that you didn't write and say "Let's refactor this code, it's not that good"
2. don't use any migration tools. write everything from scratch. do it the right way. Angular is not React and React is not Angular.
3. consider using module federation in order to work in micro frontends. this way you can start refactoring parts of the system in react and use them in angular and this way you can take your time refactoring the code and also continue to deliver new features without affecting that much of the performance of the team and the website.
9 replies
TTCTheo's Typesafe Cult
•Created by Max on 2/10/2025 in #questions
Is there a public reasoning for the folder structure of ct3a?
I’m not familiar with ct3a but I do work with prisma.
Usually auto generated code should not be inside src folder, and prisma is an auto-generated folder with files and therefore is outside of the src folder.
3 replies
TTCTheo's Typesafe Cult
•Created by BrazilianJoe on 2/9/2025 in #questions
DynamoDB adapter?
DynamoDB is a NoSQL db and drizzle and prisma are mainly created for SQL dbs (even though you can use mongo with prisma - please avoid that before you regret it).
You can use official aws package for dynamoDb in order to use it
3 replies
TTCTheo's Typesafe Cult
•Created by conlonj25 on 2/9/2025 in #questions
useSuspenseQuery always called on initial render
You welcome 🙂
13 replies
TTCTheo's Typesafe Cult
•Created by conlonj25 on 2/9/2025 in #questions
useSuspenseQuery always called on initial render
Yeah I assume that too
13 replies
TTCTheo's Typesafe Cult
•Created by conlonj25 on 2/9/2025 in #questions
useSuspenseQuery always called on initial render
Idk the api syntax since I havent used trpc but you should dig dipper with the user session and look when the user is authorized and when hes not and when the components are being rendered
13 replies
TTCTheo's Typesafe Cult
•Created by conlonj25 on 2/9/2025 in #questions
useSuspenseQuery always called on initial render
Yeah as I said, since you’ve got that inside session.user then the suspense renders and then the query triggers
13 replies
TTCTheo's Typesafe Cult
•Created by conlonj25 on 2/9/2025 in #questions
useSuspenseQuery always called on initial render
In order to
useSuspenseQuery
to be called, the suspense above the component needs to be rendered.
Have you tried debugging of what is the value of session?.user
?
In my opinion there is a value that is different from null
or undefined
to session.user
and therefore the suspense component is being rendered while the user still not authorized and therefore causes you the error you're experiening13 replies
TTCTheo's Typesafe Cult
•Created by 4b47 on 2/9/2025 in #questions
Fetching data after Vercel deploy
Have you tried building your app locally and run it and see if it does the same effect?
4 replies