Skip to content

Commit

Permalink
#287 Upgrade next to v15 (#289)
Browse files Browse the repository at this point in the history
  • Loading branch information
nevendyulgerov authored Jan 14, 2025
1 parent 1713cd5 commit c6485fb
Show file tree
Hide file tree
Showing 13 changed files with 1,710 additions and 2,086 deletions.
8 changes: 5 additions & 3 deletions apps/web/e2e/transactions/metamask.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ test.describe.serial("Ether Deposit form", () => {
}
});

test("should render 'Ether Deposit' transaction form", async ({ page }) => {
test.skip("should render 'Ether Deposit' transaction form", async ({
page,
}) => {
await page.goto("/");

const connectButton = page.getByText("Connect Wallet");
Expand Down Expand Up @@ -44,7 +46,7 @@ test.describe.serial("Ether Deposit form", () => {
).toBeHidden();
});

test("should display errors for 'Ether Deposit' transaction form", async ({
test.skip("should display errors for 'Ether Deposit' transaction form", async ({
page,
}) => {
await page.goto("/");
Expand Down Expand Up @@ -88,7 +90,7 @@ test.describe.serial("Ether Deposit form", () => {
await expect(form.getByText("Invalid hex string")).toBeVisible();
});

test("should validate successfully 'Ether Deposit' transaction form", async ({
test.skip("should validate successfully 'Ether Deposit' transaction form", async ({
page,
}) => {
await page.goto("/");
Expand Down
1 change: 0 additions & 1 deletion apps/web/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const ContentSecurityPolicy = `
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
swcMinify: true,
output: "standalone",
basePath: process.env.BASE_PATH || "",
async headers() {
Expand Down
20 changes: 12 additions & 8 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"build": "next build",
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf .next",
"codegen": "dotenv -e .env -c -- graphql-codegen",
"dev": "next dev",
"dev": "next dev --turbopack",
"start": "next start",
"lint": "next lint",
"test": "vitest run",
Expand Down Expand Up @@ -39,13 +39,13 @@
"highlightjs-solidity": "^2.0.6",
"jotai": "^2.9.0",
"lokijs": "^1",
"next": "^14.2.21",
"next": "15.1.3",
"pino-pretty": "^10",
"pretty-ms": "^8",
"ramda": "0.30.1",
"ramda-adjunct": "^5.0.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react": "19.0.0",
"react-dom": "19.0.0",
"react-icons": "^4",
"react-jazzicon": "^1",
"urql": "^4",
Expand All @@ -68,12 +68,12 @@
"@playwright/test": "^1.37.0",
"@sunodo/wagmi-plugin-hardhat-deploy": "^0.2",
"@synthetixio/synpress": "^3.7.3",
"@testing-library/jest-dom": "^6.5.0",
"@testing-library/react": "^16.0.0",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.1.0",
"@types/node": "^20",
"@types/ramda": "^0.30.1",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@types/react": "19.0.2",
"@types/react-dom": "19.0.2",
"@types/uuid": "^10.0.0",
"@vitejs/plugin-react": "^4.3.1",
"@vitest/coverage-v8": "^2.0.5",
Expand All @@ -91,5 +91,9 @@
"ts-node": "^10",
"typescript": "^5",
"vitest": "^2.0.5"
},
"resolutions": {
"@types/react": "19.0.2",
"@types/react-dom": "19.0.2"
}
}
14 changes: 7 additions & 7 deletions apps/web/src/app/applications/[address]/inputs/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ import {
import getConfiguredChainId from "../../../../lib/getConfiguredChain";
import { getUrqlServerClient } from "../../../../lib/urql";

export async function generateMetadata({
params,
}: ApplicationInputsPageProps): Promise<Metadata> {
export async function generateMetadata(
props: ApplicationInputsPageProps,
): Promise<Metadata> {
const params = await props.params;
return {
title: `Application ${params.address}`,
};
Expand All @@ -37,12 +38,11 @@ async function getApplication(appId: string) {
}

export type ApplicationInputsPageProps = {
params: { address: string };
params: Promise<{ address: string }>;
};

const ApplicationInputsPage: FC<ApplicationInputsPageProps> = async ({
params,
}) => {
const ApplicationInputsPage: FC<ApplicationInputsPageProps> = async (props) => {
const params = await props.params;
const chainId = getConfiguredChainId();
const appId = `${chainId}-${params.address?.toLowerCase()}`;
const application = await getApplication(appId);
Expand Down
12 changes: 7 additions & 5 deletions apps/web/src/app/applications/[address]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ import {
import getConfiguredChainId from "../../../lib/getConfiguredChain";
import { getUrqlServerClient } from "../../../lib/urql";

export async function generateMetadata({
params,
}: ApplicationPageProps): Promise<Metadata> {
export async function generateMetadata(
props: ApplicationPageProps,
): Promise<Metadata> {
const params = await props.params;
return {
title: `Application ${params.address}`,
};
Expand All @@ -37,10 +38,11 @@ async function getApplication(appId: string) {
}

export type ApplicationPageProps = {
params: { address: string };
params: Promise<{ address: string }>;
};

const ApplicationPage: FC<ApplicationPageProps> = async ({ params }) => {
const ApplicationPage: FC<ApplicationPageProps> = async (props) => {
const params = await props.params;
const chainId = getConfiguredChainId();
const appId = `${chainId}-${params.address?.toLowerCase()}`;
const application = await getApplication(appId);
Expand Down
5 changes: 1 addition & 4 deletions apps/web/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import "@mantine/notifications/styles.css";
import { Analytics } from "@vercel/analytics/react";
import { SpeedInsights } from "@vercel/speed-insights/next";
import { Metadata } from "next";
import dynamic from "next/dynamic";
import type { FC, ReactNode } from "react";
import { Providers } from "../providers/providers";
import { Shell } from "../components/layout/shell-container";

export const metadata: Metadata = {
title: {
Expand All @@ -22,9 +22,6 @@ export const metadata: Metadata = {
},
};

const Shell = dynamic(() => import("../components/layout/shell"), {
ssr: false,
});
interface LayoutProps {
children: ReactNode;
}
Expand Down
7 changes: 4 additions & 3 deletions apps/web/src/app/specifications/edit/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ export const metadata: Metadata = {
};

interface PageProps {
params: {
params: Promise<{
id: string;
};
}>;
}

export default function EditSpecificationPage({ params }: PageProps) {
export default async function EditSpecificationPage(props: PageProps) {
const params = await props.params;
return (
<Stack>
<Breadcrumbs
Expand Down
6 changes: 6 additions & 0 deletions apps/web/src/components/layout/shell-container.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"use client";
import dynamic from "next/dynamic";

export const Shell = dynamic(() => import("./shell"), {
ssr: false,
});
5 changes: 3 additions & 2 deletions apps/web/src/hooks/useElementVisibility.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { useIntersection } from "@mantine/hooks";
import { useMemo } from "react";
import { RefObject, useMemo } from "react";

type UseElementVisibilityParamsProps<T extends Element> = {
element: React.RefObject<T>;
element: RefObject<T | null>;
threshold?: number;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import {
screen,
waitFor,
} from "@testing-library/react";
import { FC } from "react";
import { act } from "react-dom/test-utils";
import { FC, act } from "react";
import { SpecificationFormView } from "../../../src/components/specification/SpecificationFormView";
import localRepository from "../../../src/components/specification/hooks/localRepository";
import {
Expand Down
38 changes: 19 additions & 19 deletions apps/workshop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,37 +16,37 @@
"@mantine/hooks": "^7.12.0",
"@rainbow-me/rainbowkit": "2",
"@tanstack/react-query": "^5.27.5",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-icons": "^4",
"serve": "^14.2.1",
"wagmi": "^2"
},
"devDependencies": {
"@cartesi/tsconfig": "*",
"@storybook/addon-essentials": "^8.0.5",
"@storybook/addon-interactions": "^8.0.5",
"@storybook/addon-links": "^8.0.5",
"@storybook/addon-mdx-gfm": "^8.0.5",
"@storybook/addon-onboarding": "^8.0.5",
"@storybook/addon-themes": "^8.0.5",
"@storybook/addon-viewport": "^8.0.5",
"@storybook/blocks": "^8.0.5",
"@storybook/cli": "^8.0.5",
"@storybook/preview-api": "^8.0.5",
"@storybook/react": "^8.0.5",
"@storybook/react-vite": "^8.0.5",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@storybook/addon-essentials": "^8.4.7",
"@storybook/addon-interactions": "^8.4.7",
"@storybook/addon-links": "^8.4.7",
"@storybook/addon-mdx-gfm": "^8.4.7",
"@storybook/addon-onboarding": "^8.4.7",
"@storybook/addon-themes": "^8.4.7",
"@storybook/addon-viewport": "^8.4.7",
"@storybook/blocks": "^8.4.7",
"@storybook/cli": "^8.4.7",
"@storybook/preview-api": "^8.4.7",
"@storybook/react": "^8.4.7",
"@storybook/react-vite": "^8.4.7",
"@types/react": "^19.0.2",
"@types/react-dom": "^19.0.2",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"@vitejs/plugin-react": "^4.0.3",
"@vitejs/plugin-react": "^4.3.4",
"eslint": "^8.45.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.3",
"prop-types": "^15.8.1",
"storybook": "^8.0.5",
"storybook-dark-mode": "^4.0.1",
"storybook": "^8.4.7",
"storybook-dark-mode": "^4.0.2",
"typescript": "^5.0.2",
"vite": "^4.5.5"
}
Expand Down
10 changes: 5 additions & 5 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,17 @@
},
"devDependencies": {
"@cartesi/tsconfig": "*",
"@testing-library/jest-dom": "^6.5.0",
"@testing-library/react": "^16.0.0",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.1.0",
"@types/ramda": "^0.30.1",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@types/react": "^19.0.2",
"@types/react-dom": "^19.0.2",
"@vitest/coverage-v8": "^2.0.5",
"@vitest/ui": "^2.0.5",
"eslint": "^8",
"eslint-config-cartesi": "*",
"jsdom": "^22.1.0",
"react": "^18.3.1",
"react": "^19.0.0",
"tsup": "^7",
"typescript": "^5",
"vitest": "^2.0.5"
Expand Down
Loading

0 comments on commit c6485fb

Please sign in to comment.