liveBook · Manning

Navigation model

As explained in Vanilla Web

A navigation model is an architectural scheme that determines how URLs and user navigation map to web application content or views.

A navigation model determines how moving to another part of a web application relates to its URLs and browser navigation. Choose it for the kind of site or application you need before choosing how pages are rendered. section 2.1.4

The main choices are:

  • Multi-page application (MPA): different server URLs provide different sections. Each move causes a new browser navigation; the server can return static HTML or dynamically generated content. section 2.1.4
  • Single-page application (SPA): one entry document loads first, then client-side routing changes the displayed section without reloading the page context. Client code may request data or partial code. section 2.1.4
  • Hybrid: serve multiple static sections as an MPA while handling one part of the application as an SPA. section 2.1.4

Navigation and rendering are separate decisions. After deciding how users move between sections, choose how their content is produced—for example, as static files, generated pages, or server-rendered HTML. section 2.1.4

Table 2.2 Rendering models cheat sheet
Rendering model What you code What you build and ship What the server does on request What the client does

Static Site

You code raw HTML, CSS, and JS files directly.

None – you ship the files as-is.

The server serves static files (no logic).

The browser renders HTML, applies CSS, and executes minimal JS.

SSG

You code templates + content sources (Markdown, DB, CMS).

A build step generates static HTML/JS/CSS files.

The server only serves the pre-generated files, similar to a Static Site.

The browser renders static pages, with optional JS for interactivity.

SSR

You code templates + server logic (PHP, Node, Python, etc.).

Optional pre-compilation of templates or code. Ship source code or compiled binaries.

On each request, the server queries the DB, merges data with templates, and outputs HTML.

The browser receives ready HTML and CSS, plus optional JS that enhances interactivity.

CSR

You code mostly JS + an HTML shell + API endpoints.

Optional tooling. Ship source code.

The server serves static files, similar to a Static Site, and also provides JSON endpoints.

The browser runs JS, manages the DOM, and fetches data via APIs.

Universal

You code with a framework whose code runs both client- and server-side (typically JS).

A build step produces server and client bundles. Ship both to a Node-capable host.

On each request, the server renders the initial HTML for the route.

The browser displays the server-rendered HTML, then hydrates it to take over interactivity.

ISR

You code templates + content sources with a framework that supports revalidation.

A build step pre-generates pages; you configure revalidation rules. Ship to a platform with a cache and runtime.

The server serves cached static HTML and regenerates pages in the background, on a schedule or on-demand.

The browser renders the pre-generated HTML, then optionally hydrates for interactivity.

Islands

You code mostly static templates + isolated interactive components, such as custom elements.

A build step outputs static HTML plus small, per-island JS bundles.

The server serves static HTML (like SSG), optionally rendering per request.

The browser renders the static HTML and hydrates only the islands independently – or resumes them, in Qwik’s case.

Compare what different rendering models code, ship, serve, and run in the browser. The comparison helps keep the rendering decision distinct from the navigation model. section 2.1.4

Routing must coordinate the URL, browser navigation, server response, and rendering strategy. Use descriptive paths and real <a href> links for internal routes so they remain accessible, crawlable, bookmarkable, shareable, and openable in new tabs. Put shareable UI state in the query string when needed; reserve hashes for document fragments rather than primary application routes. section 10.5

An SPA still needs server support for deep links: valid application routes must return the entry HTML document, without swallowing asset requests, API endpoints, or genuine 404 responses. For same-document routing, the Navigation API centralizes interception and supports focus, scroll, cancellation, and per-entry state. The History API is a practical fallback, but requires manual link interception and popstate handling. URLPattern can match routes in modern browsers; a simple regex is another option. These pieces establish routing; rendering routes and structuring a complete router are further steps. section 10.5

How Vanilla Web covers it

How deep it goes
Defines MPA, SPA, and hybrid navigation and identifies router building blocks; defers route rendering and complete router structure.
Examples
Contrasts server-served sections with single-entry client navigation and a hybrid of static sections and an SPA.
What it assumes
Assumes basic familiarity with URLs and HTML links while defining MPA and SPA explicitly.
What you can do after
Evaluate/understand navigation architecture choices and the links, server behavior, and browser APIs needed to support routes.
How it connects
Links routing to URLs, server responses, rendering strategies, deep links, HTML anchors, and route matching.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Vanilla Web. The section links point to the parts of the book it draws on.