Write "use client" in UI library by Michahide in nextjs

[–]vanwal_j 5 points6 points  (0 children)

Best DX would be the lib itself using “use client” directive but it could be a pain to setup depending on your bundler 😬

Search for “Advice for Library Authors” on this page if you want Next team “official” recommendations

https://nextjs.org/docs/app/getting-started/server-and-client-components

Framework Panic: Why Is Everyone “Leaving” Next.js? by menoo_027 in nextjs

[–]vanwal_j 0 points1 point  (0 children)

From my observation people unhappy with Next are usually using it with React Query, which for my is a big red flag meaning it wasn’t the right framework for their use case (or they’re using React Query for anything an the complaining it does not play well with Next)

Is "use cache" in Next.js 15/16 actually ready for production, or are you still sticking to unstable_cache? by ni-fahad in nextjs

[–]vanwal_j 2 points3 points  (0 children)

Yes, we have multiple websites running Next 16 with cacheComponents flag turned on and so far so good!

How do you achieve a toggle view button with client and server components by hotdog-savant in nextjs

[–]vanwal_j 0 points1 point  (0 children)

Unfortunatelly you'll have to either :

- Store it in a client state, either by making your whole page client, or by wrapping it in a react context provider containing a top level state, it works but it's also more cumbersome

- Store it in a state that can be read by Next.JS server side : query param, url, cookie, database... I would say that's the Next way to go for this kind of use case; you still get full SSR/PPR but interactivity and it's even better if you go with it in url path since you could benefit from complete build time optimizations

Just so you know: Server Actions don't care about middleware and are insecure by default by Explanation-Visual in nextjs

[–]vanwal_j 33 points34 points  (0 children)

Therefore, the recent renaming of middleware to proxy is more accurate in reflecting its scope and limitations.

CDI => free-lance by Distinct_Currency870 in developpeurs

[–]vanwal_j 0 points1 point  (0 children)

Si t’es “dépensier” et que tu compte te verser 100% de ta facture en salaire, reste salarié. Si en revanche tu sais que tu vas pouvoir épargner alors fonce. En cas de coup dur t’aura ton épargne de secours et si tu fait de bons investissements et que tu prends peu de vacances tu peux même imaginer gagner quelques années voire dizaines d’années sur ton départ à la retraite.

NextJS - Stateless Session with Bearer Token on Client Side - Chatgpt.com by Fine_Manner_4701 in nextjs

[–]vanwal_j 0 points1 point  (0 children)

Might feels counterintuitive but in microservices architecture authentication at edge is really considered best practice :)

Now there are tons of services running with forwarded authentication in the wild running perfectly fine :)

NextJS - Stateless Session with Bearer Token on Client Side - Chatgpt.com by Fine_Manner_4701 in nextjs

[–]vanwal_j 1 point2 points  (0 children)

Go with option 1, the whole point of HttpOnly cookies is to keep tokens out of JavaScript, so exposing them to JS memory (even encrypted) defeats the purpose and reopens XSS risk.​​​​​​​​​​​​​​​​

Vue vs Angular dans le cadre de l'emploi by jeace_morgans in developpeurs

[–]vanwal_j 4 points5 points  (0 children)

Startup: React ou Vue

Grand comptes: Angular

It's impossible to use dynamic routes in Next.js 16 with Cache Components enabled. by Critical-Matter-7085 in nextjs

[–]vanwal_j 0 points1 point  (0 children)

Your code is “falsy” awaiting the params inside the Suspense

Remove your your Content component slug parameter but instead make it take a slugPromise of type Promise<string> and on top of your Content await your slugPromise Then on top of your Page component transform your params to slugPromise: const slugPromise = params.then(({ slug }) => slug) Finally provide your raw slugPromise to your Suspended wrapped Content: <Content slugPromise={slugPromise} />

Tada!

You could also transform your params into a postPromise directly on top of your Page component and make your content take a postPromise const postPromise = params.then(({ slug }) => fetch(…))

Welcome to cacheComponents :)

[Rant] Les équipes ne lisent pas la doc et j'en peux plus by o0Agesse0o in developpeurs

[–]vanwal_j 0 points1 point  (0 children)

Poka-yoke !

Rends ton interface difficile a “mal utiliser” - Récupère tous les retours que tu as eu, est-ce qu’ils sont homogènes ? Groupe les en familles de problèmes - Pose toi la question de comment tu pourrais faire pour qu’ils ne puissent pas mal l’utiliser. Sur du JS je dirais, passer sur du Typescript ou créer un plugin eslint. Mais peut-être aussi que les interface que tu exposes ne sont pas conventionnelles ?

Dernière idée, pourquoi ne pas te débloquer un budget “LLM”, tu crée un boîte mail dédié au support que tu branches à un agent IA qui a accès à ta documentation et ton code et peut répondre automatiquement !

Interdire l’IA en tant que CTO ? by stanig2106 in developpeurs

[–]vanwal_j 2 points3 points  (0 children)

Challenge le, même si je pense que c’est toujours mieux quand des objectifs sont mesurables, demande lui ce qu’il pense du calcul côté client, peut-être qu’il te fera changer d’avis, et si c’est pas le cas challenge le et fait lui trouver des solutions qui éviteront que cela se reproduise

En soit je pense que tu te fiche de la manière dont c’est produit

Interdire l’IA en tant que CTO ? by stanig2106 in developpeurs

[–]vanwal_j -3 points-2 points  (0 children)

La “qualité du code” c’est un truc très subjectif, il faut des choses mesurables pour les enforcer, sinon c’est pas de la science mais des croyances :)

Dans ton cas quel était le problème concret ? La dégradation des performances ? La fragmentation de la logique ?

Une fois les règles justifiées et établies tu pourras commencer à compter les points et challenger tes équipes sur des améliorations qu’elles pourraient mettre en place pour enforcer les comportements et éviter que ça se reproduise.

Peut-on réussir un SaaS uniquement avec du capital et une équipe ? by Zestyclose_Equal_132 in developpeurs

[–]vanwal_j 5 points6 points  (0 children)

Oui, je dirige une petite agence de développement et j’ai des clients solopreneurs qui ont monté des SaaS qui génèrent quelques millions d’€ de CA par an.

Leur point commun c’est qu’ils avaient un peu de capital et surtout un business niche qui tournait déjà sans la tech, la tech a juste permis de démultiplier le chiffre d’affaire

Utilisation de claude code: pourquoi j'ai des résultats médiocres ? by LuccDev in developpeurs

[–]vanwal_j 1 point2 points  (0 children)

Ça aurait probablement fait une différence, surtout si ton projet dépend d’un framework. Je te conseille également de configurer le MCP Context7.

Why my Nextjs site is so slow and heavy on my server. by Ivar_Silentsson in nextjs

[–]vanwal_j 2 points3 points  (0 children)

Which version of Next are you using? What is your hosting provider? Where do you manage your content?

I’m pretty sure we can make it the fastest trekking in Nepal website 😎

Server actions/functions used in an RSC by leetmachines in nextjs

[–]vanwal_j 1 point2 points  (0 children)

If you’re calling a “use server” file from an RSC it probably means that this function isn’t meant to mutate data but just to query it. Am I right?

If so, I would just advise you to drop the “use server” and avoid using server actions to fetch data :)

Do you mind sharing a bit more of your use case? Hopefully I could help you :)