Have you considered replacing xhr with fetch? I believe it would allow htmx to be used in even more places. Fetch can be hijacked so returning data to the htmx framework isn't limited to the network. You could "run" a server in the browser or have a native app render HTML as well.
Perhaps, there's already a good way to hijack xhr that I'm unaware of too.
yeah, looked at it, unfortunately fetch() and xhr have a non-intersecting set of features (in particular, upload progress for xhr) so we decided not to touch it
i may restructure the internals to allow for mocking out responses using events, it comes up, especially w/ extensions
Perhaps, there's already a good way to hijack xhr that I'm unaware of too.
Edit: Relevant link: https://logankeenan.com/posts/client-side-server-with-rust-a...