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

How to interact with typescript language server programetically?

I am trying to build an app for user searching queries through language server. Maybe later on that can be enhanced with chatgpt for converting inference data to natural text. The issue I am stuck on is the search symbols api does not seem to be working at all. ( Check attached screenshot )....
Solution:
OK I figured it out, we have to pass all these stuff in initialization params: ```json { hostInfo: 'vscode',...
No description

Help with dynamic image in Nuxt!

does anyone know to import dynamic assets because ``<img :src="/nuxt/assets/images/${item.image}" :alt="card${index + 1}`" class="w-100 card_height"...

How would you define 'Confidence' in testing? (Unit / Integration / E2E / Whatever)

As titled. Most people claim that the purpose of testing is to maintain / improve 'confidence'. But...confidence in what exactly? I have some thoughts but would be good to get some other opinions. I'm not in huge agreement with Theo's general take, but him being much smarter and more experienced in this stuff than me, it would be interesting to understand why he (and others) seem to avoid testing as a rule, particularly unit testing.

Has anyone here tried nuqs?

Short for next-usequerystate: https://nuqs.47ng.com Seems like a pretty awesome/promising way to interact with the query param state in a nextjs app in a typesafe way....

Help responding to coworkers on my technical decisions (NextJS)

I feel like I'm at a point where I'm writing great quality software by blind-following best practices, but I've got little low level understanding that when I'm confronted about my technical decisions I'm not able to give convincing explanations. It's especially problematic since the average dev doesn't really care about the state of the tech meta, so being unable to explain these decisions to coworkers leads to lost potential productivity. I really dread work when I'm being forced to follow poor, outdated, & straight up bad practices - but at the same time I'm at fault for not having the knowledge to move my team forwards. How do I get to a stage where I can convincingly push my decisions towards coworkers? I'm less senior than my coworkers, but I'm passionate about what I do, actively seek the latest trends, & develop stuff in my spare time - whilst they treat their job purely as a job (which is completely fine!), so naturally I have a bit more knowledge about good patterns (but less so to why they're good patterns as you can find out more below)....

Get loading state from server action without using `useFormStatus` or `useFormState`

I like doing mutations with server actions because I don't have to write API routes and they remove the boilerplate of tRPC. But. Is there a way to get a loading state inside your component if i don't want to use the recommended experimental hooks?...

Server Side Exception on Vercel Deployment

I'm getting the following error on vercel deployment using tRPC on Next.js And this is the server log, on vercel deployment. ```...
No description

404 Not Found when rendering <UploadButton>

When I render <UploadButton> I get the error GET http://localhost:3000/uploadthing 404 (Not Found). I've setup the route in my fastify instance that is running on port 3000(other routes from fastify works). I've been thinking for this for a while and want to ask before I start to dig into the source code of uploadthing. ```ts await fastify.register(createRouteHandler, { router: uploadRouter,...
No description

PostgresSQL

hey guys im currently trying to learn post gres i was wondering if anyone knows any good tutorials or resources online for best practices and structuring in BE using Fastify im currenly trying to set up a dynamic update route and thinking of doing something like this ...

Next Steps Confirmation - "if your app includes tRPC"

If your app includes tRPC, check out src/pages/index.tsx
Is this out of date? I have no /src/pages dir....
No description

SQL/Drizzle Where Query Search Optimization

Hi, originally I wanted a fuzzy search but now I just wanted to look how far I can get with just a where query. I have a few concerns with the reads this query causes to the database. Especially I want to know if I can stop if I already have 5 via the name or if you generally have some read and performance optimizations....

How to use generateStaticParams with trpc?

I'm going to use generateStaticParams with trpc but it throw me an error.
No description

postgres db probs on vercel lately?

Has anyone else experienced problems with vercel not finding the server localhost:port of their postgres db? I havent touched this since the vanilla setup of t3 with postgres. Curently only using this as auth with discord. It just decided to stop working and the server is no longer a thing? prisma:error Invalid prisma.account.findUnique() invocation: ...

Refetching/revalidating server query with TRPC

[Nextjs 14 app Dir] Hello, i want to revalidate my query after form sumit but for some reason i dont know what am i doing wrong. As im newbie in trpc i want to just revalidate specified request "onSuccess" after mutation but it doesnt work. Thats the code:...

Downsides of using AsyncLocalStorage on Server Components?

Hi guys, i just wana know if there's any downsides of using Aysnc Local Storage from Node.js in Server Components? I've an example App that show how it will work. https://stackblitz.com/edit/stackblitz-starters-9a4rak My use case is the following. I've an app that make many fetch call to the API to get data, the majority of those fetch calls need the page params. Currently the only way to get params in a RSC is layout.tsx or page.tsx props, and then you need to pass those values as props. ...

Optimizing importing json into sqlite with or without drizzle

Hi guys, I have this script running over my 60k row json file and somehow this is really really slow. is there an optimized way for turso? ```ts const jsonData = JSON.parse(data); const parsedJsonData = citySchema.parse(jsonData); ...

NexAuth with Xata db

I need some help with setting up my Xata database with NextAuth and some explanation of their docs on the relations section.

Really fast search functionality SQLite (Turso)?????

I have a lot (150k cities) in my DB and want to build a instantly fast search (the fastest that is possible with minimal effort) is Turso the right thing to consider or are there other options that are better suited for a search functionality?

React query in react native

Hey can anyone help me, we are adding react query for data fetching in our react native app, does it require a native release, As per my guess codepush should do the job as there is no native platform specific apis being used