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

Eslint Setup?

I added a eslint config file which looks like this to my t3 project: ```ts { "env": { "browser": true,...

Tiptap vs. Lexical

Need a WYSIWYG editor, but never used one outside of Quill.js which was pretty shit. Seen Tiptap and Lexicall reccommended. Also using react-hook-form. Any other recommendations? Experience using them with RHF?

Reduce problem

Someone that has a clean solution for this? I have this data structure: ```ts posts: Post[]...

integration

Super don't know where / how to ask this but any of the Sr's here ever had to do any Google/Microsoft API integrations? We've got a multi-tenant platform we're trying to leverage Microsofts Graph API to sync calendar events of users with our DB (for a calendar events page we'll build out)... I've built Google Contacts integration and a co-worker did our MSTeams Bot but in both cases we've had to leverage a per user OAuth flow which means double login's for our users......

CSS EFFECT

Hi, I am building a website inspired in Cyberpunk 2077. I am using some things from their site as a reference, and they have a pretty cool effect on hover that seems like a cyber thing that I would like to implement on my site, but I have no idea how to build this. If someone could help me with it would be awesome.

TRPC mutation example with relationships

Hey, I'm building an e-commerce site as a side project but I'm not sure how to make use of the mutation method with relationships. Have anyone seen an example that handles these cases? This would be step where the user has entered his details in a form and I already have the Product(s) in the cart global state. My prisma schema is something like this:...

TypeScript adoption at work

I'm a more junior developer with just about three years of experience. Recently, we were given the go-ahead to start using TypeScript for a newer more green field project to test the waters. I think it's been a great experience, and has given me more confidence in the robustness of my code, and in the safety of my refactoring. Currently, something of a round table is happening where devs from various teams are being asked about whether we should use TS for a shared component library that is being started. There's some pushback from some of the more senior developers, in particular one who stated "The kinds of errors that type safety is intended to assist in the prevention of are generally avoidable with good coding practices.". Obviously I'm not going to die on this hill. I'm perfectly fine with the conclusion that different teams can make the decision for themselves, and that it should not be enforced necessarily. However, being a bit newer, I want to make sure I'm accurately presenting the biggest advantages. Does anyone have any advice on how to respond to that sentiment, or the sorts of things I can bring up in support? Thanks, have a great day!...

Is there something like create-t3-app for electronJS?

So I guess ts, trpc, tailwind, react, prisma, webpack(?)

Filtering in React-Query & Trpc?

Say I have a filter on my frontend. I have an option to get all the users who are blue or all the users who are red. In the front-end, I pass that filter value into react-query and in the backend I use that passed-down filter value in my prisma call to my database. In trpc/react-query I do: ```javascript...

JS library for visualizing & interacting with graph db

Does anyone know if there is a good npm package or some other good off the shelf solution for visualizing and interacting with relations in a graph database? For example with a role based access system, figuring out through which edges someone has access to a role, and changing this. We're using Memgraph, which uses the same Cypher query language as Neo4j.

Using Rust with Turborepo project

Hey guys! I'm building a relatively big monorepo app. It contains NextJS app, Expo app and other parts of create-t3-turbo. However, I need to build a microservice (I'd love to have it in Rust). It's just going to be a algorithm for my backend....

what is the best way to redirect the user to login page in CSR?

I have this jamstack app and I want to redirect unauthenticated user to the login page, in case the session expired he still have the code in the browser to do certain actions. but the cookie is not there. so in the server I only send a response with 200 status. that says {redirect: true}. and I act in the front based on that. is this a good way to do it? or is there a more standard way?...

TRPC mutates the data in the backend but doesn't rerender on the client? (shows stale data)

I have a very simple useQuery call and a very simple mutation I am doing: ```js const mutation = trpc.item.update.useMutation(); ...

trpc.useQuery() doesn't have keys like with react-query?

I'm using trpc.useQuery() to get the user and was thinking of using a key like with react-query so I can query the cache for the user again later. However, from what I can see, it looks like there's no keys when using useQuery on trpc? If that's the case, is it good practice to store the user in context when using trpc? I wanted to avoid doing that if I can let react-query be my state manager. Ultimately, (1) does useQuery() have a key value cache function? If not, (2) is it bad to useContext to store the user?...

datepicker recommendations

Hi, does anyone have suggestions for a datepicker that supports time and works on all the basic browsers? It'd be great if it's also decently stylable (tailwind)

Help Needed with nested Comment Schema

Hey frens. I'm building a stack overflow clone for poultry farmers. For a commenting system, how should I go about modeling comments, and their replies? I watched a great tutorial by MonsterLessons Academy. https://www.youtube.com/watch?v=sjAeLwuezxo ...

Do I need to transfer react-query (trpc) values into local state first, if I want editable Inputs?

I am learning react-query and I get roughly how it works when I'm fetching & mutating some very simple data. What I don't understand is this: Say I have a Settings Page with multiple input fields where users can change their names, addresses and other things. Now I would love to put the data I get from react-query directly into a <Input value={data.name} />, but since the user will maybe want to change that data, I will need to have some way of updating it....

Help Simplifying this Type

Can anyone help me simplify this so that I only need to specify the 2nd parameter. Key and Key2 are always the same, I just needed to add additional constraints to Key and this was the only way I could figure out how to do it. FieldValues, ArrayPath, PathValue, and Control are all from react-hook-form if it matters. ```ts...

[SOLVED] How to get data using useQuery, then update it using useMutation without reseting inputs?

I'm using React-hook-forms in combination with T3v10 and I've come to a problem I don't have a solution to.... It's essentially a user profile form. I want to get the user's data with useQuery, then set those values as the default ones for the inputs, and when it's saved with useMutation it should keep the new data. Which is basically this part:...