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

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....

Type error on Vercel prod

Can someone hint me to why this typr occurs when I try to deploy on Vercel. It works fine on local dev env....

Removing duplicate items in Planetscale

Hey everyone, I am stupid, I forget to implement a unique constraint on one of my db fields. Because of that some users registered multiple times with same value which is supposed to be unique. Now I can't lose 200 rows of data and I'm running out of time. I need to remove all duplicate items. I'm using nextjs with trpc and prisma....

Inline object do not throw type error

const merge = <S extends Record<string | number | symbol, unknown>>(source: S, target: S) => {...}
const merge = <S extends Record<string | number | symbol, unknown>>(source: S, target: S) => {...}
With the above function I would expect that typescript will complain when types do not match between the 2 arguments ```typescript...

t3-app w/ Liveblocks

Has anyone got any idea on how to integrate realtime capabilities with liveblocks onto an existing t3-app (to be precise create-t3-turbo), as well as synchronize the data from the clients and liveblocks to planetscale?

Is it secure to include the 'admin' api in the 'standard' trpc api?

I'm building a standard B2B app, which obviously has a trpc api. I'm looking to add an admin area, which allows me to manage the B2B customers. This will include tasks, like listing the customers' (confidential) data. Obviously the api route itself is going to be protected by authentication, but I still obviously wouldn't want normal users,...

Send large data (~5MB) to trpc backend

I need to build a feature that reads sqlite files in memory, my idea is to upload the file, parse it and pass it to my trpc backend that will create an in memory sqlite db to perform some queries. However, it seems passing large payloads takes ages (never finished) even locally, im not sure if trpc is not equipped to handle huge payloads. Please share if you have a solution or even a better way to do it....

Attempted to access server-side environment variable 'NODE_ENV' on the client Error

Hi, i am trying to call a trpc user mutation that will update the user settings ( name, email and avatar), whenever i call the mutation it returns the error on the title, i don't know why, if i use an alternative method ( via nextjs request ) , it works perfectly. Here's my code:

Properly call trpc from state (Mobx, Zustand etc.)

I'm currently struggling to find the proper way to use trpc, to make an api call from a state management library such as MobX. I'm fully aware of react-query, but because of the complexity of my use-case I decided to use MobX for some routes. Because of the 'useQuery' function, I came up with this (ugly) code snippet: `async getData() {...

Static type checking between resolvers and typedef

```ts // A schema is a collection of type definitions (hence "typeDefs") // that together define the "shape" of queries that are executed against // your data....

How to setup grapql(t3 stack) with typeschecking?

I want to use the @apollo/server and @apollo/client

What is the best way to type an API Response

I'm currently trying to type my API Response for a user login what would be the best way to type that response that could take either a 404 error or a successful ok response. This is somewhat correct but forces me to ensure that data is not null, but this doesn't seem like the correct approach when typing this response type. Is there a different way I can approach this by combining an error type and an ok type?...