htmxr 0.3.1
Bug fixes
-
hx_is_htmx()always returnedFALSEfor real plumber2 requests. plumber2 requests arereqres::Requestobjects, which normalise header names to snake_case:request$headersholdshx_request, never thehx-requestthe function looked up. It now uses theget_header()accessor when available, and accepts both spellings when falling back toheaders(#22). - The
delete-rowexample was broken: its<tr>fragments were returned as atagList, which the plumber2htmlserializer dumps as raw XML instead of rendering. Now wrapped inas.character(), asinfinity-scrollandtoast-notificationalready do.
New features
New plumber2 serializer
htmx, registered when htmxr is loaded. Annotate a route with@serializer htmxand it sends any htmltools output astext/html— atagListfragment as readily as a full page. plumber2’shtmlserializer only understands a bare string or a single tag, so atagList(whathx_table_rows()returns) was sent as unusable markup with a200status;@serializer noneavoided that but mislabelled the responsetext/plain. All examples now use@serializer htmxand theas.character()calls that worked around this are gone.New example
page-or-fragment— demonstrateshx_is_htmx(): a single route answers a browser with the full page and htmx with just the table rows, which makespush_urlproduce URLs that survive a hard reload.
htmxr 0.3.0
New features
-
hx_set()now accepts all CRUD verbs as named parameters:put,patch,delete(in addition to existinggetandpost). - New named parameters across
hx_set()and all components (hx_button(),hx_select_input(),hx_slider_input(),hx_table()):params,include,push_url,select,vals,encoding,headers— covering the most commonly used htmx core attributes as named parameters. -
hx_set()now accepts...as an escape hatch for raw htmx attributes not covered by named parameters (e.g.`hx-disabled-elt` = "this",`hx-prompt` = "Reason?"). Names must start withhx-ordata-hx-. - New example
delete-row— demonstrates thevalsattribute: each delete button embeds its row id as JSON viahx-vals, no form or hidden input needed.
htmxr 0.2.0
CRAN release: 2026-03-06
Breaking changes
-
htmxr_is_htmx()renamed tohx_is_htmx()to follow thehx_prefix convention applied to all exported functions. -
hx_button()parameter order changed:idis now first and required (waslabel). Update calls likehx_button("Click me")tohx_button("my-btn", label = "Click me"). -
hx_table()parameteridrenamed totbody_idto clarify that the id is applied to the<tbody>, not the<table>.
New functions
-
hx_trigger()— adds anHX-Triggerresponse header to a plumber2 response, causing htmx to fire a client-side event immediately after the response. -
hx_trigger_after_swap()— same, but fires after htmx swaps the new content into the DOM (HX-Trigger-After-Swap). -
hx_trigger_after_settle()— same, but fires after htmx settles (HX-Trigger-After-Settle). - The
eventargument accepts a character vector (multiple events) or a named list (events with JSON detail payloads), serialised without external dependencies.
htmxr 0.1.1
CRAN release: 2026-03-04
- Fix invalid ‘plumber2’ URL in vignette (was pointing to a non-existent GitHub repository, now points to https://plumber2.posit.co/).
- Quote technical terms in
DESCRIPTIONto comply with CRAN spell check conventions. - Add
Depends: R (>= 4.1.0)for native pipe|>compatibility.
