Skip to content

Commit

Permalink
chore: test next/og (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa authored Aug 22, 2024
1 parent 926c29c commit 918f387
Show file tree
Hide file tree
Showing 5 changed files with 128 additions and 20 deletions.
4 changes: 1 addition & 3 deletions app/api/og/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ import type { ReactElement } from 'react';
export const runtime = 'edge';

const interSemiBold = fetch(
// TODO: unsupported server asset url
// new URL('./Inter-SemiBold.ttf', import.meta.url),
'data:,todo',
new URL('./Inter-SemiBold.ttf', import.meta.url),
).then((res) => res.arrayBuffer());

export async function GET(req: NextRequest): Promise<Response | ImageResponse> {
Expand Down
4 changes: 2 additions & 2 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ export const metadata: Metadata = {
default: 'Next.js App Router',
template: '%s | Next.js App Router',
},
metadataBase: new URL('https://app-router.vercel.app'),
metadataBase: new URL('https://app-router-vite.vercel.app'),
description:
'A playground to explore new Next.js App Router features such as nested layouts, instant loading states, streaming, and component level data fetching.',
openGraph: {
title: 'Next.js App Router Playground',
description:
'A playground to explore new Next.js App Router features such as nested layouts, instant loading states, streaming, and component level data fetching.',
images: [`/api/og?title=Next.js App Router`],
images: [`/api/og?title=Next on Vite`],
},
twitter: {
card: 'summary_large_image',
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
},
"dependencies": {
"@heroicons/react": "2.1.3",
"@hiogawa/react-server": "0.3.5",
"@hiogawa/react-server": "0.3.7",
"clsx": "2.1.1",
"date-fns": "3.6.0",
"dinero.js": "2.0.0-alpha.10",
"ms": "3.0.0-canary.1",
"next": "npm:@hiogawa/react-server-next@0.0.12",
"next": "npm:@hiogawa/react-server-next@0.0.14",
"react": "rc",
"react-dom": "rc",
"react-server-dom-webpack": "rc",
Expand Down
134 changes: 123 additions & 11 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import { defineConfig } from 'vite';
export default defineConfig((env) => ({
plugins: [
next({
// deploy everything to edge
adapter: process.env['VERCEL'] ? 'vercel-edge' : undefined,
// ssg is opt-in for now
prerender: async (_, presets) => ['/', ...(await presets.generateStaticParams())],
}),
Expand Down

0 comments on commit 918f387

Please sign in to comment.