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

React Icon situation

Random Question; what icon cdn/library/etc. do you guys use?

Typescript import best practices?

Is there a difference in the compiled package between import { useEffect } from "react" vs
import * from "react"
React.useEffect(() =>{})
import * from "react"
React.useEffect(() =>{})
?...

Trouble with NEXTAUTH_URL

I've been getting the missing next auth url error in my console, even though my NEXTAUTH_URL is defined in my .env: ``` dev: [next-auth][warn][NEXTAUTH_URL] dev: https://next-auth.js.org/warnings#nextauth_url...

[TypeScript] How would you go about creating an Array that can have different types of objects?

Firstly sorry if this isn't the right place to ask TS question, but I didn't know where else to ask 😢 I have a dilemma in a project I am working on. The example I will give is not how we do it, but you should get the idea... The project is about task solving and because of some cases we have decided to have a type like so: ```...

framer-motion does not work well inside a portal

anyone with framer-motion experience? having issues when rendering inside a popover when items are returning to the list, they are coming from seems like (0,0) of the screen also, AnimatePresence doesn't seem to work at all...

learn react and get comfy with thinking in react

Hey guys what's cool way about learning React (Making projects and searching for help in beta docs when stuck?) I did some react course and have basics but I don't feel like it clicked with me enough to build stuff on my own (react way of thinking especially)

Accessibility question about Cards

let's say I have a page with many card components. In regards to accessibility, would it be bad practice to attach a tabindex=0 to the div wrapping the entire card to allow users to tab stop over each card and have a screen reader describe the card? I know putting tabindex on no-interactive elements is bad, so would I just want to listen for a space & enter keyboard event to "click" the card to make it proper accessibility? maybe I don't need to do this at all and trust screen reader users wi...

Selfhosting Supabase

Has anyone self hosted Supabase Auth, DB, and storage? If so what are your experiences compared to Supabase cloud? Is there an easy one command install like appwrite?

Next Router Issues

So I have an issues using next router. In my project I have something similar to /blog/[id].tsx This [id].tsx does a getServerSideProps where it fetches the correspoding information from a database and passes that to the page....

passportjs sends a cookie on each request

thank you in advance I use this lib called passportjs, I know it doesn't make any sense to use it in a simple authentication method like this, how ever, it seems like it's setting an http cookieon each request, even if the requested route doesn't exist. basically I know that the setCookie header is included once you change the session object. so why passportjs does that?...

How to add getLayout property to Component, nextJS 12.3

Help me, NextJs12 --> NextJs12.3, don't know how to use getLayout,

tRPC app with SSR true, getStaticProps or getServerSideProps

Hi all, I've been trying to figure out what is the best way to fetch queries on my website that I'm building with T3 stack. Long story short: I'm creating a website that will be like a portfolio and an online resume. I have a page called /projects and I'm trying to fetch all the projects on the server, so all the projects can be available when the users arrives on the page. I've been reading a lot of stuff lately about SSR and which methods to use to fetch data, either getServerSideProps or getStaticProps. On top of this, I know that tRPC configuration accepts a ssr: true | false property....

What was the reason for removing req, res from context?

What was the exact reason for doing so? While implementing a simple rate limiter like this: https://github.com/vercel/next.js/tree/canary/examples/api-routes-rate-limit I found a use case where I needed the res object, because of which I had to change the context to include it, similar to how it was before. Is there some other way around this or would it be better to bring it back?...

Running a cron job alongside T3 stack locally

I want to have a cron job fetch some RSS feeds externally every 2 minutes and post to the db. I can use an external service when deployed but what’s the best way to implement when developing locally? I started creating a simple express app to run alongside but wondering if there’s any better alternatives?...

why re-mcompile JS each time?

why V8 doesn't compile the js once and cache the binary output for the next run? instead of recompiling each time. it'll be almost like wasm except that you just write JS scripts....

can i remove a background from an image using Js

hey guy i was wondering if i can create a javascript api that removes the background from an Image , does js have that capability ?

Documentation past comments, is it needed?

Hey y'all, just wanted to ask a question about if one might need internal documentation like website (e.g., something built with like https://www.docz.site/). I understand if its like an open source library and you want people to know how things works and the props it has. But I just don't see how it may be useful like internally. Maybe im in the wrong? But not sure if trying to actively maintain it is beneficial?...

Quick question about TRPC query with date

Hi, Just a quick question about TRPC Query why do I always get the same date in the query? Date in this case is a state. ...

Internationalization with T3?

Did anyone successfully manage to implement internationalization on both static and SSR pages with T3?

I need ideas for Data viz & Metrics framework in t3 stack ?

Hi, I created my app with the T3 stack (Prisma, next-auth, tRPC, Planetscale) and added axiom for logging and monitoring. It feels like I am missing something for data visualization... This stack allowed me to implement so much by letting great libs and services do all the heavy lifting. ...