Skip to main content
Version: 3.x

3.8 -> 3.9

This page lists the highlights for upgrading a project from Front-Commerce 3.8 to 3.9

Update dependencies

Update all your @front-commerce/* dependencies to this version:

pnpm update "@front-commerce/*@3.9.0"

Automated Migration

We provide a codemod to automatically update your codebase to the latest version of Front-Commerce. This tool will update your code when possible and flag the places where you need to manually update your code (with // TODO Codemod comments).

pnpm run front-commerce migrate --transform 3.9.0

Manual Migration

Remix entrypoints

In this release, we improved features that required to hook into your Remix application files created with the initial skeleton. You must update these files in your application, as detailed below or copy the ones from the latest skeleton.

app/root.tsx file
diff --git a/skeleton/app/root.tsx b/skeleton/app/root.tsx
index 7346671ea..1f0463927 100644
--- a/skeleton/app/root.tsx
+++ b/skeleton/app/root.tsx
@@ -21,16 +21,11 @@ import config from "~/config/website";
import { pwaAssetsHead } from "virtual:pwa-assets/head";
import { RootErrorBoundary } from "theme/pages/Error";
import { usePublicConfig } from "@front-commerce/core/react";
-import { generateRouteErrorMeta } from "theme/pages/Error/meta";

export const loader = async ({ context }: LoaderFunctionArgs) => {
const app = new FrontCommerceApp(context.frontCommerce);

- return json({
- ...app.rootLoaderContext,
- // TODO: see if we can do this directly in the frontCommerceContext.rootLoaderContext
- routeErrorMeta: generateRouteErrorMeta(app.intl),
- });
+ return json(app.rootLoaderContext);
};

export const shouldRevalidate = () => false;

Layer facets

In this release, we reworked the LayoutFacets.tsx component to support rendering any types of dynamic facets returned by GraphQL. It leverages the new ExtensionComponentMap.

If you have overriden theme/modules/Layer/LayerFacets/LayerFacets, you will need to apply the changes from its latest version to also support this feature. See related commit.