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

Is it possible to host (blog.abc.com on astro) and (abc.com on nextjs vercel) ?

What is the standard practice for folks who build websites that have corresponding blog's.

How do I update my old t3 app to be in line with the most recent changes?

Seeing Theo's recent video, I see that t3 has gone through a few changes and improvements. How can I update it to the latest version safely?

Benefits of NextPage type

As in the title. What are benefits of typing our next pages with NextPage type. (Next 13, pages dir) The only one I see is that I have to return JSX but since react 18 React.FC type does the same and not intentionaly types children why wouldn't I use it insead of NextPage?...

How to create a cli like create-t3-app?

I am hoping to create a template similar to create-t3-app which is inspired by t3-stack as well but with my personalised spin on it. I know how to create CLIs but I was wondering if there are any tips/shortcuts/suggestions that I can use to create it without wanting to kill myself. Please help me out. 🙂

Creating polygons with borders in HTML and CSS

I have spent the better part of the day trying to come up with a robust way to create polygons with a consistent border on HTML / CSS. I have tried 4 different methods so far which are all pretty inadequate. which can be found here: https://jsfiddle.net/op78fv6n/84/ Can someone help me figure out how to do this in a sane way?...

Correct way to get data based on email

Hello experimenting with t3-stack, What would be the correct way to query from my submissions table by checking if an email exists within the table ? ``` getSubmissionData: publicProcedure...

Are query keys supported in tRPC?

I'm getting an error when trying to use one on the query as per the react-query guide (https://tanstack.com/query/v4/docs/react/guides/query-keys). The trpc docs 404 which is odd https://trpc.io/docs/query-invalidation...

trpc - Calling a route inside itself

Based on the documentation here, you can call another route on the server side using:
const caller = route.createCaller({})
const caller = route.createCaller({})

However, if the route is within itself, is it possible to do so using the this keyword? If not, how can one call a route sibling?...

TimeZone issue

'TZ' is not recognized as an internal or external command I am on windows is there a way I can fix this?...

can u make twitch clone with t3 stack

im just curious if this is possible or not and would the performance be acceptable? not asking how to do that...

Prisma & CockroachDB - push to array

next 12, prisma 4.7.1, CockroachDB When I try to push an item to an array field, I get an error: "Did you mean set?": ``` await prisma.character.update({...

Weird State Performance Issue

Hello, I am working on a project right now where I have a list of components that are based off of a zustand state object. Each of these components in the list is assigned to a specific <key, value> in the zustand state object, and state is updated whenever one of the form items is changed. I am running into a performance issue with this however, since every time a form value changes it re-renders the entire list of components. Most of the changes I am making to the state however, do update the file object but not the values from the object that actually get rendered (the component updates more metadata-esque items). I have attached a diagram that I think might help explain this a little better. Does anyone have any recommendations on how to make this more performant? Thanks in advance for the help!...

How bad is revealing ids really?

Hey, I am currently not using DTOs or sth similar. And I was wondering how bad it really is if i expose my primary keys of a table in my frontend by giving over the whole object returned by the prisma client. I know it's bad practice and seen as a security breach ... but I never fully understood why. If I send a DTO with the same values but some uuid instead of the id (primary key) i still have to persist the uuid in the table and although it is not the primary key ... it is still an identifier that i have to use and a "hacker" could use too....

how to delete post if it has likes

Hello lets say I have a post that i want the user to be able to delete, however the post also can have likes. If I use something like this: ``` delete: protectedProcedure .input(z.object({ postId: z.string(), }))...

Recommended pattern for consolidating data in tRPC?

Hey all, is there a recommended pattern for consolidating data so that the format of the data in the output is consistent? Currently building a standard t3 app and am considering using either links or a context dedicated to formatting the output of the data...

Tailwind Default Colors not showing automatically

When I use something like bg-gray-800 it's not showing up. If I go and add it explicitly in my tailwind.config.js, it works. But they're all suppose to show up by default, correct? Did I configure tailwind incorrectly when I used T3? ``` const colors = require('tailwindcss/colors') /** @type {import('tailwindcss').Config} */...

React Select - Unselect and remove placeholder when clearing input

Hello, When I select something and then delete the input, it still shows the chosen option in the placeholder and does not remove the chosen option. I want to unchoose the chosen option when the input changes and not show the chosen option in the placeholder when input is empty....

Scss in Next without modules?

Surprisingly difficult to find an answer for this when i was googling. Here's the situation as ive been taught in previous jobs: Say i have a component <MyComponent /> and i expect some default styles for this, defined in a mycomponent.scss file like: `.MyComponent {...

Promise-returning function provided to attribute where a void return was expected.

On line 18 of https://pastebin.com/9EXv58Bn I am getting the error shown in the title. Should I just disable this eslint error with // eslint-disable-next-line @typescript-eslint/no-misused-promises as suggested in the "Quick Fix" ? Or update the default .eslintrc.json provided by create-t3-app?