Overview of SPA Guard and its package family
SPA Guard is a family of packages that ensures resilient single-page applications by handling JavaScript chunk load failures caused by network issues, deployment cache invalidation, CDN problems, or 404s. It implements a two-level retry strategy: module-level retries for individual import() calls and page-level retries that trigger full page reloads with cache busting.
Package Ecosystem
@ovineko/spa-guard: Core runtime, error handling, schema, and i18n.@ovineko/spa-guard-react: React hooks, components, and error boundaries (Requiresreact@^19).@ovineko/spa-guard-react-router: Integration for React Router v7 error boundaries (Requiresreact@^19,react-router@^7).@ovineko/spa-guard-vite: Vite plugin to inject the runtime script at build time (Requiresvite@^8or^7).@ovineko/spa-guard-node: Server-side HTML cache with ETag/304, pre-compression, and i18n (Requiresparse5@^8).@ovineko/spa-guard-fastify: Fastify plugin for beacon endpoints and HTML cache handling (Requiresfastify@^5or^4).@ovineko/spa-guard-eslint: ESLint rules for enforcing SPA Guard patterns (Requireseslint@^9or^10).