Change8

@qwik.dev/router@2.0.0-beta.29

Breaking Changes
📦 qwikView on GitHub →
1 breaking5 features🐛 1 fixes1 deprecations🔧 7 symbols

Summary

This release introduces significant performance improvements via in-memory SSR caching and eTag support, alongside a major refactoring of route configuration structure. It also enhances custom error page handling.

⚠️ Breaking Changes

  • The route configuration object structure has changed, moving to a trie structure and removing the `menus` property. This change is stated not to impact users, but configuration handling might need review if relying on the old structure.

Migration Steps

  1. If you were relying on the structure of the route configuration object, review changes related to the removal of `menus` and the new trie structure.
  2. Consider migrating page-level configurations (`head`, `eTag`, `cacheKey`) to the unified `routeConfig` export.
  3. If using custom error handling, note that `404.tsx` is now visible in dev mode, and you can define status-specific error pages.

✨ New Features

  • SSG now executes in a separate process utilizing Workers, allowing re-runs via `server/run-ssg.js`.
  • Implemented eTag support for SSR pages: define an `eTag` property on page modules to generate an ETag header, enabling 304 responses.
  • Added in-memory caching for SSR pages using a `cacheKey` function defined on page modules for faster responses on expensive, static pages. Cache can be cleared via `clearSsrCache`.
  • Introduced `routeConfig` export as a unified configuration object replacing separate `head`, `eTag`, and `cacheKey` exports.
  • Custom error pages are enhanced: `404.tsx` is now shown in dev mode, and custom pages for other HTTP status codes (e.g., `error.tsx`) can be created. Use `useHttpStatus()` to read the HTTP status.

🐛 Bug Fixes

  • Ensured CSS files are correctly located within the module graph during routing.

Affected Symbols

⚡ Deprecations

  • Separate exports for `head`, `eTag`, and `cacheKey` on page modules are superseded by the unified `routeConfig` export. When `routeConfig` is present, the individual exports are ignored.