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 there a scaleable realtime type safe message broker?

Im currently using pusher. But it is not type safe. Or at least i havent found a way to make it type safe. Anyone have a better alternative?...

TRPC use api externally

Hi, i want to use my trpc api externally, as understand it because trpc uses superjson i cant just pass info to the backend doing something like in the screenshot. Would it be better to just have a regular api route not using trpc?

React Typescript useContext( ) generic type

Please who's got a better ideal on how to solve this problem with React && Typescript useContext() ?

Python DX

Hey guys! I recently had to code python service and noticed that DX is extremely poor compared to something like Typescript. The question is, what are the best tools to improve python DX (transpilers, type hints, etc.)?

any ideas on how to model this in prisma?

creating 2 tables and referencing them seems like a good approach but i am kinda confused

Modifying inferred type of deeply nested object

Hi folks, Say I have a deeply nested object that I'm inferring types of. type MyObj = typeof myObj ...

Hoisting in nextJs

Wondering if this can somehow be enabled? ``` const logHandler = () => handleFoo(); // 'handleFoo' was used before it was defined const handleFoo = () => console.log('foo');...

are there fairly common on prem server solutions out there?

I've been thinking about this since aws and other cloud services are excellent for bootstrapping a small project or company, but it looks like it's not really a great long term solution. I agree with the sentiment here https://world.hey.com/dhh/why-we-re-leaving-the-cloud-654b47e0 and was wondering what common server on prem solutions, especially for getting bandwidth, there may be, because apparently in the long run, that's considerably cheaper than using a cloud service

How are you implementing auth in NextJs?

I'm curious how y'all implement auth in NextJs. I'm considering different options, but is like to hear different perspectives. Because of the new NextJs update and Next-auth lagging behind, I might just implement OIDC, Authz code flow w/ PKCE myself......

T3 for SSG

Does anyone have an example project of a T3 App using SSG? Reading the docs, i am not sure if i should add the SSG Helper context (https://trpc.io/docs/v10/ssg-helpers) somewhere in where the TRPC Settings are defined and have them be imported directly from utils/trpc.

Exporting tRPC routes to another project

Hi everyone. I'm currently running an Electron app, which contains the main project. I also have a NextJS app which handles the website for the download of the Electron app, and it has the application's API un der pages/api, which the Electron app communicates with. I really like using tRPC, so I was wondering if it's possible to somehow infer the tRPC types across the two projects. (These two projects are under different repos)

What is this auth feature called and how do I do this?

When I am in a desktop app and need to authenticate myself, the browser opens with an auth page and when I added my credentials successfully/logged in through oAuth, I am also authed in the desktop app. I have a web app with nextAuth and I want to auth people through that when they want to log into my desktop app. Examples if you don't know what I am talking about: Logging into github through vscode(for vscode setting sync), figma also does this(this is the link that opens: https://www.figma.com/app_auth/id/grant?desktop_protocol=figma&locale=en)...

lazy load react context

Is it possible to "lazy load" react context? ie make a network request the first time the context is required (by a useContext, not by the provider), and then keep the context for the duration of the session?

React Typescript custom pageLayout

React Typescript pageLayout Hi everyone, I'm trying to achieve something and it seems very impossible with React && typescript. I have an application that has two header(s) at the top of every page, in this case the Login page takes Header1 and the dashboard page takes Header2, so the Header(s) depends on the page routing. Does anyone have an ideal on how to make this work ? I can also share what I...

Hosting my app - best services? pricing evaluation? ...

I've been built an app I want to deploy and I'm looking over my options... Which boils down to Vercel, Railway or Netlify. I was studying their prices and comparing etc. However, I still don't think I have a good understanding of how much an average website would cost. How much traffic should I expect, how much resources will I need, what tier will be enough etc... The short version of my app is that it's a Video content based platform where user's can buy others content. And my infra is roughly this:...

Three JS path following

Hi all, I'm looking to recreate this effect in react-three-fiber. My assumption is that I can create a curve with an array of points, and then create a mesh that follows the path, or perhaps particles? I'm pretty new to threejs (but not new to 3d) so I'd appreciate a nudge in the right direction here. In blender it's pretty trivial to create a curve and constrain a mesh to that curve, hopefully it's fairly easy in three as well. If I have to write a gsls shader for it I'm out of luck but perhaps a particle or mesh solution would be doable...

Question About DayJS Date Formatting

Hey everyone, sorry for the "just google it lol" question but I've tried searching around and can't find anything. I am trying to parse a date using dayJS with the following code. However, it returns invalid date. Could anyone point me in the right direction on how I could solve this? Thanks! ```ts import dayjs from "dayjs"; import customParseFormat from "dayjs/plugin/customParseFormat";...

Nextjs+Expo(React Native) - Would trpc work?

I'm not sure about how uploading on Vercel works, but if I create an Expo app with NextJS for the web. If someone is on the phone and hits a route on the server, will that trigger the Vercel cloud function to run because the person on the phone is hitting that route?

environment variables in middleware??

These are the only environment variables I see in middleware