moon add f4ah6o/htmximport f4ah6o/htmx/htmx
fn main {
htmx.htmx_init()
}<!-- Basic Request -->
<button hx-get="/api/clicked" hx-swap="outerHTML">
Click Me
</button>
<!-- Form Submission -->
<form hx-post="/api/user">
<input name="username">
<button type="submit">Save</button>
</form>
<!-- Morphing Swap (Preserves Input State) -->
<div hx-target="this" hx-swap="morph">
<input type="text" name="q" placeholder="Search...">
</div># Build for JavaScript target
moon build --target js
# Run tests
moon test --target js# Install test dependencies
npm install
# Build htmx.mbt and run the upstream suite in headless Chrome
npm run test:htmxDependencies