Skip to content

Commit

Permalink
Change environment URL, conditionally add speed insights
Browse files Browse the repository at this point in the history
  • Loading branch information
Tehnix committed Jan 10, 2024
1 parent 9c6f04c commit e1a8a50
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 24 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/vercel-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,7 @@ jobs:
- name: End-to-end tests
working-directory: ./deployment
env:
UI_APP_E2E_URL: ${{ github.event.deployment_status.url }}
run: just e2e deployment ui-app
UI_APP_E2E_URL: ${{ github.event.deployment_status.environment_url }}
run: |
echo "Running tests against '${UI_APP_E2E_URL}'."
just e2e deployment ui-app
Binary file modified ui-app/bun.lockb
Binary file not shown.
1 change: 1 addition & 0 deletions ui-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"lint": "next lint"
},
"dependencies": {
"@vercel/speed-insights": "^1.0.2",
"next": "14.0.4",
"next-intl": "3.4.1",
"react": "18.2.0",
Expand Down
28 changes: 6 additions & 22 deletions ui-app/src/app/[locale]/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import '../globals.css';
// import type { Metadata } from 'next';
import { Inter } from 'next/font/google';
import { unstable_setRequestLocale, getTranslations } from 'next-intl/server';
// import { notFound } from 'next/navigation';
import { ReactNode } from 'react';
import { promises as fs } from 'fs';
import { SpeedInsights } from '@vercel/speed-insights/next';

const inter = Inter({ subsets: ['latin'] });

Expand All @@ -18,18 +17,6 @@ export async function generateStaticParams() {
return localeFiles.map((f) => ({ locale: f.replace(/\.json$/, '') }));
}

/**
* Load the contents of a given locale's messages file.
*/
// async function messagesContent(locale: string) {
// try {
// return (await import(`../../../messages/${locale}.json`)).default;
// } catch (error) {
// console.error('[messagesContent] Something went wrong importing the message content', error);
// notFound();
// }
// }

type Params = {
params: Awaited<ReturnType<typeof generateStaticParams>>[0];
};
Expand All @@ -54,16 +41,13 @@ export default async function Layout({ children, params: { locale } }: Props) {
// Required workaround for static rendering with next-intl.
// https://next-intl-docs.vercel.app/docs/getting-started/app-router#static-rendering
unstable_setRequestLocale(locale);

return (
<html lang={locale}>
<body className={inter.className}>{children}</body>
<body className={inter.className}>
{children}
{process.env.IS_VERCEL_BUILD ? <SpeedInsights /> : null}
</body>
</html>
);
}

{
/* import { NextIntlClientProvider } from 'next-intl';
<NextIntlClientProvider locale={locale} messages={messages}>
{children}
</NextIntlClientProvider> */
}

0 comments on commit e1a8a50

Please sign in to comment.