JulieCezar
Explore posts from serversDTDrizzle Team
•Created by JulieCezar on 11/19/2024 in #help
drizzle-kit generate throws SyntaxError: Cannot use import statement outside a module
I have been using drizzle alongside React Native, and everything worked great. Unexpectedly
drizzle-kit generate
stopped working - I built my app and after that it started throwing...
It throws with the following error:
I tried deleting node_modules/, .expo/ package-lock and restarting everything, checked if all versions were up to date... with no luck....
I can't figure out why it would throw an error for code, from another library, where it does not even get called...
Before I start my project from scratch again, anyone had an issue similar to this? 😅1 replies
TTCTheo's Typesafe Cult
•Created by JulieCezar on 9/11/2024 in #questions
Is it possible to revalidate path after a useMutation call?
3 replies
TTCTheo's Typesafe Cult
•Created by JulieCezar on 8/30/2024 in #questions
App crashes when TRPC error is thrown on the server
I've found an interesting situation while using TRPc with the T3 template on the server. If the Authentication middleware for the TRPC procedures throws an UNAUTHORIZED error if calling it on the server:
It throws a global error. I would expect this to return an actual error or be able to handle it somehow, but instead it throws a global error.
In development mode it just crashes
4 replies
TTCTheo's Typesafe Cult
•Created by JulieCezar on 7/30/2024 in #questions
Why does THeo hate on DigitalOcean?
I couldn't not notice in Theo's video about the StackOverflow survey mentioning that people should stop using DigitalOcean, or at least not learn on it.
Anyone have any more details about this, or things he said? Because I've found DigitalOcean to be quite cheaper even if they do not have all the possible services like AWS does.
2 replies
TTCTheo's Typesafe Cult
•Created by JulieCezar on 7/12/2024 in #questions
How to implement a "local first" Mobile app storage
I'm trying to learn more about React Native and wanted to create a small habit tracking app. While the details are not that important for this question, one thing that I want to ensure is a local experience even when internet is not available, however all data should be saved in a DB as well. Also, you can have Habits for multiple people, meaning 2 people can edit the same habit while being on/offline.
Basically, I would need a way to sync the phone's local storage with my DB. However, while thinking about it I found some gotchas that I don't have a happy solution for.
1. First of all, how does it work. E.g. when the user adds a habit, is it firstly saved locally then synced. Is it saved to the DB and locally at the same time if there is a internet connection? Or something else entirely?
2. Since multiple people can edit the same thing while offline, what happens when they get back online? Does one override the other? Do they merge? - probably something I have to decide myself, but I'm still unsure of the implementation
3. Do I need Real-time data if someone can edit a Habit I'm currently browsing?
4. there is probably more I can't think of but I'm open for suggestions
14 replies
TTCTheo's Typesafe Cult
•Created by JulieCezar on 4/30/2024 in #questions
Is anyone actually using the Effect library in production?
I've stumbled across the Effect (https://effect.website) library which promises "TypeScript for production"... Although a lot of it's features seem very enticing I have some hardships actually using it in my projects...
Plus, the way some people shill this product, makes me think it's kinda sus...
So... Is anyone using Effect? Are you satisfied? Do you see any cons? Etc.
24 replies
TTCTheo's Typesafe Cult
•Created by JulieCezar on 4/10/2024 in #questions
How does UploadThing onClientUploadComplete work?
2 replies
TTCTheo's Typesafe Cult
•Created by JulieCezar on 3/8/2024 in #questions
Railway approx. pricing for a side project DB
Can anyone give me an estimate for how much a MySQL BD on Railway would cost for a smaller side project with not much traffic? In other words would the 5€ one be enough for that?
2 replies
TTCTheo's Typesafe Cult
•Created by JulieCezar on 1/28/2024 in #questions
Autoanimate throwing errors with T3 eslint config?
4 replies
TTCTheo's Typesafe Cult
•Created by JulieCezar on 1/26/2024 in #questions
Relations using Drizzle and Planetscale
I'm trying to start using Drizzle with Planetscale for my new project, but I have some doubts regarding relations...
I know that Planetscale doesn't allow Foreign key constraints on the DB, meaning you need an application level constraint. For example, from the starter template for T3
As we can see, the Posts has the createdById attribute, but it's not connected to the User table in any way.
My question here are:
1. Why is there no many() relation to posts like accounts and sessions?
2. Since we do not have DB level restrictions, we trust that we will not make mistakes in the app and add wrong user ids to posts?
3. Is it even possible to add wrong author ids to posts?
4. What to do in case or to prevent 3?
All help is appreciated 😄
5 replies
TTCTheo's Typesafe Cult
•Created by JulieCezar on 1/20/2024 in #questions
Vite vs Webpack
I have heard Theo mention a couple of times that you should nowadays always start a React project with Vite, if you don't go with NextJs...
Since my new job requires me to work with Webpack I had to research it quite a bit, but I'm still a bit lost regarding the Vite vs Webpack battle.
TLDR; I know what each of them does differently and that Webpack offers better configuration... Also, most of the articles I read say that Webpack has greater versatility and "is better suited for advanced code splitting and such requirements".
But my question here is, does there exist a scenario when Webpack can offer better performance than Vite, and if so what is it? What is that "advanced requirement" everyone is talking about? Or is the difference not worth all the extra effort? And after all that, should I try to convice my boss and team to switch to Vite? 😂
1 replies
TTCTheo's Typesafe Cult
•Created by JulieCezar on 11/9/2023 in #questions
How can I write this type with Zod?
Can someone pls help me to write this type with Zod?
TLDR: the object and all nested objects need to have the listed attributes but they cann all be extended.
I tried something like this but when I try to safe parse it, it says that the data is unknown.
4 replies
TTCTheo's Typesafe Cult
•Created by JulieCezar on 10/19/2023 in #questions
Self hosted logging/analytics for Next apps - Prometheus?
I've recently pushed a Next app to production, but by my boss' wishes we had to do self hosting. So now I'm looking at different self hosted metrics/analytics/logging solutions.
Prometheus looked promising, so I wanted to ask if anyone had experience adding that to a Next app or has any other recommendations?
9 replies
TTCTheo's Typesafe Cult
•Created by JulieCezar on 7/31/2023 in #questions
T3 or App router?
I've been playing with the App router for some time now and I really like it, however there are still some things for which I think T3 is still better...
What do you all use at the moment? Which one are you going to be using forward and why?
4 replies
TTCTheo's Typesafe Cult
•Created by JulieCezar on 7/26/2023 in #questions
What metadata to store when uploading files?
What metadata should I store/is usually stored when uploading a file, image etc.?
An how is it stored? Is there a single attribute in the db like metadata or is it somehow split?
3 replies
TTCTheo's Typesafe Cult
•Created by JulieCezar on 7/12/2023 in #questions
Does anyone have experience with TipTap custom Nodes?
I have the following problem... I can't get the update event and value when my custom node changes... I am displaying 2 different elements inside my node, an input and a span. When the value of the input (contentDOM) changes I want to update the span as well... But I can't seem to get it working....
2 replies
TTCTheo's Typesafe Cult
•Created by JulieCezar on 6/29/2023 in #questions
Good Select component/library for large lists?
I've recently had a usecase where I need to display a large list inside a Select (10k+).
Up until now I used only React select, which works perfectly fine up until like 1k items, after that it gets laggy and then at like 2-3k+ it's to janky to be called usable... I also used virtualization for it, but it's still not as smooth as I would expect it to be.
Does anyone have any good recommendations?
2 replies
TTCTheo's Typesafe Cult
•Created by JulieCezar on 5/29/2023 in #questions
Prisma does JOINs by fetching all table data and then comparing???
I just watched this video from CodeDamn
https://youtu.be/J2j1XwZRi30
And he said that they figured out that Prisma actually doesn't do JOINs as you would expect in SQL, but rather query all the data from the tables and then merge them with their engine or w/e....
Can someone confirm/deny this since querying large tables could potentially be expensive on PlanetScale who charge by row read?
2 replies
TTCTheo's Typesafe Cult
•Created by JulieCezar on 5/25/2023 in #questions
Is Drizzle production ready?
Simple as that, can I safely use Drizzle in production?
2 replies
TTCTheo's Typesafe Cult
•Created by JulieCezar on 5/3/2023 in #questions
What's the difference between React.ComponentProps and React.PropsWithChildren ?
I just saw someone post something on youtube but didnt't really explain it.
Whats the difference between these 2, and when should I use either? Except the obvious part that the Component... has the types already included and you just call the type of element.
And this goes for all these types PropWithChildren, PropsWithRef, PropsWithoutRef and their counterparts ComponentPropsWithRef and ComponentPropsWithoutRef.
2 replies