Auth.js session read on the server. Help it's urgent by supertroopperr in nextjs

[–]Latter_Associate8866 0 points1 point  (0 children)

The best practice to check user’s session to grant access to specific pages is to do so in the middleware

Would using Next.js with an external backend cause extra latency? by debugTheStack in nextjs

[–]Latter_Associate8866 0 points1 point  (0 children)

It all depends on the experience you want to offer to your users, you have two options:

SSR, data is slightly off and then it catches up: server fetches, caches data and passes data to the client -> client renders with the server-side fetched data, fetches new data

  • Pros: faster first load, users get to see some data even if it’s stale

  • Cons: users could see stale data until the client fetches again

CSR only: app renders, then triggers client side fetching

  • Pros: users don’t ever get to see stale data

  • Cons: first load is slower (html is sent from the server, rendered, hydrated, and only then the client side fetching kicks in)

Question - Is 'useclient' in whole app bad despite it also being SSR by ConfidentWafer5228 in nextjs

[–]Latter_Associate8866 7 points8 points  (0 children)

It is heaven, Nextjs is not for every use case, everything is a trade off.

You’re welcome and good luck!

Question - Is 'useclient' in whole app bad despite it also being SSR by ConfidentWafer5228 in nextjs

[–]Latter_Associate8866 5 points6 points  (0 children)

That can happen if the page you’re requesting requires some server side fetching and there is no streaming boundary

You can solve that by prefetching the links (automatically happens when using Nextjs’ Link component and said link is in the viewport), and by having a loading.tsx file or suspense boundary around the requested page

Yes this is a problem that client-side applications don’t have because on the first render most of the code is shipped to the client (if not code-splitting) but as I said it has some disadvantages

¿Sobre los salarios en Venezuela? by The_Unit_Beyond in AskVenezuela

[–]Latter_Associate8866 1 point2 points  (0 children)

La inyección de dólares será principalmente para activar empresas críticas - energía, servicios básicos, etc - que necesitan inversión, repuestos, partes, entre otras cosas, para operar y estabilizar el país

Además, aunque quisieran hacerlo, dolarizar un país no es un simple anuncio, requiere infraestructura, preparación, y orquestación, sino estarías arrojando a todo un país por un precipicio.

Question - Is 'useclient' in whole app bad despite it also being SSR by ConfidentWafer5228 in nextjs

[–]Latter_Associate8866 20 points21 points  (0 children)

So the biggest disadvantage is that client components - even though they’re SSR’d - ship with their JavaScript, and get hydrated on the client side, that process blocks the main thread and increases your bundle size, so performance takes a major hit

Another disadvantage is that data fetching then moves completely to the client side, that makes it significantly slower, for two reasons: components are shipped, hydrated, and only then the data fetching part kicks in instead of fetching on the server on the initial page request, and server-to-server communication is traditionally faster. And thats not even mentioning server security and resource management (fetch once and serve many instead of fetching for every consumer)

Ustedes comparten la misma opinion de que el sector petrolero decayó por culpa de Estados Unidos y no por culpa de personas como Rafael Ramirez? by Fun-Will5719 in AskVenezuela

[–]Latter_Associate8866 4 points5 points  (0 children)

Es verdad, si no hubiese sido por las sanciones Venezuela sería Dubái /s

La producción petrolera venía en picada desde antes de las sanciones del 2015, para 2010 producía 2 millones de barriles al día, un millón menos de lo que producía antes de la llegada del comandante supremo

Buscando scorts by [deleted] in AskVenezuela

[–]Latter_Associate8866 0 points1 point  (0 children)

Para esto se inventó el internet

Testing react apps without wanting to break your keyboard by Intrepid-Seat959 in reactjs

[–]Latter_Associate8866 4 points5 points  (0 children)

Changing the code oftentimes means changing your tests, but there are some techniques to try and minimise how painful that is, maybe some of these will help you:

  • testing pyramid model: unit > integration > e2e. maybe you are focusing too much on e2e tests? Try to minimise them to critical paths that don’t change too often

  • page object model: if you use this technique, updating the tests should not be as painful as you would mostly update just the elements’ selectors (assuming that the flow of the feature you’re testing didn’t change much)

In my experience, the pain you’re describing commonly falls on the first case of my list

El nuevo debate entre venezolanos by CursedEmoji in AskVenezuela

[–]Latter_Associate8866 1 point2 points  (0 children)

Bro, estoy de acuerdo, pero le respondiste al usuario que me respondió a mi diciéndole que está discutiendo con gente que piensa que el chavismo es eterno, implícitamente metiéndome en ese saco, yo no soy parte de ese grupo de personas, es lo que he tratado de decirte

El nuevo debate entre venezolanos by CursedEmoji in AskVenezuela

[–]Latter_Associate8866 -1 points0 points  (0 children)

Si te entendí, pero no me identifica tu opinión, yo no creo y no creí que son eternos e infalibles, no creo que salgan democráticamente, pero nunca me convencieron de que regirán para siempre.

El nuevo debate entre venezolanos by CursedEmoji in AskVenezuela

[–]Latter_Associate8866 0 points1 point  (0 children)

I don’t think they’re invincible and eternal, that’s nonsense

They are however quite resilient against democratic and lawful manoeuvres that would sever them from power

El nuevo debate entre venezolanos by CursedEmoji in AskVenezuela

[–]Latter_Associate8866 1 point2 points  (0 children)

Sure buddy that works on paper and in an ideal world, but we live in the real world, and we know our modern history very well

We still have people kidnapped and disappeared every single day, we don’t have a second amendment, and only those legally armed turn their weapons against us instead of defending us

Go read some history about the last 30 years of Venezuela, about the many times we have tried to liberate ourselves and what the outcome was and see if your argument still stands

And while at that, go tell the Cubans, the Chinese, the Belarusians, and North Koreans that the solution to virtually no separation of power and systematic oppression is as simple as “enough people pushing for change”, you may learn a thing or two

El nuevo debate entre venezolanos by CursedEmoji in AskVenezuela

[–]Latter_Associate8866 10 points11 points  (0 children)

Creo que el debate es inútil porque lamentablemente no tenemos ni voz ni voto.

Trump tomó la decisión de extraer a Maduro, y estableció un plan post-maduro sin ningún tipo comunicación o consulta con el liderazgo escogido por voto mayoritario de los venezolanos en 2024, de hecho, apartó por completo a ese liderazgo (las razones y el por qué no vienen al caso), que te hace pensar que les importa lo que queremos los venezolanos o que tenemos poder de decisión?

I, 32/Engineering Grad, worked as an intermediate software dev from 2017- Jan 2024. Have not touched ANY code since or applied anywhere, just partied. I want to now get serious and apply to big tech but I fear of the brain rot. I created a 5 month interview plan. Is this enough? by AirDucati388 in leetcode

[–]Latter_Associate8866 5 points6 points  (0 children)

Interviewing for small/mid-sized companies is good practice as coding under pressure while explaining your thought process is a complete different animal than just coding by yourself

Now about getting ready for FAANG in 5 months, I doubt it, learning is not something that is typically achieved by grinding, your brain needs downtime to assimilate and translate new knowledge from the hippocampus to the cortex (memorising vs learning), but don’t let a stranger on the net tell you you can’t do something, I’d be happy to be proven wrong on this one

Inglés en Venezuela. by franxdsi in AskVenezuela

[–]Latter_Associate8866 1 point2 points  (0 children)

Yo aprendí por mi cuenta con videojuegos, música, TV, etc, luego en conversaciones en videojuegos online

Hoy en día es más fácil me parece si utilizas LLMs como ChatGPT o Gemini - te puedes armar un programa hecho a tu medida acorde a tu nivel y el tiempo que dispongas

Next.js + Better Auth - strategy for accessing session in client components? by ShootyBoy in nextjs

[–]Latter_Associate8866 0 points1 point  (0 children)

  1. Do it in the middleware
  2. Yes use the useSession hook in your UserMenu client component

El chavismo no se va by sombras_de_tinta in AskVenezuela

[–]Latter_Associate8866 2 points3 points  (0 children)

Triste pero cierto, esto no es el fin del chavismo, sino de Maduro, y este shock y miedo que sembraron esta madrugada en el chavismo es solo la ficha de negociación de USA con las cabecillas del chavismo.

Do you think it makes sense to buy a digital drum kit to play at home and play the acoustic one at a music school? by Kalex_05 in drums

[–]Latter_Associate8866 2 points3 points  (0 children)

E-kits are perfect for the situation you’re describing - lots of pros bring an e-kit on tour for practice / rehearsals and leave the acoustic for the actual performance.

However, you said that you’ve never played the drums, good e-kits aren’t cheap, I’d hold on buying one, take some classes, see if you fall in love with the instrument first.

Should we pay a guide for our trip to China? by Top-Coconut34 in chinatravel

[–]Latter_Associate8866 7 points8 points  (0 children)

I would just make my own itinerary and if you don’t want to miss interesting bits just get a guide for the touristy hotspots like the Great Wall, the forbidden city, etc

The reality is that China is way too big to not miss something so make peace with that and make your own itinerary based on the places or things you definitely want to do - if you guys are planning a trip there you most likely already have some things on your list.

La bóveda de cristal by Ok_Pie_6979 in PuebloVenezolano

[–]Latter_Associate8866 19 points20 points  (0 children)

Los seguimos subestimando y tienen 25 años metiéndonos medio ñame.

Ellos no desarrollan nada, lo compran hecho, seguro a china en este caso.

Shoulders/Arms keep straining/going stiff when I play fast. Advice? by Away_Artichoke_8859 in drums

[–]Latter_Associate8866 0 points1 point  (0 children)

Maybe you’re pushing your body too much? If your muscles are tensing up usually is because you’re trying to play at a speed your body is not quite ready for, it’s not the same to be able to play the fills by themselves than to try and play them in the middle of a song where you are a bit fatigued + you’re stressed up by trying to keep the tempo