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

next js 13 request body size configuration

how to customize the maximum size of the request body in next js 13 api route ?

Wordle - Word selection

Hi! I'm currently developing a wordle clone where you are able to guess between programming languages. I am almost finished with it but there is one thing that I can't really wrap my head around. I need to find a way to select a specific solution for each day based on a certain timestamp each day. I also want it to be the same for all users. Any help is greatly appreciated 🙂...
Solution:
hash the date and convert the first couple of bits to decimal. That will be the number of this day's word in the wordlist

What projects would be good for learning backend development?

Hey all, so I asked what skills I needed to learn to be a successful backend engineer. and I was shown this roadmap https://roadmap.sh/backend Now I am wondering what projects should I aim to implement to solidify my skills. I can read about all these concepts all I want, but I learn best by implementation, just have no idea what to implement....

How can I break into backend software development?

Hey all, so I have been learning web development. But I find I am more interested in the back end then the front end of things. I would like to learn more about back end with the eventual goal of transitioning away from my current software dev role to something in the backend. What technologies would I realistically need to know for this?

[SHADCN/UI] Toaster Hydration Issues...

```tsx import { Toaster } from '@/components/ui/toaster'; import './globals.css'; import { Raleway } from 'next/font/google'; import { ThemeProvider } from '@/components/theme-provider';...
Solution:
Ok nevermind, putting the Toaster inside body fixes it I'm blind

state updating problem

Hello recently i made a custom hook that fetches the user from the db and another one that fetches data from an external api....

Pattern for Next.js path strings (App Router)

Does anyone have a good strategy for handling the paths to different pages in next? I'm using the app router but I moved some files around which adjusted the url paths for all the pages, and now I'm paranoid that I have dangling hrefs and router.push-es pointing to the old paths. Makes me think there has to be a better way to manage the strings of where things are routed. Long ago in my Ruby on Rails days they had amazing path helpers where you would never link or reference any path directly you would call a helper that would generate the path string and that way you never had to worry about linking to old paths....

TS Allow Certain Response Bodies

Hello, I would like to add a type I can use on my applications for checking the type of responses based on a zod validator. I have wrote the following type: ```ts...

How to correctly type an async Server Component in Next.js

I have a component in my Next.js project that uses async code to fetch data. ```ts const H2: FC<HTMLAttributes<HTMLHeadingElement>> = ({ className,...

What's the major difference between 'create-t3-app' and 'create-t3-turbo'?

I'm trying to create web-app first and if successful, launch an app. Which one should I go for?

remap a command of vim inside vscode

Hey how can i remap this command of vim "va{V" for selecting a functions this is what i tried but it not working: ``` { "key": "<leader>vf",...

Add Generic To Response in Next

Hi, I am trying to type my return with NextResponse.json() in a next js API route. Any idea how I can do this? Thanks!

VS Code Plugin showing gzipped size of imports

I've seen some people on streams (Ryan Carniato among others I'm pretty sure?) use a plugin for VS Code which shows a "commented" gzipped size of imports next to each import in VS Code. Anyone know what it's called?...
Solution:
It's called import cost by Wix

Pattern for Prisma Generated Types are not Serializable

I'm looking for a pattern that will help me deal with the types Prisma generates that are not serializable. The primary culprit is columns with a DateTime type which translates to the Date type on a TypeScript type. The is either at build time using GetStaticProps or run time using GetServerSideProps. And the error will be ...

easy to use chatbot tools

Heyy guyss, this is a bit unrelated to t3 or anything here hahaha. I'm just wondering if you guys know any free to use chatbot building tool? Those that can integrate into the website once its finished building.

Connect existing account with Google account

Hello I am trying to connect existing account with app with google accout with using next-auth, can somebody help and tell how can I achive it? On login page is option to login via google or email and password i want that if somedoby login with google and in database are existing user with that gmail that account are connected and login that user. I hope i write it clear

useState from TRPC Query

Hi - this is a noob question sorry. I'm wanting to create a dropdown of all the values returned by a query i.e. groups but I can't do a useState as I get Error: Rendered more hooks than during the previous render. This is my code: ```typescript...

Any good `Prisma` alternative for other languages?

Are there any good Prisma alternatives for rust, go, kotlin and java backends? I really like how Prisma generates raw sql code instead of language code, and Prisma Studio for ui to interact with DB. I'd like to use those features in my backend which is not in js/ts and use rust(or any language I mentioned above). (I'm not looking for a single solution for every language, it's good if there is one, but it's fine if every language has a different ORM that's on par with Prisma.)...

E-commerce website to master full stack Development

Hey guys, i m a normal reactjs developer ( frontend) and a intermediate django developer. I have planned a very complex e-commerce project in a markdown file. Basically i wanna create this as a personal project to master some technologies like ( Frontend, Backend, Postgresql) i have some options and i confused between them. Please explain me that what stack is best for my learning project and why should I use that instead of two others ...

React not updating the attribute for an HTML element

I've done all the sanity checks. I'm passing a placeholder to an <input /> element. console.log? prop is changing React dev tools? prop is changing Production? prop is not changing (the above two still show the change) ...