Skip to content

Commit

Permalink
Update to Next.js 15 & other dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
wottpal committed Oct 25, 2024
1 parent 596e6a1 commit d55a83d
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 25 deletions.
Binary file modified bun.lockb
Binary file not shown.
26 changes: 14 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,35 @@
"test:playwright": "playwright test",
"test:jest": "jest",
"build": "next build",
"start": "next start"
"start": "next start",
"update": "npm-check-updates --interactive --root --format group --install always -x '@types/node|@types/react|@types/react-dom'"
},
"dependencies": {
"clsx": "^2.1.1",
"next": "^14.2.4",
"next-intl": "^3.0.0",
"next": "^15.0.1",
"next-intl": "^3.23.5",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"tailwindcss": "^3.4.4"
"tailwindcss": "^3.4.14"
},
"devDependencies": {
"@jest/globals": "^29.7.0",
"@playwright/test": "^1.48.1",
"@testing-library/react": "^16.0.0",
"@types/jest": "^29.5.12",
"@types/lodash": "^4.17.5",
"@testing-library/react": "^16.0.1",
"@types/jest": "^29.5.14",
"@types/lodash": "^4.17.12",
"@types/node": "^20.14.5",
"@types/react": "^18.3.3",
"autoprefixer": "^10.4.19",
"eslint": "^9.11.1",
"autoprefixer": "^10.4.20",
"eslint": "^9.13.0",
"eslint-config-molindo": "^8.0.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"npm-check-updates": "^17.1.5",
"postcss": "^8.4.38",
"postcss": "^8.4.47",
"prettier": "^3.3.3",
"typescript": "^5.5.3"
"typescript": "^5.6.3"
},
"prettier": "eslint-config-molindo/.prettierrc.json"
"prettier": "eslint-config-molindo/.prettierrc.json",
"packageManager": "bun@1.1.33"
}
8 changes: 5 additions & 3 deletions src/app/[locale]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@ import {routing} from '@/i18n/routing';

type Props = {
children: ReactNode;
params: {locale: string};
params: Promise<{locale: string}>;
};

export function generateStaticParams() {
return routing.locales.map((locale) => ({locale}));
}

export async function generateMetadata({
params: {locale}
params
}: Omit<Props, 'children'>) {
const {locale} = await params;
const t = await getTranslations({locale, namespace: 'LocaleLayout'});

return {
Expand All @@ -25,8 +26,9 @@ export async function generateMetadata({

export default async function LocaleLayout({
children,
params: {locale}
params
}: Props) {
const {locale} = await params;
// Ensure that the incoming `locale` is valid
if (!routing.locales.includes(locale as any)) {
notFound();
Expand Down
10 changes: 5 additions & 5 deletions src/app/[locale]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import {useTranslations} from 'next-intl';
import {setRequestLocale} from 'next-intl/server';
import {getTranslations, setRequestLocale} from 'next-intl/server';
import PageLayout from '@/components/PageLayout';

type Props = {
params: {locale: string};
params: Promise<{locale: string}>;
};

export default function IndexPage({params: {locale}}: Props) {
export default async function IndexPage({params}: Props) {
const {locale} = await params;
// Enable static rendering
setRequestLocale(locale);

const t = useTranslations('IndexPage');
const t = await getTranslations('IndexPage');

return (
<PageLayout title={t('title')}>
Expand Down
10 changes: 5 additions & 5 deletions src/app/[locale]/pathnames/page.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import {useTranslations} from 'next-intl';
import {setRequestLocale} from 'next-intl/server';
import {getTranslations, setRequestLocale} from 'next-intl/server';
import PageLayout from '@/components/PageLayout';

type Props = {
params: {locale: string};
params: Promise<{locale: string}>;
};

export default function PathnamesPage({params: {locale}}: Props) {
export default async function PathnamesPage({params}: Props) {
const {locale} = await params;
// Enable static rendering
setRequestLocale(locale);

const t = useTranslations('PathnamesPage');
const t = await getTranslations('PathnamesPage');

return (
<PageLayout title={t('title')}>
Expand Down

0 comments on commit d55a83d

Please sign in to comment.