Back to browse
µJS, a 5KB alternative to Htmx and Turbo with zero dependencies

µJS, a 5KB alternative to Htmx and Turbo with zero dependencies

by amaury_bouchard·Mar 7, 2026·161 points·92 comments

AI Analysis

●●●BangerSlickBig Brain

5KB drop-in AJAX library beats HTMX (16KB) and Turbo (25KB) with zero dependencies.

Strengths
  • Genuinely smaller than competitors (5KB vs 16-25KB) with zero runtime dependencies, verified.
  • Patch mode enables multi-fragment updates in single request, useful for complex dashboards.
  • Works with any backend (PHP, Python, Go, etc.) without server modification—truly drop-in.
Weaknesses
  • Narrow use case: only solves progressive enhancement for traditional servers, not SPA patterns.
  • Smaller ecosystem and community adoption compared to HTMX's established popularity.
Target Audience

Full-stack developers building traditional server-rendered sites

Similar To

HTMX · Turbo (Hotwire) · htmx

Post Description

I built µJS because I wanted AJAX navigation without the verbosity of HTMX or the overhead of Turbo.

It intercepts links and form submissions, fetches pages via AJAX, and swaps fragments of the DOM. Single <script> tag, one call to `mu.init()`. No build step, no dependencies.

Key features: patch mode (update multiple fragments in one request), SSE support, DOM morphing via idiomorph, View Transitions, prefetch on hover, polling, and full HTTP verb support on any element.

At ~5KB gzipped, it's smaller than HTMX (16KB) and Turbo (25KB), and works with any backend: PHP, Python, Go, Ruby, whatever.

Playground: https://mujs.org/playground Comparison with HTMX and Turbo: https://mujs.org/comparison About the project creation, why and when: https://mujs.org/about GitHub: https://github.com/Digicreon/muJS

Happy to discuss the project.

Similar Projects