How it works
Discover, preload, intercept, swap – four moves, zero ceremony.
Sparke does four things, in order, with no diffing, no virtual DOM and no hydration. The whole library is a single file that wires these four moves together.
Every page in these docs is served by Sparke. As you click through the steps below, the navigation itself is the demo – instant, from memory.
1 · Discover
Find every same-origin link on the page, automatically.
2 · Preload
Fetch those pages into memory while the browser is idle.
3 · Intercept
Catch plain left-clicks; let everything else through.
4 · Swap
Atomically replace the page from memory and update meta.
One context, kept alive
The single behavioural difference from a normal MPA: Sparke keeps the JavaScript context alive across navigations instead of throwing it away on each page load. That's what makes swaps instant – and it's the one thing to keep in mind when migrating an existing site.