Skip to content

Commit

Permalink
Merge pull request #894 from frontendnetwork/feat/UpgradeFixes
Browse files Browse the repository at this point in the history
fix: Change from experimental use cache to use server for stability
  • Loading branch information
philipbrembeck authored Dec 28, 2024
2 parents e8cd0e7 + 1ce98b3 commit 4e361a4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const millionConfig = {
};

// Apply Million's optimization
// eslint-disable-next-line import/no-named-as-default-member

const nextConfig: NextConfig = million.next(baseConfig, millionConfig);

// Apply next-intl plugin and export the final config
Expand Down
1 change: 0 additions & 1 deletion src/components/Check/utils/product-actions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"use server";
"use cache";

import Veganify from "@frontendnetwork/veganify";

Expand Down
1 change: 0 additions & 1 deletion src/components/IngredientsCheck/utils/actions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"use server";
"use cache";

import Veganify from "@frontendnetwork/veganify";

Expand Down
14 changes: 9 additions & 5 deletions src/i18n/request.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
import { notFound } from "next/navigation";
import { getRequestConfig } from "next-intl/server";

import { routing } from "./routing";

export default getRequestConfig(async ({ locale }: { locale: string }) => {
// Validate that the incoming `locale` parameter is valid
if (!routing.locales.includes(locale as (typeof routing.locales)[number])) {
notFound();
export default getRequestConfig(async ({ requestLocale }) => {
let locale = await requestLocale;

if (
!locale ||
!routing.locales.includes(locale as (typeof routing.locales)[number])
) {
locale = routing.defaultLocale;
}

return {
locale,
messages: (await import(`../locales/${locale}.json`)).default,
};
});

0 comments on commit 4e361a4

Please sign in to comment.