keithjgrant,
@keithjgrant@front-end.social avatar

I’m sorry, but I think HTMX is just gross.

A worthwhile experiment, absolutely, but I can’t see myself ever using this for a serious production application. I hope we keep iterating on this before settling for a non-turing complete, directive-driven language that gives Angular 1.0 PTSD flashbacks

#webdev #JavaScript #htmx

skwee357,

@keithjgrant Joining other commenters. You combine htmx and hyperscript. I’m not a fan of hyperscript, but I enjoy htmx.

It’s a breath of fresh air after all bloated frontend frameworks

keithjgrant,
@keithjgrant@front-end.social avatar

@skwee357 That’s a screenshot straight from the HTMX docs. What else am I supposed to assume here?

skwee357,

@keithjgrant Hmm.. that their docs are not good?

skwee357,

@keithjgrant Anyway, don’t judge the book by it’s cover

keithjgrant,
@keithjgrant@front-end.social avatar

@skwee357 It’s a non-turing complete language. I can’t rely on that for real world app development.

sergi,
@sergi@floss.social avatar

@keithjgrant @skwee357 it's a screenshot that is omitting the line just below the piece of code saying that is has hyperscript in it. Doesn't seem fair to say that the documentation does not make that clear.

vintprox,
@vintprox@techhub.social avatar

@sergi @keithjgrant @skwee357

OK, I get what's happening here. Example goes hard out of scope than what HTMX serves. No wonder we get confussed Pikachus around this breathe of fresh air.

keithjgrant,
@keithjgrant@front-end.social avatar

@sergi @skwee357 What is clear, then, is that HTMX is extremely limited in its capability, and it isn’t even able to offer this simple example without augmenting itself with Hyperscript or something similar. IOW, it's no replacement for a proper frontend framework.

I guess that's fine for what it is, I guess, but that's not something I'm interested in using

sergi,
@sergi@floss.social avatar

@keithjgrant @skwee357 you are correct, it's a simple library, not aimed to replace everything a big framework like Angular or React provides. I recommend reading this essay to better understand when and when not to use it: https://htmx.org/essays/when-to-use-hypermedia/

oliverandrich,
@oliverandrich@fosstodon.org avatar

@keithjgrant That’s hyperscript and has to be installed separately. I enjoy htmx and the hx-attributes. Hyperscript will never be part of our stack.

erichoose,

@keithjgrant I think htmx is a worthwhile step in the right direction. Do I think it's the end all be all? Not really

t_var_s,
@t_var_s@phpc.social avatar

@keithjgrant I would probably try it without sweet alert or forget about htmx for this case.

peerreynders,

@keithjgrant

I found Unpoly's messaging a lot more convincing in 2015.

http://triskweline.de/unpoly-rugb/#/1

carlozancanaro,

@keithjgrant I think of htmx as being more about a server-driven application architecture. That code block is showing off some advanced scripting stuff with hyperscript, but htmx is really about the hx- attribute bits.

The core idea with htmx is to get back to a model of hypermedia that adheres to HATEOAS, by allowing interactions on a granularity smaller than a whole document.

kaiserkiwi,
@kaiserkiwi@corteximplant.com avatar

@keithjgrant I'm sure if you add 47 Tailwind classes to every element it doesn't look as bad in comparison!

jorge,
@jorge@mastodon.design avatar

@keithjgrant I'm not doing that

MangelMaxime,

@keithjgrant

Hello,
I believe here in your snippet you have a mix of HTMX and hyperscript (the _ tag).

https://hyperscript.org/

PS: I am not an expert in HTMX, I didn't have time to experiment with it yet, so sorry if I am saying something wrong.

keithjgrant,
@keithjgrant@front-end.social avatar

@MangelMaxime HTMX uses Hyperscript, so yeah, you’re kinda spot on... That’s a screenshot straight from the HTMX website

MangelMaxime,

@keithjgrant

According to https://htmx.org/docs/#scripting

Scripting solutions that pair well with htmx include:

  • VanillaJS
  • AlpineJS
  • jQuery
  • hyperscript

So I suppose you can use any JavaScript library, which is to your liking.

The creator of HTMX, is also the creator of hyperscript so that's probably why he pushes it more.

I do agree that hyperscript looks kind of strange. The idea is cool, but reading such code is really strange too me.

keithjgrant,
@keithjgrant@front-end.social avatar

@MangelMaxime Just the idea of wedging a huge block of code directly into an HTML attribute, regardless what language it is, is… yuck

keithjgrant,
@keithjgrant@front-end.social avatar

@MangelMaxime …I hope they at least have syntax highlighting and editor autocomplete tools built for that. Because if they don’t, that’s 100% a non-starter for me

tamas,

@keithjgrant @MangelMaxime No, htmx does not “use” hyperscript (nor is it implemented in it). You can decide to use hyperscript along with htmx but you don’t have to. Htmx is only the hx- attributes.

shaedrich, (edited )
@shaedrich@mastodon.online avatar

@keithjgrant To me, it feels like htmx comes like ten years late.

bp,

@keithjgrant Some people will do anything to avoid writing custom elements

keithjgrant,
@keithjgrant@front-end.social avatar

@bp As an outspoken critic of web components… I would absolutely use them without hesitation if this were the only other option

cferdinandi,
@cferdinandi@mastodon.social avatar

@keithjgrant @bp I’d love to hear more about your critique of Web Components. I’ve apparently missed those toots. ❤️

keithjgrant,
@keithjgrant@front-end.social avatar

@cferdinandi @bp There was this a little bit ago. It’s not all my thoughts, but some: https://keithjgrant.com/posts/2023/07/web-components-arent-components/

bp,

@keithjgrant @cferdinandi That's a lot of words to say "I shouldn't have to play nice with the other kids because I'm very clever"

Standard interfaces are better than blessed opinions

keithjgrant,
@keithjgrant@front-end.social avatar

@bp @cferdinandi Not if those standard interfaces don’t actually solve the problems I need solved

bp,

@keithjgrant @cferdinandi So you're saying that you don't wanna use standard interfaces, & retaining your favorite opinionated tools (which intentionally break platform features by incorrectly reimplementing them) for a "developer experience" (read: personal sense of being very clever indeed) overrides all other considerations

Lion: white label, themable
MWC, FAST, vaadin, PFE: all themable

Your problems only exist for those unwilling to learn and adapt

keithjgrant,
@keithjgrant@front-end.social avatar

@bp You're sure reading a lot into what I said.

I play nice with the other kids just fine, but I have no need for the other kids to use the components I use in my web app. So I use what gets the job done.

keithjgrant,
@keithjgrant@front-end.social avatar

@bp
And yes, developer experience is a huge part of that equation. If it's a painful DX, work will take longer, be more soul sucking, and the product won't receive updates in a timely manner. I get that DX is not the most important factor, but it is a factor, and no amount of idealism washes that away

keithjgrant,
@keithjgrant@front-end.social avatar

@bp I code in React. And believe me, I'm ready to move on. There are such better options these days.

But in the real world, shipping actual products for a major company, things like an active ecosystem, a large community for finding answers to questions, and available hiring pool skillsets are a major factor

bp,

@keithjgrant It's real pretty to imagine that the world ends 2 levels above you in the org chart and that no one else matters, but in actual fact there are opinions out there that don't conform to your framework's constraints and the only way to satisfy those needs is through standard interfaces, whether or not you think they're yucky

and don't get me started on 'recruiter-driven-development'

bp,

@keithjgrant also, the DX of writing SPA dashboards with web component frameworks is superior to react

cferdinandi,
@cferdinandi@mastodon.social avatar

@keithjgrant @bp

I'm feeling a bit dumb here. Is "the big difference" you're describing just that Web Components make you choose if you want to...

  1. Styling comically difficult
  2. Make it easy, but lose all scoping protections afforded by the Shadow DOM

If so, I agree. Otherwise, I'm struggling to understand the difference between a WC and what you describe as a React component.

keithjgrant,
@keithjgrant@front-end.social avatar

@cferdinandi @bp Styling is the key thing. The Shadow DOM approach makes no sense to me.

I've come around to the idea of WC without Shadow DOM. It's an approach I mean to play with. But I still feel like a WC is a lower-level thing than a framework component. I'd still need the affordances of a framework above my Web Components

cferdinandi,
@cferdinandi@mastodon.social avatar

@keithjgrant @bp And that's the beauty of it! They're portable. You can use them in your framework if you want, or as a completely standalone thing.

Not solving YOUR specific problem through vendor lock-in isn't a problem with WCs themselves. Shadow DOM is messy AF, though. Not personally a fan.

keithjgrant,
@keithjgrant@front-end.social avatar

@cferdinandi @bp What gets me, though, is once I add that framework, it does almost everything WCs provide out of the box, and I no longer see the argument for using WC (except in the specific cases where I need to export them, which isn't really my problem space these days)

bp,

@keithjgrant @cferdinandi No no no no. You don't get to say that your fw's non-standard, siloed, forward-breaking reimplementation is "out of the box"

The platform provides your legacy fw's userland features out of the box, but with less tech debt, lockin, & org-silo

I get that you built up career clout & job title by wrangling/genuflecting to fw tooling, & now that you've paid that cost & imposed it on your teams you get to feel like it's all a given

That's not what "out of the box" means

bp,

@keithjgrant @cferdinandi Look, we all know that Facebook was founded on principals of Open Web technologies, interoperability, local ownership, diversity of opinion/experience, & software quality

So when their engineers flatly claim title as alternative & superior standards body for brogrammers of all backgrounds which pass as highbrow on their conference circuits, we can trust them when we adopt their wide-ranging, team-blocking, standards-breaking opinions.

bp,

@keithjgrant @cferdinandi if i'm a little spicier than normal it's because islamofascist terrorists are trying to killl me and half of mastodon is cheering them on

cferdinandi,
@cferdinandi@mastodon.social avatar

@bp @keithjgrant Oh we're doing this? Israel is literally doing genocide on Palestine. Fuck off.

bp,

@cferdinandi @keithjgrant Found another Nazi!

cferdinandi,
@cferdinandi@mastodon.social avatar

@bp @keithjgrant Half of mastodon is not "cheering on Hamas." They're rightly pointing out that Israel has oppressed Palestine for years and is murdering their children actively RIGHT NOW.

Almost all of Those same people will rightly tell you that Hamas is a terrorist organization.

keithjgrant,
@keithjgrant@front-end.social avatar

@bp okay you're clearly just ignoring what I'm saying here, so I'm done.

cferdinandi,
@cferdinandi@mastodon.social avatar

@bp @keithjgrant Benny, you're being weird. Keith can say whatever the fuck he wants, and in this case, he's right.

His framework does provide what he needs out-of-the-box.

There's a valid argument to have that something portable and not-third-party dependent is a better choice for most projects, or that React is actively harmful to most client projects.

I think Web Components in a React project are a bad fit, personally. That's not what they're for.

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