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

Best CSS for this design

What would people say the best CSS for the following would be

TypeScript Intellisense is incredibly slow

I recently scaffolded a t3 app (manually, existing codebase) and found that the TypeScript Intellisense is incredibly slow. I am on a Macbook Air M1, and the only other thing running in the background is a Docker container housing a Postgres server. This makes it really hard to use TypeScript because I have to wait 10 seconds to get any autocomplete or intellisense. Copilot outpaces TypeScript by a good 5 seconds. I did some reading and heard that this could be caused by zod, but wanted to ask here first to see if anyone else has had similar problems....

Type a function based on its argument value.

I have a function that takes an object and a boolean (default to false). It will return an array of object with key id only if parameter bool of the function set to true. ```ts const helpMeTypeThis = (obj: MyObj, bool = false)...

mutation is returning void

I made a procedure that returns a string, but when I try to use it on my frontend, it's returning void instead of a string.

When I setup TRPC, is React Query pretty much being setup alongside it?

I moved a CRA app over to T3. In the CRA app I was using React Query to cache my data. After starting to use TRPC I realized that it's basically using React Query in the background. Is there basically no need now to do anything with React Query separately from TRPC?...

New to fullstack

So..uhh. New to full stack. Are there any frameworks I should be using? Javascript, CSS or other wise? What are states? Why does type safty matter? What are some things I should learn and deep dive in? ...

Presigned URLs (S3 upload): file type verification, image transformation & cleanup/delete

When implementing S3 upload, a lot of examples I've found (and also Theo's recommendation afaik) are using presigned URLs. Maybe I'm missing something, but I have three questions about this: 1. Verify file type S3 allows to restrict the "content type", so e.g. only jpg or png. But it does not actually check the file itself, only the extension (as part of the file name). Users can upload .png files that are actually .txt files, just by renaming the file. You cannot check the MIME type without a server inbetween. ...

React Carousel Library

Anybody able to recommend a good carousel react library. I'm having a difficult time finding a decent one

prisma adapter refresh token rotation

I read https://github.com/nextauthjs/next-auth/discussions/3096 And as MatthieuVeillon said is there a solution that works when the user is still logged on or any better solutions?...

Middleware doesn't load the `server.mjs` variables

I have the followinng middleware in src/middleware.ts ``` import {NextRequest, NextResponse} from 'next/server' import {env} from 'src/env/server.mjs'...

NextJS + Supabase question: createBrowserSupabaseClient vs useSupabaseClient NextJS hooks

Hello, I'm wondering if there's any issues if I decide to use createBrowserSupabaseClient everytime I need to fetch something from a function outside of a React component? As an example, I have my own custom useUser hook that basically fetches the user using Supabase and caches it using React Query. It looks like this: import { createBrowserSupabaseClient } from "@supabase/auth-helpers-nextjs";...

Next-Auth CLIENT_FETCH_ERROR | Webpack crashes

Hi, i'm wondering if someone could help me resolve an issue i'm having with Next-Auth. I recently created a T3 project and i've been working on moving it to my monorepo so I could create a little sandbox app for some TRPC testing and stuff. When I run my new app alone it works fine and everything is perfect, however when I move this project into my monorepo things get a bit weird, it seems that any time I attempt to access any auth routes my project just crashes without any useful errors. The only error I get is [next-auth][error][CLIENT_FETCH_ERROR] "Failed to fetch" "TypeError" (I've attached the stack as a file) and then Webpack just shits the bed without telling me why. I've attached my repo below just in-case anyone wants to read it, the project i'm trying to run in the repo is Robin. Also I noticed if I switch my auth url to 127.0.0.0:3000 i'm able to then sign in and it gets session fine, however the app will then crash on the callback. https://github.com/Rafcin/oxygen/tree/dev...

Cannot use `useState` inside of callback?

I'm getting this error even though im using it inside a function that returns JSX.Element... No errors in my dev environment, only the vercel linter is saying it fails to compile

How can I make this component only animate when children change

How can I make sure InfoChipContainer only animates when the chips change. I'm out of things I can memoize: ```ts interface InfoChipProps { style?: CSSProperties;...

how do big tech companies carry out updates and upgrades with downtime?

Lets say for example i deployed my website on vps So whenever update a ui I have to take down the website then run npm run build then take the site back up It's all automated though ...

type "number" cant be used to index list

Im getting this error, help would be great!

ExpressJS router not working

Login.js ```js const express = require("express"); const database = require("../database.js")...

recommendations for writing a simple & scalable notification system?

i'm working on a blog/forum site & about to start on a simple notification system that sends out notifications to followers when an author publishes a post i was thinking of just creating a little temporary store in my database, creating a notification document with a unique in it, & then appending the id of that document into a follower's notifications list in code i guess it would look something like...

Any way to share auth between a t3 app and a native iOS and android apps?

Hey guys, this is probably a noob question, but let my try and clarify the situation: Context: I have been building a web app using the t3 stack for a while now and I love it. Now I’m thinking about mobile, and I’m leaning towards making native mobile apps (iOS and android, not react native/expo) Why?: I’m a new developer so I wanna get some round experience to see what I like the most so I can know what to really focus on. Also (and most importantly) I need some native sdks for some camera things I need both apps doing....