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

App Router & tRPC Server Cache

How do you handle caching server queries with tRPC? I refuse to believe there's no good & easy way to do that. What am I missing? Client Components feel faster as it's easy to cache the response on client. Server Components feel fast on first load but trigger queries on every render, making it feel slower. Currently using:...

How NextJS REALLY Works

Is this still good video to understand how Next actually works?
No description

How to get Auth.js 5.0.0 beta middleware to work with Next + tRPC

I have a long time project with Next, tRPC, Prisma and NextAuth, that worked flawlesly on Next 14, Prisma 5.x and NextAuth 4.x. Now I initialized another create t3 app and I'm trying to figure it out for hours already. I was using middleware before to handle my route protection, but this time middleware, according to the official docs, will in the end have to use the authConfigthat has PrismaAdapter (@prisma/client) inside, and thus it throws an error, saying that Prisma can't work in runtime. My tRPC procedures are protected with the default protectedProcedure that comes out of the box with create t3 App, but I just can't figure it out how to use the middleware in Auth.js 5.0 ...

Custom Hooks using tRPC API

I want to create a custom hook with the function I created in tRPC routes. ` getUserDetails: privateProcedure.query(async ({ c, ctx }) => { const user = await db.user.findFirst({ where: { email: ctx.user.email,...
No description

How to improve Next.js performance after latest Theo video on why Nextjs is slow?

In his latest video, he highlights that it's probably bad if a page is Dynamically server rendered on demand (has the f symbol on the build output): https://youtu.be/mMQCLQTky34?t=2244 I tried it on my app, and literally every single page is ƒ (Dynamic) server-rendered on demand What is going on and how can I fix that. In the screenshot provided, I am literally just rendering "hello" - why isn't that statically prerendered? Is it because of something in my root layout.tsx maybe?...
No description

Any advice

Hey! Im 22 years old about to finish college and been applying to Web dev jobs since last summer. I have been very unlucky and not gotten a single interview only rejections. Do anyone who has been in same situation have any advice! I would appreciate any advice, starting to lose hope but, trying to stay strong!! Take care!...

How to config test in the t3 App?

Good afternoon, how are you? I'm trying to configure my Next.js project with tRPC to run tests. I've tried following the documentation for Jest, Vitest, and even the official documentation at this link: https://create.t3.gg/en/usage/trpc#sample-integration-test I’m not sure what I’m doing wrong — I’ve tried many different approaches. Could someone share a step-by-step video or a more complete tutorial?...

Dealing with AWS Lambda concurrency limit

Anyone running their API's in lambda at scale, how are you dealing with the per account concurrency limit? We have a failed attempt at microservices at my job and I'm trying to revamp our architecture to allow us to scale up in the near future. We have a few things running in lambda already but as we grow I'm worried about how the concurrency limits will impact us....

Need help to integrate Odoo in our system

I'm building deaf people interpreting service system using Angular/Spring boot. Now we're on final stage and I'm going to use Odoo plugins for invoice & payment system. I had some digging and could have some knowledge about Odoo. It provides XML-RPC based api for the model connections. But I'm not sure how can I integrate exactly. I'm going to install own Odoo system and would like integrate it with backend side. If anyone has experience, please boost me....

Playwright Electron (Vite) returning the DevTools window instead of the main window

When running a very basic playwright test on electron, for som reason firstWindow() is returning the devtools window. ```import { test, expect, _electron as electron } from "@playwright/test"; import path from "path"; ...
No description

Playground for mock api

Hello, i have to create a playground simulation similar to this https://docs.validis.com/docs/validis-api/66dd45bc69103-get-connectors WHat would be the most optimal way to go about it? The working of the authentication, parameter and response is something i have to take as per requirement but are there any third party libraries which i can use for my particular requirement? ...

How are you supposed to handle loading states for trpc (useQuery) calls in client comps in Next?

I have a client component that calls for data via trpc. I extract isLoading from those useQuery calls and then I want to display a loading skeleton while the data is loading. However, when I follow the normal React render pattern (check isLoading -> render skeleton; check if data empty -> render null; otherwise render content), I get an error about hydration failing because inital UI does not match server-rendered UI. I think this is because the isLoading state is always false on the server. This isn't an issue in standard React (non-RSC), because you make your useQuery call before trying to render anything, so isLoading is already true before you reach that render pattern logic. ...

VSCode theme

i always wanted to know, what is Theo's theme for his editor?

What’s the point of leetcode style interviews?

I can code, I build good products with great performance and good UX, I understand data structures and algorithms and know when to use what. Leetcode feels like trivia to me, and I despise trivia. Currently looking to get a new job since I won’t have one around July, and I have to grind leetcode questions instead of spending that time doing things that interest me and learning new things. I’m about 60 questions in, I hate every single part of it, it’s just frustrating and annoying and I feel like I could do better things with my time....

Elixir/Phoenix Journey - Share Your Wisdom!

Hello! I'm venturing into the world of Elixir and Phoenix (coming from a Next.js background), and it's both exciting and a little daunting. The learning curve feels pretty steep! I'm curious to hear from those of you with Elixir/Phoenix experience, especially anyone who's made a similar transition from Next: what were your biggest "aha!" moments, what resources really helped you level up, and what was the trickiest thing to wrap your head around at first? I'm open to any and all suggestions – books, videos, hidden gem websites, anything! Thanks!...

Trpc setup in Monorepo

Can someone help me with Trpc setup in monorepo (turborepo) with nextjs frontend. Any resources will be helpful.

HeroUI or shadcn

regarding theos new video on styling Would love to hear people's thoughts on HeroUI. He mentioned "you can just style things yourself", but for a small team, I feel that might not make sense when you don't want to spend limited resources on styling and adding functionality/props to primitive components. am someone leading a tech team migrating from MUI and deciding if we should be using heroui or shadcn...

Looking for developer/devops

Im looking to automate the backend of an anime streaming website pretty much needs to grab the best sources from indexers like nya download them into folders, organize, name, encode, remux etc.. and make the videos available (through sonarr or whatever is best) Let me know if you're familiar we can have a call ...

need help with setuping msw

Hey folks I want to integrate msw in my Next App to mock the resend API currently I have mock directory inside the src directory and have these files resend.ts ```ts import { http, HttpResponse, type HttpHandler } from "msw"; import { z } from "zod";...
No description

importing server types inside the client, is that unsafe?

Sometimes I have shared util functions in my server directory, or some types from my schema. I am importing these in client side components. Is this unsafe? coulnd't find much info about it. Thanks in advance