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

Question about implementing inline search filters

Does anybody have suggestions on implementing inline search box parameters? i.e. if you are searching issues in a github repo there's stuff like is:open author:username archived:false etc... is there any recommended reading on how to implement parsing these types of entries into the field? Do you basically just scan for 'parameter:query' and then just space-delimit it to separate the search terms from the filters/parameters?...

Support for ESM 3rd party npm modules

Hi all, I'm between a rock and a hard place. I've created my app using:...

trpc or react-query like set-up for just 1 time calls

Right now I have a handler under /api/something and then I fetch(' /api/something') inside useEffect(). Is there a way to use trpc/react query to just do an api call *once like useEffect(() => {}, []) empty dependency array??

What would people want from an 'S3 but nice to use' ?

What would people actually want different? How would you ideally interact with it? What could they add?

Is the server a 'custom server'

I'd like to understand how vercel prices the deployment - Is the server custom (https://nextjs.org/docs/advanced-features/custom-server), I.E would it be running at all times once you deploy to vercel, or does it start only @ the RPC invocation? - If it does only start for each invocation, I'm guessing something like a local sqlite DB wouldn't work with this setup, as it wouldn't persist between teardowns?...

Tanstack tables giving errors during deployment on vercel?

Does anybody know how to interpret these errors?

help with firebase

firebase auth invalid api key error when using the app. The key is correct, any idea why is this happening?...

Is this intended JS behavior?

Came across this problem when using switch statements. Doesnt seem like each case has its own scope, however, you cannot access a variable outside of the case it was defined in (which i wasnt expecting to be able to do anyway, but if i did it would at least make sense) despite not being able to share variable names from case to case. Take the following example ```js function test() {...

NextJS Per Page Layouts

So I got per page layouts working (using pages directory method) following the docs, but I cannot figure out how this is working for the life of me. Can anyone explain the types and the general idea of what is going on here? I would highly appreciate it. Thanks...

Anyone know a good way of diagnosing Nextjs hydration mismatch errors

I am familiar with some of the reasons listed here: https://nextjs.org/docs/messages/react-hydration-error I was wondering if there was some intellisense extension or resource I could use to identify the issue quickly....

Plugin system

Hi! i have and idea of a app and am thinking of having a plugin based system i think i have an idea how to do this when if am making all the plugins myself but what am wondering is how do one go about if i want others to also be able to create plugins for my app. Does anyone know of an opensource project that does this or any article or videos that talks about this?...

Type error with tRPC, Zod, Prisma

Hey guys, I'm new to Typescript and the t3-stack and I cannot seem to figure out how to solve this error. How do I delcare the correct type for this "userId" input? The error reads: (property) userId?: string | Prisma.StringNullableFilter | null | undefined Type '{ id: string; }' is not assignable to type 'string | StringNullableFilter | null | undefined'.ts(2322)...

Best practices or course on writing a production-grade NextJS backend?

Hey all! I've spent most of my career in the frontend so I'm pretty familiar with React. Recently I was able to get buy in for migrating our Express backend to Nextjs after watching Theo's Next Conf + it not really ever making sense that we have a separate backend to begin with. I was wondering if anyone had recommendations for courses or readings on how to organize a Nextjs backend, with naming convention, proper error handling, custom middlewares (not using nextjs' middleware.ts), how to organize a backend project along with scripts, integrating with third party services like queues etc ...

Question about storing data for a substack-like clone?

I'm working on a pet project wherein users can write posts with a full markdown editor. I'm curious if anyone knows how best to store these in the backend? Do you save the content as a .md file? or save it as plain text in the DB?? Am I making sense? Basically what's the ideal way to store user-generated markdown content...

Is SQLite really faster reads than MySQL (in low concurrency apps)?

Tested with local DBs and same prisma frontend MySQL had 5-6 times the loading times for big sort queries (top 100 of a huge scoreboard).

Has anyone faced Error read EINVAL when deploying NextJs to CPanel?

I'm trying to deploy NextJs application to CPanel, followed official documentation on creating a custom server, getting Error read EINVAL code in logs.

does using github co pilot always makes me a noob ?

I recently started using github co pilot and now i am becoming to lazy to type etc because most times it predictions are so accurate Is this a bad idea?...

Nextjs sitemap header error

I am generating my sitemap using this package: https://github.com/iamvishnusankar/next-sitemap I have following: ```ts const setHeader = async (context: GetServerSidePropsContext, chunk: { loc: string }[]) => {...

Should I upgrade my Next12 T3 project to v13? I am not going to use App folder

I do want to upgrade my project next12 to v13 but I am worrying to do it. Will there be any problems? I want to use Next Font