Skip to content

Sparke v1.0.0

Choose a tag to compare

@benshawuk benshawuk released this 02 Jun 15:38
· 12 commits to main since this release

First public release of Sparke - make a multi-page website feel like an instant SPA.

A tiny, zero-dependency, progressive-enhancement script: it preloads same-origin links while the browser is idle and atomically swaps page content from memory on click. If JavaScript is unavailable, the browser just behaves as a normal MPA.

Install

<!-- self-hosted (recommended) -->
<script src="/js/sparke.min.js" defer></script>

<!-- or via CDN -->
<script src="https://cdn.jsdelivr.net/gh/benshawuk/sparke@v1.0.0/sparke.min.js" defer></script>

sparke.min.js is ~4.4 KB gzip / ~3.8 KB brotli. See the README for full docs.

Highlights

  • Preload + atomic swap (single <main> or whole <body>)
  • GET-form interception, redirect handling, Back/Forward cache restore
  • Opt-in View Transitions, zero-JS loading state, active-link highlighting
  • Per-page head CSS sync, accessible focus + live-region announcements
  • No build step, no config, no global - just one <script> tag