Automatic enhancement to bring single-page app (SPA) features to SSG or SSR HTML pages.
Powered by incremental-dom.
Not ready for production.
You'll get these SPA goodness for free, without writing any additional JS.
- Preserved local states and continuous video playback across page transitions.
- Unlimited and simultaneous dynamic islands (as islands architecture).
- More.
The library prioritise simplicity and freedom of software stack with a cost of performance, because all interactions will be full-page requests.
This might be a minor issue for SSG, but if you're doing SSR you might need to heavily optimise to make it feel responsive.
Add spa-app
to your app container, and spa-loader
to the loading indicator UI. See app/index.html for example.
<body>
<div spa-app>
...
</div>
<div spa-loader style="display:none">Now loading</div>
</div>
Add the following script tag to your exising app:
<head>
<script
type="module"
src="https://unpkg.com/spa-idom@0.0.1/dist/main.js"
></script>
</head>