@qwik.dev/router@2.0.0-beta.38
Breaking Changes📦 qwikView on GitHub →
⚠ 2 breaking✨ 7 features🐛 27 fixes🔧 12 symbols
Summary
This release introduces significant changes to routing and rendering, including how 404 and error pages are handled and making SPA view transitions opt-in. It also includes numerous bug fixes and performance improvements across the router and loader functionalities.
⚠️ Breaking Changes
- 404.tsx and error.tsx now render inside their layouts (with `@layout`/`!` modifiers). A route miss resolves the nearest 404.tsx, and the 404 page is prerendered for static hosts. To maintain previous behavior, rename `404.tsx` to `404!.tsx`.
- SPA view transitions are now opt-in. To re-enable them, set `viewTransition={true}` on `QwikRouterProvider`.
Migration Steps
- Rename `404.tsx` to `404!.tsx` if you do not want to add the layout to your 404 page.
- Set `viewTransition={true}` on `QwikRouterProvider` to re-enable SPA view transitions.
- Code that prerenders by calling Vite's programmatic `build()` directly must switch to `builder.buildApp()`.
✨ New Features
- Relocated built assets with `output.assetFileNames`; removed `build.assetsDir` handling.
- Renamed the `Link` `prefetchBundle` prop to `prefetchBundles`.
- Route loaders gain a `blockSSR` option (default `true`). Set `blockSSR: false` to run a loader in the background without blocking SSR (experimental, requires the `blockSSR` feature flag).
- Returning `ev.redirect()`, `ev.error()`, or `ev.rewrite()` from a loader, action, request handler, or server function now behaves the same as throwing them.
- Added an `exclude` option to `rewriteRoutes` to skip generating localized routes for matching path patterns.
- Rendered SSG in a dedicated Vite build environment, so prerendered route code stays out of the deployed server bundle.
- Added configurable server request body limits.
🐛 Bug Fixes
- Rendered navigation state before loading the next route.
- Prerendered routes are now correctly excluded from the server route plan.
- Fixed router to honor the `routeLoader$` `id` option so loaders created through a shared wrapper get distinct ids instead of all but the first being silently deduped in `getModuleRouteLoaders`. A dev-mode warning is now logged when two distinct loaders share an id.
- Prevented cold dev route loader requests from failing during SPA navigation.
- Kept expiring loader responses private by default.
- Action redirects now work again.
- Resolved image jsx imports with extra query parameters.
- Avoided prefetching loader data already fetched by route loaders.
- Kept Azure response collection work proportional to output size.
- Kept deeply nested form parsing work proportional.
- Ensured SPA navigation correctly refreshes route loader data for catch-all routes, including when loader data is shared through context.
- RouteLoader$ `fail()` now sets the loader value to `{ failed }` instead of throwing an error.
- Prerendered route loaders no longer 404 when the client and server are built as separate processes.
- Route loader no longer resolves to undefined on the first dev SPA navigation.
- RouteLoader$ not re-running during SPA navigation between URLs that match the same catchall route.
- Prefixed dev CSS and HMR URLs with Vite base.
- Refetched re-exported route loaders after navigation.
- Route action type now allows `invalidate` without validators.
- Preserved scroll after SPA action submits.
- Hot-reloaded route-imported CSS in dev without a server restart.
- Streaming server$ no longer crashes the Bun server on client disconnect.
- Registered aliased server functions used only in client code like visible tasks.
- Adapter post-build runs with ssg disabled, and the ssg build skips minify/sourcemaps.
- The ssg build no longer bundles the unused deploy server entry.
- A prerendered route's loader with no static sidecar now falls through to SSR instead of failing as a missing static asset.
- Preserved strict loader URL isolation during route resolution.
- Ensured dev SPA navigation loads route loader data correctly for catch-all and base-prefixed routes.