Skip to content

a htmx like experience in Next.js with RSC and quite a bit of questionable code.

Notifications You must be signed in to change notification settings

rafaelrcamargo/htnx

Repository files navigation

Okay, I did it; this probably broke every rule or principle that htmx has, and it's hard to defend myself… So why did I do this? For fun! Guess what? Coding can be fun, and doing things can be entertaining.

Important

This was created mainly as a joke, and I don't even know if it's stable and reliable enough to be used in production, so please don't do that. If you want to use htmx, use htmx, it's a great project, and I'm sure it's way more reliable than this.

Backstory

Over the past months I've heard a lot about htmx and decided to look at it, and it feels magical. In a sea of complexity and maximalism, something as simple as HTML on... steroids? It sounds like a fantastic new world.

And after that, of course, I had to try it, and it's awesome and a really good experience, but while reading about it, me being a React kind of guy (outch) couldn't stop thinking about RSC, and how strangely enough in my mind those things could work really well together (yes, I get scared about my own thoughts sometimes too). So guess what?

Let's try this!

I never actually read about returning components from React Server Actions on Next.js, but it definitely is possible, as someone pointed out on Twitter some months prior (didn't find the tweet), so what's then? What else do we need to do?

About

a htmx like experience in Next.js with RSC and quite a bit of questionable code.

Topics

Resources

Stars

Watchers

Forks