mirror of
https://github.com/cole-maxwell1/dotfiles.git
synced 2026-10-27 16:32:49 -05:00
- add conventions for Bash, C#, Go, Python, and TypeScript - add frontend guidance for HTMX, PrimeVue, and Vue - document formatting, typing, testing, async, and framework-specific practices - reference official documentation for framework API details
1.1 KiB
1.1 KiB
name, description
| name | description |
|---|---|
| htmx | HTMX v2 progressive-enhancement and hypermedia patterns. |
HTMX Conventions
Follow HTMX v2 and Hypermedia Systems best practices.
Philosophy
- Treat the server as the source of truth; return HTML fragments, not JSON, for hypermedia interactions.
- Prefer
hx-*attributes over client-side JavaScript; reach for client JavaScript only when htmx cannot express the interaction. - Build progressively: ensure pages function without JavaScript, then enhance with htmx.
Patterns
- Target fragments with
hx-targetand swap withhx-swap(preferouterHTMLorinnerHTMLas appropriate). - Return partial templates or fragments from endpoints; treat partials as isolated components that receive data via the page model.
- Use Out-of-Band Swaps (
hx-swap-oob) to update multiple regions from a single response. - Handle errors with a 4xx/5xx partial or
hx-on::responseError.
Keep clean
- Return semantic HTML from endpoints; avoid mixing
hx-*attributes with conflicting client-side handlers.