Will
Will
Explore posts from servers
TTCTheo's Typesafe Cult
Created by Will on 9/23/2023 in #questions
What happens if I accidentally use `npm install` inside of a turborepo using `pnpm`?
Is it okay or do I need to undo something? Thanks!
3 replies
TTCTheo's Typesafe Cult
Created by Will on 9/21/2023 in #questions
Experience nextjs dev going from web to mobile, what should I know?
Title says it all! I'm a fairly experience dev who has built a decent number of apps in nextjs (mostly using t3). I'm making the jump into some mobile dev. Any advice or tips? Looking specifically for insights coming from people who have made the jump in a similar way. Thanks!
2 replies
TTCTheo's Typesafe Cult
Created by Will on 9/20/2023 in #questions
As a nextjs + shadcnui user going to expo + react native, what libraries should I know about?
My biggest concern jumping into react native is not having the libraries I know and love like tailwind and shadcnui. What are you guys using?
8 replies
TTCTheo's Typesafe Cult
Created by Will on 4/13/2023 in #questions
Prisma + Zod.. which types to use as SOT? Is there a better way?
I’m building t3 app with prisma. Since I want to use trpc and react hook form, i feel like i also need zod. But now I have a dilemma of needing to pick a source of truth for my types. I’m assuming I should use prisma since its ultimately the db. I’ve looked at some libraries to generate zod schemas from prisma, but it just doesn’t feel like the cleanest way to go about this. How have you all handled this in the past?
6 replies
TTCTheo's Typesafe Cult
Created by Will on 4/8/2023 in #questions
What's everyone's favorite testing library for the T3 stack?
I'm trying to use cypress right now, but it's kind of a pain with the Discord auth. Does anyone have any other suggestions / tutorials I can look at to figure out how to get cypress set up with T3? I'm open to other testing libs too, I just want this to be easy lol
2 replies
TTCTheo's Typesafe Cult
Created by Will on 2/23/2023 in #questions
Does anyone know of a way to programmatically lift classNames into typescript intellisense?
For example, if I import this component somewhere else, I'd like to be able to see the classNames that were applied to the div when I hover over <Example />
export const Example = () => {
return <div className="h-fit w-fit bg-red-500">Example</div>;
};
export const Example = () => {
return <div className="h-fit w-fit bg-red-500">Example</div>;
};
You are probably wondering why I would ever want to do that. It's because I wrote this l created this library http://chimera-ui.com/docs/components, where the components have default styles applied with Tailwind. When users import these components, I'd like to expose that styling to them via typescript intellisense.
82 replies
TTCTheo's Typesafe Cult
Created by Will on 2/21/2023 in #questions
Can you critique my idea/methodology for a Tailwind UI lib + semantic color system combo?
I am still a pretty entry level dev (~2 years experience), and this is my first UI library. While I think this is a pretty good idea, I don't think I have the experience to be confident about it, so I am hoping you guys can point out some blind spots / pitfalls with this approach. I've put up a docs site that goes into more detail https://www.chimera-ui.com/, but general idea is this: - Put a thin wrapper around radix primitives with a layer of default styling, and then allow users to overwrite that styling with tailwind. - Define a semantic color system and use that color system in the default styling This means a lot of the predefined Tailwind styles are abstracted away. You could import this Button component and use without writing any classes,
<Button>
Click Me
</Button>
<Button>
Click Me
</Button>
but under the hood it actually has h-10 py-2 px-4 bg-primary.... applied. You can overwrite those styles by writing classes like you would anywhere else, because the components use tailwind-merge under the hood. I think the advantages here are: - You can import components that look great out of the box, but you still get to keep the tailwind flow going - Cleaner JSX, since a lot of the styles are abstracted away. You also don't need to redefine the same basic styles all over the place. - By using semantic color names, you don't have to re-style components when you re-use them in other projects. For example, if you have bg-blue-500 on a component, you might have to change it to bg-red-300 when you copy and paste it into another project. Across all of your components, it can be a pain. But if you just use bg-primary, then you just need to change the theme or css variable in one place. I've been keeping up with Theo's & the rest of Twitter's thoughts on TW. There's part of me that is worried that I am going against TW philosophy in a way, by abstracting some classes away. But then again, Daisy UI does that as well. What do you guys think? Thanks in advance!
18 replies
TTCTheo's Typesafe Cult
Created by Will on 2/20/2023 in #questions
Is it important to learn object oriented programming?
Little background - I've been programming for a little over 2 years now. I'm pretty comfortable building full stack apps, but most of my programming education has been around functional programming. I know the basics of OOP and have come across it from time to time, but have never found a use case/need. I'm sure there are plenty of jobs out there that require it, but it feels to me like the world has been shifting towards functional programming. Maybe I'm biased because I hang out here. For those of you with more real-world experience than me, would you recommend I put in the effort to learn it? Or just stick with functional?
11 replies
TTCTheo's Typesafe Cult
Created by Will on 1/26/2023 in #questions
Updates from mutation responses with trpc?
I'm trying to automatically update a list query after updating the list with a mutation. The tanstack query docs show its pretty easy to do with straight up tanstack query: https://tanstack.com/query/v4/docs/react/guides/updates-from-mutation-responses However, with the t3 setup and trpc wrapper, I'm struggling to figure out how to do this. If I try to add a querykey like list: publicProcedure.query("items", async () => {, I get an error saying that query() is only expecting 1 argument, not 2.
11 replies
TTCTheo's Typesafe Cult
Created by Will on 1/25/2023 in #questions
How do you hit trpc endpoints via http request?
I am fairly new to trpc. It's awesome when consuming the API through the client. But what if I want to test the API via postman or make a get request using the browser? For example, with a normal next api route, I could go to localhost:3000/api/hello and it would return the data. Can I do something similar with trpc endpoints? I tried going to localhost:3000/api/trpc/example/hello but that did not work. Thanks in advance!
26 replies