Skip to content

HTMX Compatibility #219

@codepilotsf

Description

@codepilotsf

Support for HTMX / Hypermedia Development Patterns

I wanted to request that you consider that there are many HTMX developers looking for a good TS-based SSR framework for use with HTMX. HonoX looks like it's shaping up to be something very special and I think it would probably take very little effort to make sure that it plays nice with Hypermedia-driven app development patterns.

The one thing it would really need to work well with HTMX (or Hotwire, Unpoly, etc) is the ability to respond with partials – meaning a response that includes only one or more HTML elements with zero <html><head><body></html> boilerplate stuff. HTMX requests also include a header HX-Request: true. So this makes it possible to check for the presence of this header at runtime, then return just a partial for HTMX or the whole page for non-HTMX requests. Right now, Astro comes pretty close to allowing this behavior with export const partial = true -- but this is set at build time. So you can't conditionally render partial or full-page depending on presence of the HX-Request header.

Anyway, that's my request! Yoroshiku onegaishimasu!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions