Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: test next/og #8

Merged
merged 6 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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