matrix

kennytilton 2022-03-19T10:20:15.888099Z

Ah, we have an MPA vSPA civil war! Why was I not told?! 🙂 Nice overview and debate: https://thenewstack.io/htmx-html-approach-to-interactivity-in-a-javascript-world/ What I am seeing is a phenomenon we see in the Flux-pattern fail: premature lock-in to plausible but bad solutions to some existing problem. We will need a snappier name. Consider the HTMX guy: “I think a lot of the JavaScript frameworks now, you’re building almost a thick client in the browser,” said Gross in an interview with The New Stack. “....When you’re in that world, you can do a lot more, obviously, but there’s a lot more complexity.” The key: "you can do a lot more, obviously, but there’s a lot more complexity". So we have a baby-bathwater deal: Gross is conceding we can do a lot more with JS. So he should have stopped right there and worked on the complexity. Instead he retreated to HTML, losing the "lot more" baby (and put more than a little complexity into HTMX--see below). We saw this in Redux. They got frustrated with MVC and conceived Flux. It worked but was a PITA. Redux was better but a PITA. So we turn back to MVC and fix the state some other way? Nope. Redux Toolkit... I also see this in Gross's response: "We often recommend using htmx for the parts of the app where it makes sense to keep things simple, and then using other technologies when needed: alpine.js, hyperscript, a small reactive framework, etc." Ouch. The bloat and complexity is back, in spades. I love the throwaway "a small reactive framework". He does not even name one? I googled "HTMX+MobX", came up empty. I was wondering if HTMX included reactivity. And he ends that list with "etc"? Uh-oh. :)

kennytilton 2022-03-19T15:12:32.203459Z

I thought I was joking when I said "civil war". I had not read the whole HTMX response. It ends with this.

chromalchemy 2022-03-19T18:34:24.225959Z

Very interesting! I have not used HTMX much yet. I was attracted to the idea of a polished lightweight framework that handles all the basic page management (bc I am not a not much of a js dev) , and has a good simple story for page state. I was intrigued when Clojure Biff framework pivoted to using it for a thin client to enable a server-size colure app. https://biffweb.com/docs/#htmx

chromalchemy 2022-03-19T18:36:19.567919Z

After looking at it + Hyperscript, it looks pretty slick, but I don’t really understand where the state is really supposed to live. Html attrs I think, + js vars if you want. Is it scattered about? Can static html tag be a component? The HTMX part is orient towards being served html, not pure data.

chromalchemy 2022-03-19T18:36:26.431009Z

In my case, I can get data in json and handlebars html templating from the server. I need to respect Server-side generation of initial html, because I think it is probably still important for SEO. HTMX probably doesn’t make as much sense for me without a clojure server to pair. And I really don’t want to learn a new language right now (though it does look nicely minimal).

chromalchemy 2022-03-19T19:53:14.034399Z

I think i saw somewhere that one htmx element could watch another. Or more or probably typical to wire them up with bespoke events.

chromalchemy 2022-03-19T20:00:43.873369Z

I guess the attraction is small page-load, w pre-rendered html (SEO), and potentially easy to use html components with co-located logic (that can be developed server-side, in clojure etc). But at the cost of…. a new language, necessitating an html/hypermedia server, and potentially scattering logic and state around in a different way?

chromalchemy 2022-03-19T20:06:08.294339Z

> premature lock-in to plausible but bad solutions Lol. That’s exactly what I’m trying to avoid! Your take on these things is very helpful. There is a lot of plausibility out there 🤔

chromalchemy 2022-03-19T20:19:32.965119Z

ps check out #membrane project is on to some cool reactive stuff (at dev time). https://files.slack.com/files-pri/T03RZGPFR-F036XQ767KP/clojure-rules.gif https://clojurians.slack.com/archives/C02V9TL2G3V/p1646782532013739 (desktop only atm)

kennytilton 2022-03-19T03:55:03.497689Z

Hey, @chromalchemy. Two things: I did a dead simple multi-mx set-up and no issues initially. But I still have to try inter-matrix reactivity, and see how it all behaves with matrix structure dynamically changing. This is already handled OK within a single matrix, and that logic IIRC will not care if unlinking has to work across matrixes. Second, I looked at HTMX a bit more, and I have doubts about the whole approach of extending HTML to get more oomph out of web programming. Are you having good luck with it? Is it gaining traction?