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

Anyone Have A Recommended Markdown Editor That They Use That Works With Next?

I was going to use react-md-editor (https://github.com/uiwjs/react-md-editor) however it seems that the only way to get this working with ssr is a lot of work arounds that I would rather avoid. Anyone have any recommendations?

WebSocket connection to 'ws://localhost:3001/' failed:

i have been trying to get websocet to work on t3 stack the past 6 hours but still unable to get it to work and yes i have had a look at examples-next-prisma-websockets-starter...

CRON jobs in the T3 stack

Hey everyone, I’ve got a project at work that is going to require the use of some CRON jobs. My background is primarily in Node, so I’m still learning the quirks of NextJS.
How would you go about implementing CRON jobs in NextJS? Is that even possible? ...

Aurora Serverless V2?

I’m currently looking into using this for a Postgres db and Prisma. Does anyone have experience with this? Would you recommend it? I’ve heard a lot of bad things about V1, but also heard V2 is way better.

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. ...

Some Tailwind classes have no affect

I have a very weird occurrence where some elements have Tailwind classes apply css properties to them, and some don't. As you can see in the image provided, I have flex and margin classes, but they do not apply. It is true for all view sizes. On the contrary, an element above with width and padding classes, does actually have styles applied to it....

Types for an object passed as props

I run a map where I loop out content from a CMS ```js type PureContentProps = { content: {...

Typescript with array data from shitty CMS

I'm trying to learn this typescript thing Theo's banging on about all the time but can't figure out how to do TS with arrays. I get an array from my CMS that fits with the ContentProps I made ```js type ContentProps = {...

T3 app/Vercel/Planetscale Slow fetches

Hey guys, trying to troubleshoot some very slow load times on my current deployment, using full T3 stack (Planetscale too) I am just using TRPC queries in my components for fetches, (no SSR anywhere at the moment) but even then fetching is really slow, considering the quite small payload we end up returning. Im quite new to this stack so wondering what are the areas I should be looking at first. Here is an example page (ignore the page layout its broken af atm) https://parted-euro.vercel.app/listings/listing?id=clecuhyxm0000mq08m19m4cmk But the content takes so long to load in, and looking at the network tab, theres not much there. The query is quite simple too (I can share this if it might help) Here is how Im fetching the listing on the page...

tRPC middlwares on getServerSideProps?

Hi there! I've got a pretty complex role procedures which I don't want to replicate on NextJS's getServerSideProps. How can I use these middlewares so i can authorize pages by user roles?...

Open graph image not showing

I am not able to see opengraph image specially on twitter. I checked on opengraph tester sites it is showing there https://www.web3nomads.jobs/job-posts/marketing-lead...

React file manager recommendations

Anyone has one that they really like?

Auto select country flag when country code is provided

I am building a React project and it is required I implement a functionality that allow users to provide their phone number in an input tag with the country code and immediately the country code is provided then the flag of the country appears respectively. Is there a library I can use to achieve this or an API?...

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?...

type of a TRPC mutation

What is the type of a TRPC mutation if I want to pass it into a component ``` export default function MyComponent({ myMutation} : {myMutation: ???} { // mutating things......

How to reduce cold start times with tRPC api

My app was built using t3 stack and for the most part its great but it has one problem that i havent been able to solve / understand yet. Currently, my tRPC api has a ~10s or so cold start time in my vercel deployment. When the api isnt cold starting the api requests take a second or 2. This is ruining demos whenever I try to show people. Here are the things I know / figured out: - The cold start time is only bad for api requests. The UI never seems to have a problem loading quickly. - Vercel's function logger shows the Init Duration as > 7s - Online i've seen people complaining about 1-2 second cold start times so i feel like i must be doing something totally wrong...

How to redirect from login page with trpc's SSR enabled?

Any simple solutions for redirecting unauthenticated users to /login and authenticated users from /login to / with trpc's SSR enabled, i.e., without the use of getServerSideProps?

Delete file from s3 using presigned urls

I am trying to delete files from my bucket using a presigned url, so far this is my api handler: ```ts import S3 from 'aws-sdk/clients/s3' import { NextApiRequest, NextApiResponse } from 'next'...

Recommendations on feature flag library for t-3 app?

I saw on Vercel's documentation that they recommend optimizely. Has anyone had experience with it or have other recommendations?

Easy way to clear database?

Noob here. My schema is massive and I don't want to have to manually type in all of my model names + deleteMany(). Doing that is also painful because a lot of times you have to delete things in a certain order. I'm using prisma db push instead of migrations. Anyone have an easy ts code snippet that will just completely wipe my database so I can seed everything again?...