beet icon indicating copy to clipboard operation
beet copied to clipboard

Beet HTMX

Open mrchantey opened this issue 6 months ago • 1 comments

The HTMX pattern is very similar to the server islands pattern: a route that returns html, defined with template directives. We have an even greater motivation to reduce running client-side code because wasm bundles are generally larger than js.

Doing this inside beet instead of just using HTMX should make for a cleaner experience, for example server actions are type safe and we know the http method for them so that doent need to be redefined. It may also be slightly more performant because we can do the evaluation at build time instead of on the client.


fn Button() -> impl Bundle{

  rsx!{
    <button bx:action=actions::weather
            bx:trigger="click"
            bx:target="#output"
            bx:swap=BxSwap::InnerHtml>
        Get the weather
    </button>
    <output id="output"></output>  
  }
}

mrchantey avatar Jul 08 '25 00:07 mrchantey

example minimal runtime derived from fixi.js by copilot bx.js

mrchantey avatar Jul 22 '25 10:07 mrchantey