@odrotbohm@chaos.social avatar

odrotbohm

@odrotbohm@chaos.social

Frameworks & Architecture in the Spring team @ VMware, OpenSource, all things Spring, Java, data, DDD, REST, software architecture, drums & music. He/him.

This profile is from a federated server and may be incomplete. Browse more on the original instance.

scy, to webdev
@scy@chaos.social avatar

I've spent a few days playing around with #HTMX, and I'd like some insights from people who are using it in production. Doesn't need to be a paid project, but more than just "my pet experiment".

What are you using it for?

Like, to me it feels as if either the backend needs to be really tailored to HTMX, with HTML fragments and custom headers and stuff, or you need to start writing non-trivial amounts of JS in the frontend for anything but the most basic tasks.

#WebDev

odrotbohm,
@odrotbohm@chaos.social avatar

@scy You asked a generic question, you get a generic answer. 🙃 doesn’t have to be a template. What matter is whether you can render snippets of HTML. A chat sounds like an easy enough todo thing as it’s basically appending divs. HTMX has native support for SSE, so depending how your server stack can deal with those, you should be able to get away without any custom JavaScript.

odrotbohm,
@odrotbohm@chaos.social avatar

@scy It doesn’t. If in doubt serve the entire page, HTMX is gonna swap out the page and it still feels snappier. From that on, you might leverage your template engines ability to render and serve partials, but that’s an optional albeit pretty common approach.

odrotbohm,
@odrotbohm@chaos.social avatar

@scy I was replying to the „does it need to be tailored to HTMX“ part. You didn’t mention anything about a chat in the first post either, which is a very specific use case. OOB swaps are a first-class concept. Returning exactly the elements I want to have updated feels pretty natural to me.

odrotbohm,
@odrotbohm@chaos.social avatar

@scy Out of band swaps is what you’re looking for. Those allow you to send multiple partials that HTMX would put into the right place. You could return a single chat message besides some other div with an event (just make them sibling elements with the proper hx:swap each) and HTMX takes care of the rest. IIRC replace by ID is the default.

odrotbohm,
@odrotbohm@chaos.social avatar

@scy I think part of the challenge is that you conveyed two questions at once. A broad one (“What do you use it for?”) and a very specific one (“how don’t solve this one special thing for my chat app?”). That’s hard to respond to on social media.

On the former: I’ve built pretty complex dashboards for a commercial product in the SBOM space, some health care related CRM-like UI and some advanced examples primarily focusing on integrating micro-frontends.

odrotbohm,
@odrotbohm@chaos.social avatar

@scy It feels like you’re overthinking it a little. The server sends HTML, you send the server forms, state is in the URI, nowhere else. If you think in these constraints (the constraints of the web essentially) things usually fall in place easily.

odrotbohm,
@odrotbohm@chaos.social avatar

@scy @pa You’d send a form with the data to be changed, the server renders all elements that need to be replaced with new data. You return those to the client and HTMX replaces all elements you send. No custom JavaScript required.

odrotbohm,
@odrotbohm@chaos.social avatar

@scy @pa I see. That “change username“ functionality existed before? How did you handle that on the server?

odrotbohm,
@odrotbohm@chaos.social avatar

@scy @pa HTMX really plays to its strengths when you can both handle form submissions and produce HTML. It’s the antidote to the client messing with JSON and turning this into HTML eventually. I guess with a constrained server-side, HTMX is not of much help.

frankel, to random
@frankel@mastodon.top avatar

I recently read a post on "6 Ways To Pass Parameters to API". Though the title is a bit misleading, as it’s unrelated to REST, it does an excellent job listing all ways to send parameters to a Spring application. I want to do the same for ; it’s beneficial when you write a custom plugin.

https://blog.frankel.ch/pass-parameters-apisix/

odrotbohm,
@odrotbohm@chaos.social avatar

@frankel I am not a fan of posts that misrepresent what they’re doing in their titles. Just as the original post it lists different ways to pass any kind of data but speaks of „passing parameters“. It feels like folks want to deliberately not understand the thing they claim to talk about. Words have meaning. Your post might be fine in general. But it’s riding a broken horse.

odrotbohm,
@odrotbohm@chaos.social avatar

@frankel The one way to pass parameters is as… drumroll as parameter. 🙄🤷‍♂️

odrotbohm,
@odrotbohm@chaos.social avatar

@frankel Yes.

odrotbohm,
@odrotbohm@chaos.social avatar

@frankel There’s just no „x ways“ to transfer parameters. There’s one. Because HTTP knows exactly one concept of a request parameter. Except you deliberately misinterpret what „a parameter“ is and tunnel it through other mechanisms. Which is abusing the protocol.

odrotbohm, to random
@odrotbohm@chaos.social avatar

Funny how, after that AWS piece, everyone is “You need to build a suitable architecture, and if it doesn’t fit, adapt.” Well, no shit, Sherlock!

The real question is: why do teams (feel incentivized to) start with something way more complex than necessary in the first place?

odrotbohm, to random
@odrotbohm@chaos.social avatar

If you want to avoid solving the problems of large, distributed systems, build small, non-distributed ones.

odrotbohm, to random
@odrotbohm@chaos.social avatar

@shochdoerfer Der @ufried nächtigt scheinbar im gleichen Hotel wie ich. Ich kann ihn morgen einfach mit zu dem Event bringen?

odrotbohm, to random
@odrotbohm@chaos.social avatar

Today is the saddest day I’ve had in my more than 13 years with the team. 😔

odrotbohm, to random
@odrotbohm@chaos.social avatar

“Our results suggest that improving code maintainability from very high to excellent pays off. The returns in the upper end of the quality spectrum are not diminishing — they are increasing. This underscores that exceptional code quality is not only a developer’s vanity metric.” — https://arxiv.org/pdf/2401.13407.pdf (PDF)

odrotbohm, to random
@odrotbohm@chaos.social avatar

If anyone is arriving around 9am at Mannheim central station tomorrow for @unKonf, ping me. I can give you a lift to the venue.

odrotbohm, to random
@odrotbohm@chaos.social avatar

#jMolecules Integrations 0.19 released! Improvements in code generation, dependency setup and #ArchUnit rules. Use BOM version 2023.1.2. https://github.com/xmolecules/jmolecules-integrations/releases/tag/0.19.0

odrotbohm, to random
@odrotbohm@chaos.social avatar

A blast from the past at !

odrotbohm, to random
@odrotbohm@chaos.social avatar
odrotbohm, to random
@odrotbohm@chaos.social avatar

Briefly thought about submitting to the call for papers of . Skimmed through the diversity of the program of their topic days' tracks (women / men):

1 / 9
0 / 9
0 / 6
0 / 5
0 / 6
0 / 12 (Track: Entwickler:innen (!))
0 / 5
2 / 7

Seriously? Wow. 🙄

odrotbohm, to random
@odrotbohm@chaos.social avatar
odrotbohm, to random
@odrotbohm@chaos.social avatar

A new community for women software architects: https://www.architecther.co.uk/ 👏 (via @ahl)

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • kavyap
  • DreamBathrooms
  • tacticalgear
  • magazineikmin
  • khanakhh
  • everett
  • Youngstown
  • mdbf
  • slotface
  • rosin
  • ethstaker
  • InstantRegret
  • thenastyranch
  • JUstTest
  • ngwrru68w68
  • cisconetworking
  • cubers
  • osvaldo12
  • modclub
  • GTA5RPClips
  • tester
  • Durango
  • provamag3
  • anitta
  • Leos
  • normalnudes
  • lostlight
  • All magazines