arcanereinz
arcanereinz
TTCTheo's Typesafe Cult
Created by cucaracha on 4/4/2023 in #questions
react-native-web with existing web and mobile app
My concern in using any framework/library is whether it will stop being actively maintain unless your project is short lived or you're open to rebuilding from scrap a few years down the line. I've had many libraries that have been deprecated that forced me to fork and patch. The simplest is having a shared repo that stores common files and even then you'll have add some code that detects the platform and adjusts accordingly.
6 replies
TTCTheo's Typesafe Cult
Created by Sybatron on 4/4/2023 in #questions
Is it neccessery to have Account model for Users model
You're right I forgot you're using an orm. You can use a view and have Prisma map the view to an object to reduce the select repetition. I can see how User and Password are separate since you can put different permissions on the sql side to lock down any access.
7 replies
TTCTheo's Typesafe Cult
Created by Jaaneek on 4/5/2023 in #questions
My project got pretty slow
If you can find a point where your code became slow you can check the git commands and narrowed down when that happened that's what I did. If you're on mac/linux you can run du -sh * in node_modules to see which library is the taking up more space. Then just going through the code to make sure you're tree-shaking as much as possible. Maybe lighthouse in chrome to narrow down which page is slow. I haven't research on any tools since I didn't need to at the time but probably a good idea to take a look. You can try disable source mapping to see if that speeds anything up.
39 replies
TTCTheo's Typesafe Cult
Created by Sybatron on 4/4/2023 in #questions
Is it neccessery to have Account model for Users model
You don't need to have User and Profile separate since it looks like a 1:1 mapping. Only reason to have them separate is if you update User table often and don't want to lock up the Profile table or vice-versa. Although I'm not sure why you have password as a field since usually passwords are never stored only the salt and hashes are stored.
7 replies
TTCTheo's Typesafe Cult
Created by cucaracha on 4/4/2023 in #questions
react-native-web with existing web and mobile app
Imo you're adding way too much complexity. The problem I usually see is not in the development phase but the debug and launch phase of a project where something isn't working and there's too many layers between you and the javascript or native code running on the hardware. Some problems require you to understand react or react-native very well in order to debug it properly. How much experience do you have with react and react-native?
6 replies
TTCTheo's Typesafe Cult
Created by Jaaneek on 4/5/2023 in #questions
My project got pretty slow
Did you check if anything is re-rendering too many times especially near the root of the vdom?
39 replies
TTCTheo's Typesafe Cult
Created by Jaaneek on 4/5/2023 in #questions
My project got pretty slow
last time i got a slow server was because i wasn't using tree-shaking on material-ui so when someone imported icons it bloated the bundle. How big are your bundles?
39 replies
TTCTheo's Typesafe Cult
Created by martinpopoff on 3/29/2023 in #questions
Prevent public database access (AWS RDS with Vercel)
If you need to expose the db to 0.0.0.0 a WAF or Firewall can be used to protect the db from attack but can be a bit complicated to setup and configure. A good long password with maybe a non-default port is probably good enough for a small site.
9 replies
TTCTheo's Typesafe Cult
Created by martinpopoff on 3/29/2023 in #questions
Prevent public database access (AWS RDS with Vercel)
AWS maybe expensive but experience with AWS is very valuable. If can get good at AWS it’s lucrative.
9 replies
TTCTheo's Typesafe Cult
Created by JulieCezar on 3/30/2023 in #questions
How would you structure this Component? A challenge to all advanced React users...
Sounds like global state is needed to coordinate between non-direct components. Context or redux is a good choice.
5 replies