bruno!
TTCTheo's Typesafe Cult
•Created by Pranoy on 6/17/2023 in #questions
Mern stack Or Nextjs ?
I still think using vite is like using cra, you’re using a bundler but you don’t need to care about it
28 replies
TTCTheo's Typesafe Cult
•Created by Pranoy on 6/17/2023 in #questions
Mern stack Or Nextjs ?
using MERN with vite, which is what’s recommended and you still won’t need to learn bundling
28 replies
TTCTheo's Typesafe Cult
•Created by Pranoy on 6/17/2023 in #questions
Mern stack Or Nextjs ?
initially I thought the focus were only mastering react, so in that case going with nextjs solely would be better
28 replies
TTCTheo's Typesafe Cult
•Created by Pranoy on 6/17/2023 in #questions
Mern stack Or Nextjs ?
in this case you can go with MERN using nextjs on the react side, so you can improve both on nodejs and react
28 replies
TTCTheo's Typesafe Cult
•Created by Pranoy on 6/17/2023 in #questions
Mern stack Or Nextjs ?
but if you want to go really deep, eventually you can even setup your own node server with ssr, server components, etc
28 replies
TTCTheo's Typesafe Cult
•Created by Pranoy on 6/17/2023 in #questions
Mern stack Or Nextjs ?
currently NextJS is the framework with the best integration with server components, and right now server components, and server actions coming soon, are becoming a big part of react, so if you want to master it, it makes sense to a framework where you can apply it's concepts
28 replies
TTCTheo's Typesafe Cult
•Created by Pranoy on 6/17/2023 in #questions
Mern stack Or Nextjs ?
NextJS
28 replies
TTCTheo's Typesafe Cult
•Created by Pranoy on 6/17/2023 in #questions
Mern stack Or Nextjs ?
if you're mostly talking about having a standalone server vs using api routes, I think it depends on how much complexity your backend needs and if your project is able to run in a serverless environment
28 replies
TTCTheo's Typesafe Cult
•Created by akerbeltz on 6/14/2023 in #questions
Union types to solve magic strings problems
I found union types usually less annoying and less "boilerplate-like"
5 replies
TTCTheo's Typesafe Cult
•Created by ARLISS on 6/9/2023 in #questions
alternative to getServerSideProps() for /app router era?
1. if you're talking about when opting for the app router, it's because with server components you have a ´nicer´ api
2. the page component on each route, if you need querying should be an async server component, you can just fetch the data through
Fetch API
or directly querying it through the database, using prisma/drizzle for example,
in order to have the getServerSideProps
behavio (no-cache), you can:
if you're using the Fetch API, just use
if you're not using Fetch API, just add to page.tsx
:
All this info is available here: https://nextjs.org/docs/app/building-your-application/data-fetching/fetching
2.1
since the results came from the server, you shouldn't need push to them into local storage, just save the search in a state, and then calculate the filtered items at rendering, like this: https://react.dev/learn/thinking-in-react3 replies
TTCTheo's Typesafe Cult
•Created by bedesqui on 6/8/2023 in #questions
Running before unmount on server components??
ah, just got the leaf ideia, it's actually way better
14 replies
TTCTheo's Typesafe Cult
•Created by KiKo on 6/8/2023 in #questions
Revalidate using App Dir tRPC
This is looking so cool! 👀
8 replies
TTCTheo's Typesafe Cult
•Created by bedesqui on 6/8/2023 in #questions
Running before unmount on server components??
using wrapper components seems to work btw
14 replies
TTCTheo's Typesafe Cult
•Created by bedesqui on 6/8/2023 in #questions
Running before unmount on server components??
14 replies
TTCTheo's Typesafe Cult
•Created by bedesqui on 6/8/2023 in #questions
Running before unmount on server components??
or maybe as Igor said, this might be writteable as a hoc
14 replies
TTCTheo's Typesafe Cult
•Created by bedesqui on 6/8/2023 in #questions
Running before unmount on server components??
14 replies
TTCTheo's Typesafe Cult
•Created by bedesqui on 6/8/2023 in #questions
Running before unmount on server components??
this looks like just a server component wrapped to a client component with an effect cleanup
14 replies
TTCTheo's Typesafe Cult
•Created by wlvz on 6/7/2023 in #questions
prisma nested writes / updates not working
just read the "name" that you're sending on the post request through the body
also notice that with the current UI you're only getting 1 name at a time
8 replies
TTCTheo's Typesafe Cult
•Created by riccardolardi on 6/7/2023 in #questions
React guarantee updated state variable
https://react.dev/learn/render-and-commit
https://react.dev/learn/state-as-a-snapshot
https://react.dev/learn/queueing-a-series-of-state-updates
15 replies
TTCTheo's Typesafe Cult
•Created by wlvz on 6/7/2023 in #questions
prisma nested writes / updates not working
you would see that the way you're running findUnique would be wrong if you didn't used the "as SubjectsWhereUniqueInput"
8 replies