µJS: 5KB Zero-Dependency Alternative to HTMX and Turbo for AJAX Navigation
µJS is a new open-source JavaScript library weighing approximately 5KB gzipped that enables AJAX-based page navigation and DOM fragment updating without any build step, framework, or server-side changes — positioned as a lightweight alternative to HTMX (16KB) and Turbo (25KB). The library intercepts link clicks and form submissions, fetches pages via AJAX, and swaps only the changed DOM fragments, with support for patch mode (multi-fragment updates), Server-Sent Events, DOM morphing via idiomorph, View Transitions, prefetch on hover, polling, and all HTTP verbs on any element. It was published as a Show HN by Digicreon with 59 HN points and 19 comments and is available at mujs.org with a playground and HTMX/Turbo comparison page.
Key Takeaways
- µJS v1.4.0 weighs ~5KB gzipped (vs. HTMX 16KB, Turbo 25KB); zero dependencies, no build step — add a single `