Discussion
Loading...

Post

  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
Kat March谩n 馃悎
@zkat@toot.cat  路  activity timestamp 3 months ago

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

If you just wrap any plain

with , it鈥檒l 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鈥檚 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

the entire response when the flag is enabled.
the entire response when the flag is enabled.
the entire response when the flag is enabled.
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
  • Copy link
  • Flag this post
  • Block
Ja-ah-ah-n Lehnardt :couchdb:
@janl@narrativ.es replied  路  activity timestamp 3 months ago
@zkat htmy then?
  • Copy link
  • Flag this comment
  • Block
Kat March谩n 馃悎
@zkat@toot.cat replied  路  activity timestamp 3 months ago
@janl I guess but that鈥檚 not what I called it so
  • Copy link
  • Flag this comment
  • Block
Ja-ah-ah-n Lehnardt :couchdb:
@janl@narrativ.es replied  路  activity timestamp 3 months ago
@zkat as name for the concept I mean
  • Copy link
  • Flag this comment
  • Block
Kat March谩n 馃悎
@zkat@toot.cat replied  路  activity timestamp 3 months ago
@janl oh sure ok
  • Copy link
  • Flag this comment
  • Block
Ja-ah-ah-n Lehnardt :couchdb:
@janl@narrativ.es replied  路  activity timestamp 3 months ago
@zkat I鈥檝e 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 March谩n 馃悎
@zkat@toot.cat replied  路  activity timestamp 3 months ago
@janl as @yetzt said, you really htmy with it there
  • Copy link
  • Flag this comment
  • Block
Log in

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About 路 Code of conduct 路 Privacy 路 Users 路 Instances
Bonfire social 路 1.0.0-rc.3.21 no JS en
Automatic federation enabled
  • Explore
  • About
  • Members
  • Code of Conduct
Home
Login