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

Import on interaction RadixUI Dialog

I started today playing with the radix ui primitives. Is there a way to lazy load on interaction the content of the dialog if the dialog is uncontrolled ? Basically I want to load the code that displays a modal only if a user clicks the trigger (e.g. button)...

Is this git merge ok ?

I'm making a pull request(First time) to an oss and the reviewers told me to make some changes when I made my changes I noticed that I made a merge … is this ok, or should I undo it (which I'm struggling with it right now.) Also, I want to rename the commits.

Testing with Typescript

When writing tests for a Typescript project, should functions still be written with fail conditions in mind so they can be tested properly? Or are those tests pointless because the project is using TS? Example: Testing a getFirstDayOfWeek function takes a Date as an argument. Of course if a string is provided, the function will fail when it tries to getDay() on the string. Should I check if the date is an instanceof Date and return undefined if not? This can then be tested by providing something other than a Date. I don't know how other developers on the (large) team will interact with the code I'm writing and thinking I should add the fail condition code, but it means a lot of the other code that uses this getFirstDayOfWeek function needs to suffer by expecting either a Date or undefined as a result of the function. ...

Next Auth sessions not working in production only

Hey 👋 I run a monorepo with a nextjs app and an electron app in it. The authentication is through JWT, and it happens on the nextjs app. Then the session token gets send to the electron app. All of this is fine in development. The problem comes when I deploy the nextjs app to Vercel, the sessions's don't work anymore. Even though the session token is sent through, it doesn't seem to find the session....

trpc with third party api

is it possible to use trpc with rest api like jsonplaceholder?

Module parse failed when npm run dev out of nowhere

So I have been developing my app, and running local was no issue yesterday. So today when I tried to "npm run dev" this error showed up. I have looked it up, tried some solutions, asked chat-gpt even but no shot, hoping someone else had this problem in here too. I am using t3 stack.

What are some good Auth services?

Im Looking for something, that is easy and fast to setup. What are some good ones other than Auth0?

Best way to store static data?

I'm working on a project for my microservices class, and one of the services is a message moderator. It takes in a message that is sent, and does checking to see if it should be allowed/disallowed. I'm planning on just having a banned words list, but I'm unsure on the best way to store this list, Mongo? just like a .txt/.json file that reads in at app start? Postgres with an index on the term column for fast lookup (seems a bit overkill)? any ideas are appreciated 🙏...

Creating effective shared types in TypeScript without destroying hoverability

Sorry that my title is a bit wonky wacky, but I hope that my description will make sense: So in this codebase I have a button component, this button component accepts a few props, such as size, fill, color, etc. In this specific case, I am running into a code design question with my fill option. ...

Docker Health Check

Anything look wrong here to you guys?

Hello everyone, I may need some of your front-end expertise on this one.

I'm building a form with different inputs and a button. The inputs are custom React components. As shown in the picture. And I am trying to handle state in the corresponding parent component without any 3rd party library....

can i have 2 or more nextjs app in a create-t3-turbo app?

example having 1) regular user web app 2) Admin dashboard for the user web app and then for the mobile app side of things...

Why should you use Slack

What explicit features does it have what sth like Discord doesn’t?

i18next bold strings

Anyone has a better (working) solution for this ? ``ts message={i18n.t( 'member-label:form.designConfig.highContrastTooltipMessage', { firstScore: <strong>${3}</strong>`, secondScore, thirdScore },...

How to view file using a proxy page

How can I create a page which only has the usecase of viewing files like the default browsers behavior. Right now I have a proxy page in which I load the file using an iframe, but that has some weird issues, not sure if there is a better solution....

Aligning the right side of an image with the left side of a grid col

I'd like to align the right hand side of the image with grid-col-1

Issues with next-auth discord

I created a t3 app and I'm having issues with using discord auth. I've tried multiple ways to approach the issues but I'm just not sure where the issue is happening because there are no errors being logged. On first start up I can log in just fine. But when I log out and try to log back in it sends me to the /api/auth/error route. There's no session in the database (I swapped it from sqlite to postresql to see if that would remediate the issue). I deleted the cookies and cleared any session data that I could find. But it always sends me to the error route with no error logs in the browser console or the terminal. The only thing custom I've done to the default repo is add zustand, ripping that out is the only thing I haven't tried....

intellisense

cant find tailwind.config file. when i click to open the path and create a file it creates a file where my tailwind.config is but it adds a " ' ". i think the path that its looking for has a misplaced " ' "

Deployment Errors on Vercel related to Tanstack NPM Packages

Does anybody have any experience resolving these types of errors? Not sure what to do and can't find anything online related.... Thanks!...