Turbolinks is a JavaScript library that accelerates HTML page transitions by replacing the page body via network requests instead of performing full browser refreshes. It functions as a client-side navigation manager that intercepts link clicks and controls the page visit lifecycle to simulate a single-page application experience.
The library synchronizes the browser URL and history stack with partial page updates and utilizes a caching mechanism to store visited page states. This allow for instant previews and restoration of state when navigating backward or forward. It also includes a tool for transferring specific UI elements across transitions by matching identifiers to maintain element persistence.
The project covers navigation lifecycle management, including the ability to intercept visits and configure custom headers. It provides a customizable progress bar for asynchronous loads and monitors asset versioning to trigger full page reloads when scripts or styles are updated. Navigation scope can be configured to restrict partial updates to specific root paths or origins.