AbsoluteJS

absolutejs-spa-example

absolutejs-spa-examplev0.0.1betaDev Tools

Demonstrates intra-framework SPA navigation in AbsoluteJS using each framework's native router. The top-level route between frameworks (/react → /svelte) is a full-page MPA navigation. The sub-routes inside each framework page (/react/settings, /react/profile) are client-side SPA navigations driven by the framework's own router.

#Installation

BASH
# Private workspace project: ~/abs/examples/spa

#Capabilities

Overview

Demonstrates intra-framework SPA navigation in AbsoluteJS using each framework's native router. The top-level route between frameworks (/react → /svelte) is a full-page MPA navigation. The sub-routes inside each framework page (/react/settings, /react/profile) are client-side SPA navigations driven by the framework's own router.

The point: AbsoluteJS doesn't ship a router. Users install react-router-dom / vue-router / svelte-routing themselves; the adapter just makes the SSR pass cooperate so SEO, deep-link load, and refresh-mid-route all work.

Run

bun install bun run dev

Open .

What to look at

src/frontend/{react,svelte,vue,angular}/pages/ — each framework's

SPA page wires its native router. Refreshing on a sub-route renders the correct view because the request URL is forwarded to the router on the server.

src/backend/plugins/pagesPlugin.ts — Elysia routes use wildcard

Show 9 more

patterns (/react/ etc.) so the same handler responds for every sub-URL.

React uses <StaticRouter location={url}> on the server and

<BrowserRouter> on the client. URL is plumbed as a normal prop.

Svelte uses <Router url={url}> from svelte-routing. URL is

plumbed as a normal prop.

Angular uses provideRouter exported from the page module.

AbsoluteJS forwards request.url into renderApplication.

Vue exports a setupApp(app, { url, isServer }) hook from the

page module. AbsoluteJS calls this on both server and client, so app.use(router) + router.push(url) + router.isReady() runs in both environments.

Note on the Vue adapter

The Vue setupApp convention is new in @absolutejs/absolute@0.19.0-beta.817. Page modules export setupApp(app, { url, isServer }); AbsoluteJS calls it on both server (in pageHandler.ts, before renderToWebStream) and client (in compileVue.ts's auto-generated index, before app.mount()). This is the only way to get vue-router cooperating with SSR + hydration without forking the Vue mount path.

Outcomes

What you can build

Build on the supported package contract

Use absolutejs-spa-example through its supported public entry points.

Hardening checklist

Production guidance

Make every external boundary explicitPin the deployed absolutejs-spa-example version, replace example or memory-backed dependencies with durable implementations, bound external calls, protect credentials, and emit enough evidence to retry or recover safely.

Follow in order

Troubleshooting path

1
Trace from the first failed boundary
Reproduce the smallest canonical absolutejs-spa-example example, confirm the supported entry point and version in the API explorer, then inspect the first boundary that did not produce its documented result.

#Package commands

Scripts declared by this package manifest.

bun run devabsolute dev
bun run formatabsolute prettier --write
bun run lintabsolute eslint
bun run startabsolute start
bun run typecheckabsolute typecheck
Private workspace project
This project is maintained inside the workspace and is not published as a standalone npm package.