MuJS
MuJS MuJS MuJS

Make your website feel like a single-page app without JavaScript. Lightweight AJAX navigation library.

µJS is a lightweight, zero-dependency AJAX navigation library designed to make traditional websites feel like single-page applications (SPAs) without the complexity of modern JavaScript frameworks.

The principal functionalities of this tool include:

1. Instant Navigation and Performance

  • Partial Page Reloads: It intercepts link clicks and form submissions to fetch only the necessary content in the background, replacing changed elements instead of reloading the entire page.

  • Predictive Loading: The library includes prefetching on hover, ensuring that navigation feels instantaneous to the user.

  • Visual Feedback: It features a built-in progress bar to provide immediate feedback during background data fetches.

2. Seamless Integration ("Drop-in")

  • Minimal Footprint: The tool is extremely lightweight, weighing approximately 5 KB gzipped.

  • Zero Dependencies: It does not require a build step, a bundler, or any specific server-side changes to work.

  • Backend Agnostic: It is compatible with any backend language, including PHP, Python, Ruby, Go, and Node.js.

3. Advanced UI and Data Handling

  • Patch Mode: This feature allows for updating multiple page fragments in a single request, which is ideal for complex dashboards.

  • Rich Triggers: Any element can trigger an action via any event (such as live search or polling) with built-in debounce to prevent server overload.

  • Real-Time Streaming: It supports Server-Sent Events (SSE) for real-time updates, which can be combined with patch mode for streaming multi-fragment content.

  • Standard HTTP Support: It supports all standard HTTP verbs (GET, POST, PUT, PATCH, DELETE) for links, buttons, and forms.

4. Modern Web Standards

  • Smooth Transitions: It utilizes the View Transitions API to provide professional-grade animations between page states.

  • Smart DOM Swapping: The library uses idiomorph for DOM morphing, ensuring that elements are updated efficiently without losing state.

  • Ecosystem Compatibility: While it works as a standalone tool, it is designed to integrate perfectly with the Digicreon ecosystem, including the Temma PHP framework and µCSS.