Theo's Typesafe Cult

TTC

Theo's Typesafe Cult

Join the community to ask questions about Theo's Typesafe Cult and get answers from other members.

Join

Flutter vs. the world

Hey everyone I saw you guys seem to hate flutter, and I don't want to use this either Are there some cool techs out there to build small iOS & Android app? What do you use? I just want to play around a little bit and try things on mobile (never did mobile dev, wanna try out), are PWAs a viable option or maybe React Native? ...

Turborepo vs Yarn Workspaces

I've used yarn workspaces for a few projects, and recently been interested in turborepo. However, it seems like the tools are very similar. Are there any major advantages/disadvantages to using one or the other? Is it worth moving to Turborepo instead of workspaces for any reasons?

Error Unsupported Server Component type undefined

Hey, I'm playing around with Next 13 rn and I encountered an issues. I have my root layout.tsx Which only has the default stuff in it + my Navbar Component The page.tsx uses a server side component to fetch data from my database and display it....

share state array between pages

Hey guys so the idea is pretty simple but I'm kinda stuck to achieve this. So I have functionality when I click a button I add id to the array, when I click it again I remove the id from the array. But now I want to use this array also in different page. For context I'm trying to build a "favorite list" so I probably need to preserve this array somehow, maybe with local storage? How should I go about this?

Simple nodemailer app

So, since Gmail took the "allow less secure apps" feature off, I've been kinda lost in how to set up a free mailer with nodemailer. Does anyone have any alternative? I've tried with protonmail, but didn't work. And I don't think SendGrid solves my problem....

Next 13

With next 13 do you just replace getserverside props with the use api and leave Trpc the same for mutations / client side requests etc. ? Not planning on using it right now, just as a general question for the future...

Should I use next 13 or t3 stack for my current project (long term project)

if i do use t3, how difficult would it be to update to next 13 when it does become stable. also worried about how to use tRPC. i also def need the nested routing

React Query + Next 13 + Vercel?

Has anyone been able to deploy a site with RQ and Next 13 to Vercel? I am able to use RQ locally, both in dev and build, but when deploying to vercel, the page would return error 500. Not sure what could be the cause for me...

SWC compiler allows const variable re-assignment

I was trying out the SWC playground and I am getting no errors when I reassign a const variable. PS: when the function is not arrow function or when the code is out of that function, it throws the appropriate error....

Alternatives to redux for app state management

Hi! I know y'all don't like noobs much. But i could really use some help. Is there any better alternative to redux for app state management. Have to install 3 packages & still deal with weird lengthy syntax whenever i want to access my state.

Server side trpc call

Hi, In the attached picture, I am passing username from getserverside props down to my Profile page and I am doing a trpc call to query my db to check if the user exists. This works but I am currently displaying 'user not found' then displaying the user if they exist. I would like to carry out this call on the server so that I can avoid the lag and can display the user or 'user not found' instantly. Do you have any suggestions or tips on how I can carry this out?...

Generate Documentation based on comments TypeScript

Does anyone know a good library which generated documentation based on comments for my .ts and .tsx file / components? Tried jsdoc but that does not seems to work with typescript...

how bad of an idea is it to write to a pageViews column in the db on every pageload lmao?

how bad of an idea is it to write to a pageViews column in the db on every pageload lmao? I'd rather not pay for a 3rd party analytics tool while at a small size

Connecting entities in Prisma

I'm attempting to connect two entities in prisma which share a many-to-many relationship. I have defined the relationship in my prisma schema as an implicit many-to-many relation. It works fine if the connection does not already exist, and prisma is smart enough to ON CONFLICT DO NOTHING when it finds the connection already exists. However, it does not throw an error when this happens. As an example, my code for the route in question looks something like this: ```typescript // studentRouter...

Types error with Image component and NextAuth session

Hey, so I'm trying to display user image but typescript yells at me Type error: Type 'string | null | undefined' is not assignable to type 'string | StaticImport' Component looks like this: ```<Image
20 | src={session?.user?.image}
| ^...

Securirty issue next auth

Did anyone ever get anything like this? Google is reporting an issue on my site, I implemented auth with next auth spotify, but not sure why they're complaining about it

Importing country codes as an enum

What solutions do you recommend to deal with country field for a user profile? i was thinking about creating an enum file in the utils which i could use to import both on the frontend and the backend (prisma / postgres ) but the docs mention only hardcoding enums in the prisma.schema field (https://www.prisma.io/docs/concepts/components/prisma-schema/data-model#defining-enums) What is the best approach to avoid duplicate code? Any tips would be appreciated! Thanks!

Create-t3-app but Vue

This is m,ainly for the people that worked on creating create-t3-app going to develop an equivalent CLI for Nuxt/Vue + some other things i think are essential to an app it will be heavily inspired by create-t3-app but i also want to clone the repo, and selectively replace things therefor copying off most of the work. ...

Shadow Database Prisma & Planetscale

Hey! I've been following along with Theo's roundest pokemon app tutorial, and he makes a shadow db branch for prisma. My problem is that planetscale only allows 1 production and 1 dev branch for free users. Do I need the paid plan??