Skip to content

Commit

Permalink
Upgrade to Next.js 14 (vercel#1224)
Browse files Browse the repository at this point in the history
  • Loading branch information
leerob authored Oct 27, 2023
1 parent 80e4800 commit 2448f52
Show file tree
Hide file tree
Showing 10 changed files with 407 additions and 393 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ jobs:
key: node-modules-cache-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Install dependencies
if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: pnpm install
run: pnpm install --no-frozen-lockfile
- name: Run tests
run: pnpm test
10 changes: 2 additions & 8 deletions app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Navbar from 'components/layout/navbar';
import { GeistSans } from 'geist/font';
import { ensureStartsWith } from 'lib/utils';
import { Inter } from 'next/font/google';
import { ReactNode, Suspense } from 'react';
import './globals.css';

Expand Down Expand Up @@ -31,15 +31,9 @@ export const metadata = {
})
};

const inter = Inter({
subsets: ['latin'],
display: 'swap',
variable: '--font-inter'
});

export default async function RootLayout({ children }: { children: ReactNode }) {
return (
<html lang="en" className={inter.variable}>
<html lang="en" className={GeistSans.variable}>
<body className="bg-neutral-50 text-black selection:bg-teal-300 dark:bg-neutral-900 dark:text-white dark:selection:bg-pink-500 dark:selection:text-white">
<Navbar />
<Suspense>
Expand Down
6 changes: 1 addition & 5 deletions components/cart/add-to-cart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ import { addItem } from 'components/cart/actions';
import LoadingDots from 'components/loading-dots';
import { ProductVariant } from 'lib/shopify/types';
import { useSearchParams } from 'next/navigation';
import {
// @ts-ignore
experimental_useFormState as useFormState,
experimental_useFormStatus as useFormStatus
} from 'react-dom';
import { useFormState, useFormStatus } from 'react-dom';

function SubmitButton({
availableForSale,
Expand Down
6 changes: 1 addition & 5 deletions components/cart/delete-item-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ import clsx from 'clsx';
import { removeItem } from 'components/cart/actions';
import LoadingDots from 'components/loading-dots';
import type { CartItem } from 'lib/shopify/types';
import {
// @ts-ignore
experimental_useFormState as useFormState,
experimental_useFormStatus as useFormStatus
} from 'react-dom';
import { useFormState, useFormStatus } from 'react-dom';

function SubmitButton() {
const { pending } = useFormStatus();
Expand Down
6 changes: 1 addition & 5 deletions components/cart/edit-item-quantity-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ import clsx from 'clsx';
import { updateItemQuantity } from 'components/cart/actions';
import LoadingDots from 'components/loading-dots';
import type { CartItem } from 'lib/shopify/types';
import {
// @ts-ignore
experimental_useFormState as useFormState,
experimental_useFormStatus as useFormStatus
} from 'react-dom';
import { useFormState, useFormStatus } from 'react-dom';

function SubmitButton({ type }: { type: 'plus' | 'minus' }) {
const { pending } = useFormStatus();
Expand Down
2 changes: 1 addition & 1 deletion components/opengraph-image.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ImageResponse } from 'next/server';
import { ImageResponse } from 'next/og';
import LogoIcon from './icons/logo';

export type Props = {
Expand Down
3 changes: 0 additions & 3 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ module.exports = {
// Disabling on production builds because we're running checks on PRs via GitHub Actions.
ignoreDuringBuilds: true
},
experimental: {
serverActions: true
},
images: {
formats: ['image/avif', 'image/webp'],
remotePatterns: [
Expand Down
19 changes: 10 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,28 @@
"@headlessui/react": "^1.7.17",
"@heroicons/react": "^2.0.18",
"clsx": "^2.0.0",
"next": "13.5.4",
"geist": "^1.0.0",
"next": "14.0.0",
"react": "18.2.0",
"react-dom": "18.2.0"
},
"devDependencies": {
"@tailwindcss/container-queries": "^0.1.1",
"@tailwindcss/typography": "^0.5.10",
"@types/node": "20.8.4",
"@types/react": "18.2.10",
"@types/react-dom": "18.2.10",
"@types/node": "20.8.9",
"@types/react": "18.2.33",
"@types/react-dom": "18.2.14",
"@vercel/git-hooks": "^1.0.0",
"autoprefixer": "^10.4.16",
"eslint": "^8.51.0",
"eslint-config-next": "^13.5.4",
"eslint": "^8.52.0",
"eslint-config-next": "^14.0.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-unicorn": "^48.0.1",
"lint-staged": "^14.0.1",
"lint-staged": "^15.0.2",
"postcss": "^8.4.31",
"prettier": "3.0.3",
"prettier-plugin-tailwindcss": "^0.5.5",
"tailwindcss": "^3.3.3",
"prettier-plugin-tailwindcss": "^0.5.6",
"tailwindcss": "^3.3.5",
"typescript": "5.2.2"
}
}
Loading

0 comments on commit 2448f52

Please sign in to comment.