Major Changes
- BREAKING: The route configuration object has changed. The routes are now a more efficient trie structure and the config no longer includes
menus. This should not impact you. (by @wmertens in #8414)
Minor Changes
-
✨ SSG now runs in a separate process using Workers, and it can be re-run by running
server/run-ssg.js(by @wmertens in #8414) -
✨ eTag and in-memory cache for SSR pages. You can define an
eTagproperty on your page modules, which will be used to generate an ETag header for the response, and which is checked before rendering the page, returning 304 if possible. (by @wmertens in #8414)
If you define acacheKeyfunction on your page module, it will be used to generate a cache key for the page, which is used to store the rendered HTML in an in-memory cache. This allows for faster responses for pages that are expensive to render and do not change often. The cache can be cleared using theclearSsrCachefunction from the request handler middleware. -
✨ Add
routeConfigexport as a unified alternative to separatehead,eTag, andcacheKeyexports (by @wmertens in #8414)The new
routeConfigexport groups all page-level configuration into a single export with the same resolution rules ashead(static object or function). When a module exportsrouteConfig, separatehead,eTag, andcacheKeyexports on that module are ignored. -
✨ Custom
404.tsxerror pages are now shown in dev mode, and you can now also createerror.tsxpages for other HTTP status codes. (by @wmertens in #8414)
Read the HTTP status withuseHttpStatus().