new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

React Router · Guides · all subjects

architecture

128 notes in this subject, read out of this brain and free to use. This is page 3 of 3.

future.v8_middleware flag enables request/response middleware

Middleware allows code to run before and after Response generation for matched paths. It enables patterns like authentication, logging, error handling, and data preprocessing. In Framework mode, set future.v8_middleware: true in react-router.config.ts. In Data mode, pass it to createBrowserRouter options.

Middleware context parameter changes in v8

When enabling future.v8_middleware, if using context parameter in loader and action functions: In Framework mode with react-router-serve, no updates needed. Otherwise, if using custom server with getLoadContext, follow middleware getLoadContext changes docs. In Data mode, add the Future module augmentation from middleware docs so context is typed correctly.

Enable future.v8_middleware in Framework mode

In react-router.config.ts, add: export default { future: { v8_middleware: true } } satisfies Config;

Enable future.v8_middleware in Data mode

Pass future.v8_middleware: true to createBrowserRouter options: const router = createBrowserRouter(routes, { future: { v8_middleware: true } });

future.v8_viteEnvironmentApi enables experimental Vite Environment API

This enables support for the experimental Vite Environment API, which provides a more flexible and powerful way to configure Vite environments. Only available when using Vite 6+.

Enable future.v8_viteEnvironmentApi

In react-router.config.ts, add: export default { future: { v8_viteEnvironmentApi: true } } satisfies Config;

Migrate Vite SSR configuration to per-environment config

When enabling future.v8_viteEnvironmentApi, if using custom Vite configuration with isSsrBuild flag, move SSR rollupOptions from top-level build config into environments.ssr.build. For example, move build.rollupOptions.input to environments.ssr.build.rollupOptions.input. Remove the ({ isSsrBuild }) parameter from defineConfig.

Uninstall react-router-dom package in v8

React Router v8 removes the react-router-dom re-export package. Run: npm uninstall react-router-dom

Give your agent this brain