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

Adding next.js plugin to T3?

if I want to add a next plugin to t3 do I just add it to the arg in defineNextConfig?

Next.js multi zones and shared components

I am using Next.js' multi zone feature with a blog and web app so I can develop and deploy both apps independently. It was easy to set up by following their example and I have set up a blog app at port 3000 and a web app at port 4200, which is working fine. Unfortunately I am encountering some problems that aren't described anywhere in their documentation (as far as I can tell). I am working in a monorepo and have shared components between both apps, such as the header and footer, which obviously includes navigation. When I am on the blog and want to navigate to e.g. the /about page, then it will obviously navigate to localhost:3000/blog/about instead of localhost:3000/about. One solution is to check the base path in the navigation component and then prepend localhost:3000 to the href if the base path equals blog, but that refreshes the entire app and does not result in smooth navigation, so it's not really ideal. Is there anything else can I do about this?...

Generating a Layout with main AND sidebar content??

How would I go about creating a <Layout /> that will allow me to pass in children to define the body content AND sidebar content? So I'm expecting each page to have the Header, provided by the Layout, and then two children. The first child will be the body content, the second will be the sidebar. Is there a way to write a Layout that will accept specific children in specific places?

Analytics Platform

Hello, what analytics platform do you guys recommend to use? I thought of maybe using Google Analytics but saw in the past that countries were trying to ban them.

Super lightweight JS(X) parser?

Are there any good, super simple and basic JS parsers that can do typescript and JSX? I'm looking to basically parse strings of code that could contain a specific function, and grab the input to that function.

What does Preline UI actually do?

I'm trying to get my stack together for my next project. I've been using MUI + CRA for a while and I would like to try to rewrite it with better underlying tech. Theo mentioned DaisyUI and Preline UI for styling components and Headless UI for giving components reasonable behaviors. I've been experimenting with all of them so far I've concluded: - Headless UI seems very cool and immediately useful - DaisyUI is OK, but I was disappointed with customizing the components. Some of their css classes have high specificity so I couldn't override them in tailwind without adding ! in a lot of places. Their animations also seemed to not work with Headless UI. The library also seems to try to do more than just styling by how it uses hidden checkboxes to control components like accordions. I'm confused because that seems like it would go against Theo's Venn diagram from his video. - All that said, Preline UI is the one I'm most confused about. Their website seems to just have a bunch of normal tailwind classes. I can just copy / paste them into my code and they work fine....

Is t3 stack good for serverless

Is everything in t3 good for serverless without having any cold starts?

Am I doing Prisma relations right?

I'm mostly experienced with front-end dev so I'm less confident with data modeling decisions. Attached is some additions to the model I'm building. I'm working on an app where users can write stories and the stories can have multiple chapters. Attached is an image of the Story and Chapter models as I think they need to be. Am I in the right direction or no? Is there anything you would do differently to implement such relationships?...

Why can i click through a disabled button with ontouchstart event?

If im using onclick, my disabled button doesnt fire the onclick but if i use ontouchstart and i touch a disabled button, it still fires my ontouchstart event. Why is this and how can i prevent it?

my VSCODE broke

anyone know wtf is happening to my vscode, autocomplete is not working correctly and the syntax colors are weird and i tried it on many projects still doing this it not the theme and i tried to reinstall it still the same...

dynamic react components wont render

I'm trying to dynamically render a collection of react components. and I can't just pass the components in an array. so I only pass the name of the components and them I try to convert that name to jsx. ```js import Component from "./component"; ...

Nextjs hostname is not configured under images in next.config.js

Hey I am getting the following error when trying to display a discord image on my website through their cdn `` on next/image, hostname "cdn.discordapp.com" is not configured under images in your next.config.js`...

Syncing user 3rd party data with db (for example user's Twitter DMs)

So this is just an example, but imagine I have an app where users can log in with their Twitter account and see their Twitter DMs. I want them to be able to add a note to each conversation, so I need to sync this information to my database (when the user is offline as well). Do I just have a cron job that periodically checks for each user if they have any new DMs and then adds this to my database? I feel like I am overthinking this lol

Move a domain to Vercel??

I'm currently using namecheap to register my domain and just pointing it to vercel to manage subdomains and that kind of stuff there. And since my domain is expiring soon I'm thinking about transferring it. Does anyone have experience on transferring a domain to Vercel? I didn't find a lot in about pricing other than "registering is usually 20 bucks" so I'd love to hear what yall know/think about it. Also, any other good providers??...

Eslint and Prettier. I actually don't know where else to ask this, I'm going insane.

I actually don't understand what's going on with my eslint/prettier config. My coworker is using the same files I pushed, but he gets errors where I don't, I get errors where he doesn't. On top of that, my prettier won't prettify .ts files for whatever reason, but his will. I did add *.ts in the configs...

Prisma object undefined on mutation

My schemas look like this ``` model Idea { id String @id @default(cuid()) title String description String...

Would I Still Use T3's next-auth Setup

Hello everyone I'm trying to figure out if the t3 next-auth setup would be used in my use case scenario. Im trying to create a web app that requires no sign in or log in. The users of the site would just go onto the website and use it to buy something and get an order then thats it, no log in required. I assume that a session is required for this to save their order data just in case they accidentally close the window, other than that I would like the order data to be deleted with the session. Im not actually creating users and saving them. Im simply storing order data on the session. Would the t3 next-auth setup be used in this case?...

MUI v4 + TailwindCSS OR MUI v5?

Currently have entire dashboard in MUI v4, do you think will it be good to start mixing tailwind on top of it or just go MUI v5?

Is tRPC a good choice for typesafe communication between two backends?

(when talking about interservice and between services and "gateways/primary service", theo said)
Do not use tRPC here, you are making a mistake https://youtu.be/jd5JwXoDXFo?t=202
what other typesafe ways can this be done for between a nextjs backend and another app that's always running?...

JS Classes and This

I'm curious if there is a way to avoid using arrow functions for methods you want to keep bound to the instance. For example, ```ts class Pog{ works = () => console.log(this)...