Discussion
Loading...

Post

Log in
  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
kat
kat
@zkat@toot.cat  ·  activity timestamp 6 months ago

Excellent. Got this working in the #ConjuredInk#Rust#RustLang #Axum server.

If you just wrap any plain

with , it’ll submit that form as a fetch instead. Server-side, a middleware checks for a header and sets a flag, and you can use that to only partially render the response.

Without JS, you get the some whole page back, just like normal. With working JS, you only get the "patch", and then overwrites the matching nodes.

This is a hybrid of htmx and htmz that uses a web component instead of a global thing with odd attribute annotations, and unlike htmz, lets you have programmatic lifecycle hooks, set that header so you can share the exact same endpoint, etc.

And it’s still just a tiny, plain, standalone Web Component with no deps. It's a couple of kb mingz, and I'll probably golf it around a bit to make it smaller.

#WebDev

2 media
an html template that conditionalizes rendering certain parts based on a flag
an html template that conditionalizes rendering certain parts based on a flag
an html template that conditionalizes rendering certain parts based on a flag
the entire response when the flag is enabled.
the entire response when the flag is enabled.
the entire response when the flag is enabled.
  • Copy link
  • Flag this post
  • Block
Jan Lehnardt :couchdb:
Jan Lehnardt :couchdb:
@janl@narrativ.es replied  ·  activity timestamp 6 months ago
@zkat htmy then?
  • Copy link
  • Flag this comment
  • Block
kat
kat
@zkat@toot.cat replied  ·  activity timestamp 6 months ago
@janl I guess but that’s not what I called it so
  • Copy link
  • Flag this comment
  • Block
Jan Lehnardt :couchdb:
Jan Lehnardt :couchdb:
@janl@narrativ.es replied  ·  activity timestamp 6 months ago
@zkat as name for the concept I mean
  • Copy link
  • Flag this comment
  • Block
kat
kat
@zkat@toot.cat replied  ·  activity timestamp 6 months ago
@janl oh sure ok
  • Copy link
  • Flag this comment
  • Block
Jan Lehnardt :couchdb:
Jan Lehnardt :couchdb:
@janl@narrativ.es replied  ·  activity timestamp 6 months ago
@zkat I’ve had a rough week and I needed a little pun to lighten the mood, thank you for playing! 🫶
  • Copy link
  • Flag this comment
  • Block
kat
kat
@zkat@toot.cat replied  ·  activity timestamp 6 months ago
@janl as @yetzt said, you really htmy with it there
  • Copy link
  • Flag this comment
  • Block

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.2-alpha.27 no JS en
Automatic federation enabled
Log in
  • Explore
  • About
  • Members
  • Code of Conduct