Skip to content

Core Concepts

Resux combines a compiler, an SSR runtime, a small browser resume runtime, and file conventions. The key idea is that normal Resux components are rendered on the server and resumed later only where interaction or pending data requires it.

Concept map

ConceptWhat it meansRead next
Resux componentA .vue file compiled by Resux, not hydrated by the Vue runtime.Components
PageA component under pages/ that becomes a route.Routing
LayoutA wrapper from layouts/ selected by page meta.Layouts
App shellapp.vue, the outer document-level component that renders the active page/layout.App Shell, Errors, and Public Files
Error pageerror.vue, the fallback renderer for 404/500 states.App Shell, Errors, and Public Files
Public fileStatic asset under public/ served from the web root.App Shell, Errors, and Public Files
Execution contextA place where code runs: module, plugin, middleware, handler, setup, resume, or island.Execution Contexts
PayloadSerialized route, scopes, state, async data, module ids, Vue island entries, and public config.Rendering Lifecycle
ScopeThe resumable runtime record for one rendered component instance.Resumability and Handlers
Handler chunkBrowser code for a component event handler, imported on first interaction.Resumability and Handlers
Async dataA resumable data resource with data, pending, and error refs.Async Data
Route payloadFresh SSR output fetched from /__resux/route during client navigation.Rendering Lifecycle
Route middlewareNavigation guards from middleware/.Middleware
Server middlewareRequest middleware from server/middleware/, before APIs, public files, and pages.Middleware
Server handlerAPI or route handler from server/api or server/routes.Server API
PluginApp extension that can provide values to Resux app context.Plugins
ModuleBuild-time extension that can add CSS, head entries, route rules, and runtime config.Modules and Route Rules
Route rulePath-based response behavior such as redirects, headers, cache, CORS, and status codes.Modules and Route Rules
Dev serverVite-backed development server with generated client modules and reload channel.Dev Server and Build Output
Build outputGenerated .resux internals and .output production server files.Dev Server and Build Output
Security headersDefault production hardening headers and path-specific policy.Security and Caching
Cache ruleRoute-rule cache behavior for pages, payloads, APIs, and assets.Security and Caching
Health endpointBuilt-in /__resux/health endpoint for uptime checks.Dev Server and Build Output
Vue islandOpt-in full Vue runtime widget mounted inside a Resux page.Vue Islands

How the parts fit

At build time, Resux discovers files, compiles .vue files, validates resumability, and emits server modules plus client handler modules. The build manifest records pages, components, layouts, plugins, middleware, server handlers, route rules, public runtime config, and island entries.

At request time, Resux runs request middleware and server handlers before rendering a page. For page requests, it runs route middleware, renders the app shell, layout, and page to HTML, merges head entries, and serializes the payload into window.__RESUX__.

In the browser, Resux starts with the server HTML. It intercepts same-origin navigation, fetches route payloads, swaps the page slot when possible, and imports handler chunks only when a user interaction needs them.

What to keep in mind

  • Use Resux components for HTML-first pages, simple interactivity, routing, layouts, SSR data, and resumable state.
  • Use useState and useAsyncData for values that must survive from server render to browser resume.
  • Use $fetch or apiURL() for internal API requests that may run during SSR.
  • Use plugins for app context, modules for build-time extension, and route rules for response behavior.
  • Use Vue islands when a feature needs full Vue runtime behavior or browser-only libraries.
  • Expect unsupported Vue features or unsafe handler captures to fail at compile time.

Stable v1 core docs for Resux, with experimental areas clearly marked.