That's a fantastic idea! I've made it a bit simpler for myself — basically just `source file`, so that I don't need to press enter to execute it, but also added one cute detail in the loop:
if [[ -f "$target/.exec" ]]; then
zsh "$target/.exec"
fi
Actions are somewhat similar, yeah, even if much more limited.
Svelte was too js-heavy, and it requires js backend to be rendered on the server - while we had no js engineers. Plus markup was already done, as we rendered it server-side when using React.
Nit: SvelteKit requires a backend on the server (actually it does not you can use it only for the client side rourting and have no SvelteKit backend and talk directly to your own backend) but Svelte does not as it is just a superset of html.
Even when using the SvelteKit backend you can disable server side rendering.
But sure I trust you that the htmx way was the way to go for your use case/situation
I am not the original poster, but I use lit-html to make the interactive elements on the page like tabs and modals. Then I use HTMX to load the contents of those elements when the tab or trigger is clicked.
I find things like actions is great for conditionally showing and hiding form fields or small things like that, but if you want to have accessible tabs and modals it is best to bundle it up in a component. Here is an example of a lit components I use, https://codepen.io/megaman821/pen/GRXmzZb and https://codepen.io/megaman821/pen/dydvxBE
There is no way to render JSON as HTML right now, it expects server to return HTML.
OTOH that's an interesting thought and it feels like just an addition of one command to whatever there are in actions ( https://twinspark.js.org/api/ts-action/ ) right now... I need to think about it a bit. :)
An action that renders HTML from JSON will either:
— Require additional client-side templates and then it's back straight to hell;
— Require really specific JSON structure, basically HTML-in-JSON, which will be ugly as hell and totally meaningless. Meaningless, because then it means I need to adapt my API to this format, and then I can just make it return HTML.
It's more like an alternative implementation of htmx. Alpine is more about "let's do components in HTML", and this one is more of an idea "how do not go there, but still have practical results". :)
Two reasons really: I wrote it before htmx appeared, so it already existed and a few projects were using it in production. And second one - I really hate attribute inheritance, and it’s everywhere in htmx…