March 31, 2025
March 2025 release
Welcome to our March release! In this release, we’ve added support for Vite 6 and the Remix v3_routeConfig future flag.
Support for Vite 6
Hydrogen has completed the migration from Vite 5 to Vite 6, following the Remix upgrade to Vite 6 in version 2.16.0. Vite 6 offers performance enhancements and improved HMR (Hot Module Replacement). If you have any custom Vite integrations, please refer to vite migration guide for more information.
Turn on Remix future flag: v3_routeConfig
Remix is merging with React Router 7. Enabling v3_routeConfig future flag is the recommended migration path to React Router 7.
Update your vite.config.ts:
Code Example
export default defineConfig({
plugins: [
hydrogen(),
oxygen(),
remix({
presets: [hydrogen.v3preset()], // Update this to hydrogen.v3preset()
future: {
v3_fetcherPersist: true,
v3_relativeSplatPath: true,
v3_throwAbortReason: true,
v3_lazyRouteDiscovery: true,
v3_singleFetch: true,
v3_routeConfig: true, // add this flag
},
}),
tsconfigPaths(),
],
Update your package.json and install the new packages. Make sure to match the Remix version along with other Remix npm packages and ensure the versions are 2.16.1 or above:
Code Example
"devDependencies": {
...
"@remix-run/fs-routes": "^2.16.1",
"@remix-run/route-config": "^2.16.1",
Move the Layout component export from root.tsx into its own file. Make sure to supply an <Outlet> so Remix knows where to inject your route content.
Code Example
// /app/layout.tsx
import {Outlet} from '@remix-run/react';
export default function Layout() {
const nonce = useNonce();
const data = useRouteLoaderData
// Remember to remove the Layout export from your root.tsx
Add a routes.ts file. This is your new Remix route configuration file.
Code Example
import {flatRoutes} from '@remix-run/fs-routes';
import {layout, type RouteConfig} from '@remix-run/route-config';
import {hydrogenRoutes} from '@shopify/hydrogen';
export default hydrogenRoutes([
// Your entire app reading from routes folder using Layout from
layout.tsx layout('./layout.tsx', (await flatRoutes())),
]) satisfies RouteConfig;
For more detailed upgrade instructions, see the v3_routeConfig PR or refer to the Remix guide.
To take advantage of all the latest features and improvements in Hydrogen, just run npx shopify hydrogen upgrade. That’s it for the March release — see you in April!