luis_llanes
luis_llanes
Explore posts from servers
TTCTheo's Typesafe Cult
Created by luis_llanes on 2/16/2025 in #questions
What is Theo using to highlight the Date of the commits on GitHub depending on how recent they are?
I don’t think that’s the one tho
7 replies
TTCTheo's Typesafe Cult
Created by luis_llanes on 2/16/2025 in #questions
What is Theo using to highlight the Date of the commits on GitHub depending on how recent they are?
No description
7 replies
TTCTheo's Typesafe Cult
Created by rexxar07 on 1/20/2025 in #questions
Software Engineer resources and groups
The Next.js discord community is very active and it’s great
10 replies
TTCTheo's Typesafe Cult
Created by BadBoy on 1/13/2025 in #questions
useQuery or useMutation?
Oh my bad, I didn’t mean it as an actual solution for local storage, I was just trying to say that as long as you pass an async function to React Query it doesn’t care what it is
10 replies
TTCTheo's Typesafe Cult
Created by BadBoy on 1/13/2025 in #questions
useQuery or useMutation?
That way you don’t pull the whole conversation over and over again, just the last 2 that are needed
10 replies
TTCTheo's Typesafe Cult
Created by BadBoy on 1/13/2025 in #questions
useQuery or useMutation?
Even if they’re stored in local storage it doesn’t matter to React Query, it just needs an async function to track. I would do that too, useQuery to get the messages and every time I send a new message that’ll be a useMutation “mutate” fn and I’ll override the messages on onMutate to incluye my message before you I get a response back from the server, then onSuccess trigger an invalidation in to make the query trigger again. I believe there’s a way you can make the useQuery only take the last 2 messages that will be the one you sent (and optimistically showed on the UI via onMutation) and the one from the server. Maybe infinite query not sure, but might work
10 replies
TTCTheo's Typesafe Cult
Created by shadax on 1/12/2025 in #questions
CSR, SSR or server components?
Even if you use “use client” in 95% of your components you’re effectively still routing through Next.js router, provoking pages to render on the server before switching to them (when they’re not static), and also the next.js Link component prefetches all routes that are visible in the viewport under the hood
9 replies
TTCTheo's Typesafe Cult
Created by shadax on 1/12/2025 in #questions
CSR, SSR or server components?
Yes, I the RR7 routing system does not trigger server requests when navigating through “client side routes” because they’re only ever running on the client, also the whole core app requires client side interaction, so it makes sense
9 replies
TTCTheo's Typesafe Cult
Created by I'm Not An Engineer on 1/11/2025 in #questions
What's t3?
I believe T3 stack was originally created to solve the problems he was having with building ping.gg, it did well so he shared with the community. It’s just a matter of preference. Also, Astro makes use of JSK like syntax.. just saying.
3 replies
TTCTheo's Typesafe Cult
Created by Oudwin on 1/5/2025 in #questions
LF Video where Theo talks about using react query for ping
With that, you could show some UI while the devices are connecting, then show a toast if the connection completed correctly or failed.
8 replies
TTCTheo's Typesafe Cult
Created by Oudwin on 1/5/2025 in #questions
LF Video where Theo talks about using react query for ping
Yes that’s true, as long as you pass an async function you’re good, whatever that async function does won’t matter to React Query. Just by doing that now you have control over the lifecycle of the async function by appending methods (onMutate, onSuccess, onError, onSettled) and the state by just calling the hook in your component
8 replies
TTCTheo's Typesafe Cult
Created by FleetAdmiralJakob 🗕 🗗 🗙 on 1/6/2025 in #questions
Nuqs slower than useStste
First thing, have in mind that in dev mode everything is slower. I assume that changing the URL to append the searchParams is triggering the page to be re-rendered on the server when it’s not needed. Nuqs should sync to the URL with a react state AFAIK, if it's triggering the page to re-render maybe it's not the library fault
13 replies
TTCTheo's Typesafe Cult
Created by Oudwin on 1/5/2025 in #questions
LF Video where Theo talks about using react query for ping
Connecting to external devices isn’t a synchronous task, JavaScript can’t know when the connection is going to be established, so React Query definitely helps with that and with managing all the lifecycle of the async operation
8 replies
TTCTheo's Typesafe Cult
Created by Oudwin on 1/5/2025 in #questions
LF Video where Theo talks about using react query for ping
React Query handles async functions and keeps track of all the internal state of them (error, loading, data, etc)
8 replies
TTCTheo's Typesafe Cult
Created by showduhtung on 12/27/2024 in #questions
how to pass searchParams around in next app server components?
I’ve been there, I tried to make my whole app a server components app because it was the new shiny thing and it meant less JavaScript on the client, blah blah blah. At the end the power of React lies on the Composition, you don’t need your whole app to be either Server Components or Client Components, composition lets you mix and match, however it’s convenient. If there’s a solved and trusted solution in the client side then go for it, use the server for the data loading and prefetching, and the client for the stuff React has been doing for years
13 replies
TTCTheo's Typesafe Cult
Created by showduhtung on 12/27/2024 in #questions
how to pass searchParams around in next app server components?
Using client components doesn’t mean you’re giving up the cool things about the server. You can still pre-render the client components on the server, in fact, that’s what Next.js does (both client and server components are rendered on the server for the first render). Also, you’re not giving up the loading states, if the operation is asynchronous you can use the “use()” API (React 19 tho) to unwrap a promise and it’ll continue to work just as fine, <Suspense> gets trigger
13 replies
TTCTheo's Typesafe Cult
Created by I'm Not An Engineer on 12/28/2024 in #questions
Are Serverless functions the right thing for me?
As far as I know, Vercel takes care of the infrastructure no matter what Tool you use on the front end. It provides a CDN worldwide. It happens to fit better with Next.js since they built it
24 replies
TTCTheo's Typesafe Cult
Created by FleetAdmiralJakob 🗕 🗗 🗙 on 12/27/2024 in #questions
use(props.params) vs useParams() in Client Component in Next.js
And I would even say useParams is better. Passing the promise from the server component to the client component involves a network boundary, which is “invisible” to us but data must move between the server and the client through the network. The useParams() must implement its internal logic in an optimal way since it was especially created for that purpose
14 replies
TTCTheo's Typesafe Cult
Created by FleetAdmiralJakob 🗕 🗗 🗙 on 12/27/2024 in #questions
use(props.params) vs useParams() in Client Component in Next.js
Unless you dig into the implementation details of “useParams()” you’ll see if it saves a render or not, maybe it’s implementing the same logic under the hood and they literally work the same, but who knows. Also, a rerender isn’t much of a problem, it’ll just commit once which is the heavy duty for the browser most of the time, re-render doesn’t mean “re-create the DOM elements” it means “just read the component logic again and decide whether or not to commit again”, and it might not commit again since it’s the same tree… unless it’s not the same tree due to the implementation details of the “useParams()” hook
14 replies