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

Revalidate prisma query in `page.ts` RSC

I'm getting the same data every time I visit this route. ```typescript import { prisma } from "@acme/db"; import EditForm from "./edit-form"; ...

Should zod schema names start with an uppercase letter or not?

What is the general guideline for naming zod schemas. In the docs there seem to be examples using capitalized names as well as lowercase names, thus I was wondering what naming convention the community decided upon. This example uses lowecase userSchema: ```ts import { z } from "zod";...

Noob question: NextJS DI to avoid prop drilling?

I'm working on a project were we have a lot of props being drilled >A >B >C >D...

Turborepo compiling issues

So we are working on a project, which i just migrated to a mono repo. Before we had 4 repos (API, admin, customer, website) now they are combined in a single (turbo)repo. So under apps/* are these old repos. Since we are using some UI stuff in all of our websites (not the api of course, but there we whould also use stuff like shared helper functions), i want to refactore the code.For example i made a file on the root level with some standard helper functions, no problem yet (i hope this still works on deployment, because of building phase cloning the entire repo not just the apps/api-part e.g.). Now the problem : i want to extract components like buttons, cards and so on, into the "ui" package, so i also need next, react-icons and so on as a dependency there. these components are then getting imported from the different frontends....

How to hide database ip when using tRPC + Prisma

Solution:
can you remove the stack and the shape.message from the error before returning for the client?

Need advice on tutorial for t3

Need advice on what tutorial is great . i wanna build a inventory management system

Noob question about astro

Hey all. Looking if is there anyone I can bounce some questions to. I've been learning Astro. Doing a small app from scratch so I can learn the workings of the platform. I am an experienced developer but not with Javascript so this is a new world for me. I have a backend in pocketbase. Astro as "glue" and I am thinking on using Solid in the client. Got over the routing part easily, done auth verification and I am now starting with client interactivity. I am building the login form. My question: I have 3 possible ways...

Good Role-Based Access Control (RBAC) package?

Heyah, Are there any good recommendation for an rbac package that handles roles and permission from DB/ORM/X? Something like what exists in Laravel's ecosystem with API for user.can(permission) user.has(role)? I need this for some prototyping down the line and checking before I implement my own....

Trouble getting additional information passed back on the useSession sessionData

I am new to these techs and trying to get a first project working. I am using the Discord auth. I have logged the user.id on the sessionData from useSession but it does not match the discord id of the user. I enabled debugging and can see that the 'OAUTH_CALLBACK_RESPONSE' contains a profile property with the id I am looking for inside of it. I have poked around docs and found a few tutorials on how to add additional attributes to the session but no luck. Can anyone point me in the right direction?...

audio setup recommendation

Hello everyone I am looking into investing into microphone(s) for making videos and conducting interviews. I have a few questions 1. For a interview/podcast scenario, I am thinking purchacing 2 microphones. Can I make do with 1? 2. After a bit of research I settled on the Samson q2u mic which is currently 50usd on amazon. At the prices range of 50-100$ is there a better value microphone?...

What are the down side of using docker?

I was wondering the down side of using docker, I've never heard theo opinion on docker. I would love to hear y'all opinions on it. I am brand new to docker....

Server component state management?

Would there be a way to get the benefits of the server components while using a state management library?

modals don't work on create-t3-turbo

https://github.com/HonestCodeWasTaken/test-headlessui-modal I dont really understand why creating a project and installing headless ui leads to this obviously this makes no sense, on my other project that uses create-t3-turbo structure it works properly....

ct3a stack equivalent for iOS *native* apps

Thinking about spending a weekend learning swift/uikit for fun, but what’s the full stack equivalent of ct3a for iPhone? Hopefully the intent behind this question is clear.

Prevent ts server from crashing every 5 mins

How to prevent ts server from crashing every 5 mins ?

Using revalidate on a page fails build

export const revalidate=60 Hello, using any number other than 0 will give [ECONNREFUSED] Is there anyone with additional info for this?...

trpc useQuery adds "?" to the url every fetch, refreshing the page and resetting the state

I am using create-t3-app with all the included "addons" ```tsx // snippet from my pages/admin.tsx const context = api.useContext();...
Solution:
submitting a form natively "reloads" the page, because it is meant to "send data" by requesting the "next page". The "next page" can actually be configured with the action attribute on the form. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form#action I'm putting lots of quotes everywhere because it's how we used to do things in the olden days of the web. Now if you don't want this behavior you should add a event.preventDefault() on the submit event of the form (which you might already be using to trigger your mutation so it should be straightforward) ```jsx...

react-filter-box

Is anyone aware of a package that does what react-filter-box does? react-filter-box has many issues and doesn't work well with Next

ESLint running on CSS?

0:0 error Parsing error: ESLint was configured to run on `<tsconfigRootDir>/src/styles/globals.css` using `parserOptions.project`: /path/to/project/tsconfig.json
The extension for the file (`.css`) is non-standard. You should add `parserOptions.extraFileExtensions` to your config
0:0 error Parsing error: ESLint was configured to run on `<tsconfigRootDir>/src/styles/globals.css` using `parserOptions.project`: /path/to/project/tsconfig.json
The extension for the file (`.css`) is non-standard. You should add `parserOptions.extraFileExtensions` to your config
...

Analytics w/ RSC

Trying out the App Router for my blogsite. My blogsite is mostly a static website and is a perfect candidate for RSC. However, I do a lot of tracking about interactions on my blog page - e.g. if you click a link to another blog post, I send an analytics event for a BUNCH of data. These events are sent on the onClick event handler of the <a> tag. Now the blog link is a completely static component that is perfect for RSC, but I also would have to send JS to do that tracking. How should I build this ? I hate to convert this to a client side component. It feels weird to send Javascript w/ a component for purely tracking purposes that does nothing to the UX. A static link, on paper, should be the perfect candidate to send 0 JS w/ it. ...