Live data from Hacker News

Removing React.js from the codebase and adapting Htmx for UI interactivity (2023)

misago-project.org

71–80 of 224 posts

Re: Removing React.js from the codebase and adapting Htmx for UI interactivity (2023)

#71

I think HTMX is a great fit for forum software. Forum websites mostly deliver non-interactive content in the form of text and maybe some audio, video, or image content. All of this can be represented as HTML and CSS. With HTMX you can do partial rendering and live updates via server-sent events. This gets you most of the way to the "client side" feel where things load dynamically based on user actions. The only prope…

> Forum websites mostly deliver non-interactive content

I'd say that "Endless Scroll" is a good example of something that is... well maybe not interactive but still breaks the "just an HTML document" page metaphor that plays nice with such things.

Now, personally I find the UI compromises it takes to make endless scrolling happen are abhorrent (like not being able to ctrl-F or export the page content). But other people obviously like them.

Is that the kind of thing you'd be giving up as you move to a platform like HTMX?

Re: Removing React.js from the codebase and adapting Htmx for UI interactivity (2023)

#72
post #60
post #53

Replace React / Vue with HTMX 2 years ago and still going strong. Hono + WebComponents + HTMX + serverless is the backend for my apps now.

What is the point of using HTMX if your backend is JavaScript(Hono)?

Adopting something like HTMX is primarily a UX choice, and the language you use to serve it is almost irrelevant to UX. JavaScript is a nice backend language. It’s fast, has a massive ecosystem, and many people know it well.

Re: Removing React.js from the codebase and adapting Htmx for UI interactivity (2023)

#73
post #71

I think HTMX is a great fit for forum software. Forum websites mostly deliver non-interactive content in the form of text and maybe some audio, video, or image content. All of this can be represented as HTML and CSS. With HTMX you can do partial rendering and live updates via server-sent events. This gets you most of the way to the "client side" feel where things load dynamically based on user actions. The only prope…

> Forum websites mostly deliver non-interactive content I'd say that "Endless Scroll" is a good example of something that is... well maybe not interactive but still breaks the "just an HTML document" page metaphor that plays nice with such things. Now, personally I find the UI compromises it takes to make endless scrolling happen are abhorrent (like not being able to ctrl-F or export the page content). But other peop…

Nope, HTMX could power endless scroll features if you want them

Re: Removing React.js from the codebase and adapting Htmx for UI interactivity (2023)

#74

Earlier quoted context omitted.

As someone who wrote a lot of angular back in the day, and who writes a lot of htmx in the current day... That comparison makes absolutely no sense. The only thing the 2 have in common is the use of HTML attributes for functionality. Completely different on every other axis that matters.

It is different in that some of what happened on the frontend now happens in the backend, but overall, it is the exact same approach, so as I said in a sibling comment, it, it is just a second attempt at angular 1.0 with even more naive assumptions about web.

Based on skimming the couple sibling comments, I believe the issue you have had with htmx is precisely that you have somehow conflated it with angular. If you think they're the same, you will use them the same and have the same poor outcomes.

In another comment, you mentioned State Management. If this is on your mind then you are using htmx wrong. You should not be managing any client side state with htmx. State is on the server or in your database. Interactions on the client should immediately reflect the updated server state. If you have separate state on the client that needs to be managed, you are going to have a bad time regardless of framework.

Re: Removing React.js from the codebase and adapting Htmx for UI interactivity (2023)

#75

Earlier quoted context omitted.

It can be. Think something like a file viewer or a text editor, or a music players. You can probably make do with vanilla javascript, but there’s some threshold where using react to take care of the state ui relationship is worth it.

A text editor or music player is hardly "mini". Again, the issue with htmx is that it pretends like it is not a framework, when in fact, it is just a second attempt at angular 1.0, with even more naive assumptions about web apps.

Having adopted Angular 1 back when it was new, I can promise you it's completely different than Htmx.

Re: Removing React.js from the codebase and adapting Htmx for UI interactivity (2023)

#76
post #71

I think HTMX is a great fit for forum software. Forum websites mostly deliver non-interactive content in the form of text and maybe some audio, video, or image content. All of this can be represented as HTML and CSS. With HTMX you can do partial rendering and live updates via server-sent events. This gets you most of the way to the "client side" feel where things load dynamically based on user actions. The only prope…

> Forum websites mostly deliver non-interactive content I'd say that "Endless Scroll" is a good example of something that is... well maybe not interactive but still breaks the "just an HTML document" page metaphor that plays nice with such things. Now, personally I find the UI compromises it takes to make endless scrolling happen are abhorrent (like not being able to ctrl-F or export the page content). But other peop…

Infinite scroll with htmx: https://htmx.org/examples/infinite-scroll/

Re: Removing React.js from the codebase and adapting Htmx for UI interactivity (2023)

#77

Using Django w/ frontend frameworks has been a struggle for me. (I only dabble as a hobbyist.) I think splitting the backend off into a restful API makes the marriage work. I've looked at django-rest-framework ( https://www.django-rest-framework.org/ ) and django-ninja ( https://django-ninja.dev/ ). Of course,, then you're discarding a lot of batteries that come with the django framework. Perhaps using Django templat…

That's the architecture my B2B SaaS uses, except Vue instead of React. We deploy the SPA to a CDN and it feels snappy. Some clients access the API directly via OAuth. django-allauth is the other critical piece. Works great altogether.

Re: Removing React.js from the codebase and adapting Htmx for UI interactivity (2023)

#78
post #29

Earlier quoted context omitted.

> Hypermedia is what to web apps what XML is to programming languages. I have no idea what this means. The World Wide Web itself is quite literally hypermedia. The fact that a lot of front-end frameworks appear hell bent on ignoring this fact doesn't make it any less true. > Again, the reason we have finally stabilised on JSX is because you can't really "Declare" away HTML or sophisticated data and event management..…

> You may have stabilised on JSX, "we" have not. Just about any reputable sources puts the combined market share of React, Vue, Angular 2+, and Solid well above 80%. So I am not sure what "we" you are talking about.

> Just about any reputable sources puts the combined market share of React, Vue, Angular 2+, and Solid well above 80%.

I have no idea if that's accurate, but let's assume for a moment that it is.

- Vue supports JSX, but it is not the default.

- Angular does not support JSX.

- Svelte, which you neglected to mention, does not support JSX.

- Solid does indeed use JSX, as of course does React.

So two out of the five main SPA frameworks don't even support JSX, and another doesn't typically use it.

As I said, you may have stabilised on JSX, "we" have not.

Re: Removing React.js from the codebase and adapting Htmx for UI interactivity (2023)

#79

I basically use HTMX for all my Web Apps, including PWA(s) that run as ~near native apps on iOS/Android. It's great! I aso pair this with DaisyUI+TailwindCSS. YOu really can't go wrong, there is something quite pleasant about writing your web apps in ordinary HTML with partials and the extensions that HTMX adds to the browser for SPA-like interactivity.

Big fan of bDaisy and TW ...all thats missing is jQuery and Razor .cshtml to rock my 2026 mistersoft web stack. HTMX is very cool but $...

Re: Removing React.js from the codebase and adapting Htmx for UI interactivity (2023)

#80
post #54

Earlier quoted context omitted.

> The only properly dynamic SPA-like feature in a forum I can think of is a WYSIWYG editor, but that you can build as a web component. Maybe a flexible highlight and quote system would be a bit difficult in pure HTMX (think of the comment functionality in Medium posts). So you'd want to build a few things in client side JS. But the main experience could very well be built with HTMX. That's how interactivity has alway…

> React/Vue/etc solve a specific problem: single-page application That's not true. They solve the problem of requiring separate code paths for interactive elements - one for initial render and another for updates. Previously the server rendered the initial HTML and then client JS updated it after e.g. user clicks a button, but with React/Vue/etc., it's merged into one code path because HTML is derived from the curren…

Only react "solves" that. In vue component setup only runs during mount. Update is not a thing in the way react has it.
Post reply on HN