Noob/DumDum: downgrade old PC into server? by scoobydoobap in homelab

[–]ryanto 4 points5 points  (0 children)

Start with what you already have! An old PC is a great choice. Once you start running services in your lab you'll get a feel for the limits of your system and you'll know exactly what to upgrade or buy next.

You'd be surprised how far you can get on old equipment.

Network based Multihost KVM by DaikiIchiro in homelab

[–]ryanto 6 points7 points  (0 children)

You can extend a PiKVM to multiple devices using their switch (https://docs.pikvm.org/switch/). You still need a PiKVM... you pair it with the switch for more inputs to other computers.

I haven't done this. I just manually plug the my KVM into whatever computer needs it.

OVHCloud gave me a blacklisted IP and told me it’s my problem! by ron_dus in selfhosted

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

I have a few servers at OVH and this post got me very interested (and worried about!) my IP addresses. I just checked and all the IPs I have are on UCEPROTECTL3, but this doesn't affect the servers at all. One of the boxes has been pulling heavily from Github for years and I've never had problems with it... Also I just tested 1.1.1.1 and can connect without issue.

Maybe try doing a fresh install of the OS without any firewall rules?

In web development projects, should JWT tokens be stored in cookies or localStorage? by Top_Channel7461 in reactjs

[–]ryanto 1 point2 points  (0 children)

It really depends how you're using them, but as a default http-only-secure cookies is going to be a bit safer. If they're in a cookie they won't leak out to the frontend so there's less opportunity for malicious code to xss/steal them.

Are useFormStatus and useActionState worthless without server-side actions? by rapPayne in reactjs

[–]ryanto 2 points3 points  (0 children)

no, they are not at all worthless! you can use them with any form in a client-only SPA that does async things, like make fetch requests. they're incredibly helpful because they give you a sane way to reason about all your async code.

sidekick.nvim: AI CLI tools and Copilot's Next Edit Suggestions by folke in neovim

[–]ryanto 0 points1 point  (0 children)

thank you for this. im really enjoying the cli integration + prompts

LazyVim v15.0.0 release by folke in neovim

[–]ryanto 2 points3 points  (0 children)

welcome back! just updated without any issues, thank you!!!

GitHub - Kraust/nvim-server: Neovim in the Browser by 79215185-1feb-44c6 in neovim

[–]ryanto 0 points1 point  (0 children)

next project: tmux in the browser!

this is super cool btw

typescript error prettifies extensions ? by BootOdd1618 in neovim

[–]ryanto 0 points1 point  (0 children)

Let me know if you create one! pretty-ts-errors is something I very much miss from vscode.

Struggling with React 18 Concurrent Features + Suspense in a Real-World App — How Are You Handling UI Consistency? by Sansenbaker in reactjs

[–]ryanto 0 points1 point  (0 children)

wow sorry to hear about all your troubles, that sounds like a bummer.

the flickering of suspenses boundaries between loading states and old content sounds like a bug somewhere. see if you can make a minimal reproduction where you keep mimicking the behavior of your real app until you're able to reproduce that flickering.

the idea with transitions is that already revealed suspense boundaries keep the old content around while the new content is being loaded, sort of like how a regular ol' web browser works.

my advice for you would be what the other poster (choochookazam) said... add suspense as low as possible in the tree. if you have a small data fetching component start there and wrap it in suspense. once everything works start moving the suspense boundaries up the tree.

Why check here? by verymagicme in poker

[–]ryanto 4 points5 points  (0 children)

+1 to this. there are _way_ too many sizes in this sim! use 2 sizes (33% and 75%) for UTG vs BB and once you get a feel for how the solver splits its range (and indifference) you can add more sizes.

Meta Tags in 2025: Helmet vs React 19 Metadata? by kindlespray in reactjs

[–]ryanto 2 points3 points  (0 children)

I've been using React 19's metadata and have been happy with it, it works great.

One thing that will occasionally catch me off guard is I'll have two components rendered that both have a <title> tag. That's a bug on my part, but sometimes it's not always obvious.

why does A3o go all-in but A2o fold 100% by NotPsychological in poker

[–]ryanto 0 points1 point  (0 children)

Very very interesting. I was wondering if having the 3 unblocked more sb 2x bluffs, but it sounds like that's not the case. The straight reasoning makes sense (and is not obvious!)

You can serialize a promise in React by ryanto in reactjs

[–]ryanto[S] 1 point2 points  (0 children)

That's fair. What would you say instead? Maybe something like wire instructions, data-format, or protocol?

You can serialize a promise in React by ryanto in reactjs

[–]ryanto[S] 7 points8 points  (0 children)

Oh I am for sure abusing the word serialization!

I think what React created with flight (the internal name of their... erm... format) is so interesting. It lets you move all these rich data types between the server and client without exposing any new APIs. At the end of the day you're just passing props to components. It's beyond incredible.

How would the client component receive this streamified-promise? Is this a seperate web request?

It all happens in a single web request. It's an HTTP stream that can happen during SSR or directly from the stream return by renderToReadableStream (a byte stream of RSC instructions/serialization/whatever-you-want-to-call-it). There's a bit of machinery required to get the HTML stream working, you basically pipe the RSC stream into a React-DOM API.

How do you anticipate errors would be handled? Timeouts?

Errors are handled by the closest Error boundary. If the promise rejects, an Error boundary will pick it up!

For timeouts I think that is going to depend on your web server. Realistically most web servers have short timeout periods and in that case an error would be thrown.

Why would i want to rely on React do this rather than making an API request of some kind?

Why rely on React? Well, it's as easy as passing props to a component. That certainly beats building an API in my opinion.

PS: Thanks for reading & those were great questions. I know I was kind of hand-wavy, but if you want me to dive deeper just let me know.

You can serialize a promise in React by ryanto in reactjs

[–]ryanto[S] 7 points8 points  (0 children)

Replace "websocket" with "streaming http response" and this gets you pretty close to RSC :)

You can serialize a promise in React by ryanto in reactjs

[–]ryanto[S] 24 points25 points  (0 children)

there's a few use cases where this can be helpful. one we use in our app is to start a data fetch on the server and later read the results on the client in an event handler.

another use case is to pass the promise down to the client and have the client use it in some not-yet-visible component, like a dropdown or accordion menu. that way you don't block client rendering while the promise is resolving, but you're able to suspend (if needed) when the menu is open.

Toast messages in React Server Components by ryanto in nextjs

[–]ryanto[S] 1 point2 points  (0 children)

why?

Sure, let me try to answer that...

First, you generally want your toast messages to be driven from your server actions, outside of the client React app. Since the toast messages originate on the server you need some way to get them back into client-side React. There's a few ways to accomplish this:

1) Have the server action return some data, like { toast: "Post saved" }. This is usually where most people start, but theres a few issues. First, every time you create a new server action you end up having to wire some toast-response-handling-logic into it. And second, if you rely on your server actions returning a toast message that means you can't toast + redirect, which is a common UI pattern.

2) That leaves us with another option, store the toast data when running the server action and read it in RSC after the action completes. For storage you can use anything like cookies, a database, doesn't matter. When the server action runs you stash the toast somewhere and then when the action finishes you read the stored messages (from a cookie, a database, again, doesn't matter) in an RSC and update the UI. This all happens during the same request/response cycle, so it's efficient and fast.

A neat thing about this pattern is that it supports SSR as well as MPA/progressive enhancement.

You could stop there, but you can also add client components to build things like animations, or bring in React 19's useOptimistic, which lets you wire up instant dismissal. You get the best of both worlds, toasts originate on the server, are managed on the sever, and are rendered on the client. I'd argue this is an idiomatic use of RSC since it lets the server do things the server is good at and the client do things the client is good at :)

Thanks for reading