diff options
Diffstat (limited to 'examples/next')
-rw-r--r-- | examples/next/README.md | 20 | ||||
-rw-r--r-- | examples/next/package.json | 8 | ||||
-rw-r--r-- | examples/next/pages/index.tsx | 6 | ||||
-rw-r--r-- | examples/next/pages/second.tsx | 22 |
4 files changed, 15 insertions, 41 deletions
diff --git a/examples/next/README.md b/examples/next/README.md index b12f3e33e..cd0b17310 100644 --- a/examples/next/README.md +++ b/examples/next/README.md @@ -1,22 +1,24 @@ -This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). +# Next.js with Bun runtime + +This is a [Next.js](https://nextjs.org/) project bootstrapped with Bun. ## Getting Started +### Cloning the repo + +```sh +bun create next ./app +``` + First, run the development server: ```bash -npm run dev -# or -yarn dev +bun dev ``` Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. -You can start editing the page by modifying `pages/index.js`. The page auto-updates as you edit the file. - -[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.js`. - -The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages. +You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file. ## Learn More diff --git a/examples/next/package.json b/examples/next/package.json index 3963ff5cc..870dc2c34 100644 --- a/examples/next/package.json +++ b/examples/next/package.json @@ -1,15 +1,15 @@ { "name": "@bun-examples/next", - "version": "0.0.51", + "version": "0.0.53", "main": "index.js", "dependencies": { "next": "^12.1.0", - "react": "^17", - "react-dom": "^17", + "react": "^18", + "react-dom": "^18", "react-is": "^17.0.2" }, "devDependencies": { - "@types/react": "latest", + "@types/react": "^18", "bun-framework-next": "^12", "typescript": "latest" }, diff --git a/examples/next/pages/index.tsx b/examples/next/pages/index.tsx index 90b988011..fc078404d 100644 --- a/examples/next/pages/index.tsx +++ b/examples/next/pages/index.tsx @@ -1,13 +1,7 @@ import Head from "next/head"; -import Link from "next/link"; import React from "react"; import styles from "../styles/Home.module.css"; import nextPackage from "next/package.json"; -export async function getStaticProps(ctx) { - return { - props: {}, - }; -} export default function Home({}) { return ( diff --git a/examples/next/pages/second.tsx b/examples/next/pages/second.tsx deleted file mode 100644 index 0e7b5a5cf..000000000 --- a/examples/next/pages/second.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import Link from "next/link"; - -export default function Second({}) { - return ( - <div style={{ padding: 16 }}> - <h1>Second</h1> - - <ul> - <li> - <Link href="/"> - <a>Root page</a> - </Link> - </li> - <li> - <Link href="/foo/bar/third"> - <a>Third! page</a> - </Link> - </li> - </ul> - </div> - ); -} |