-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
test(nextjs): Added nextjs CF workers test app #18928
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
Open
logaretm
wants to merge
4
commits into
develop
Choose a base branch
from
awad/js-1529-add-nextjs-e2e-tests-on-cloudflare-workers-runtime
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
dev-packages/e2e-tests/test-applications/nextjs-16-cf-workers/.gitignore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
|
||
| # dependencies | ||
| /node_modules | ||
| /.pnp | ||
| .pnp.* | ||
| .yarn/* | ||
| !.yarn/patches | ||
| !.yarn/plugins | ||
| !.yarn/releases | ||
| !.yarn/versions | ||
|
|
||
| # testing | ||
| /coverage | ||
|
|
||
| # next.js | ||
| /.next/ | ||
| /out/ | ||
|
|
||
| # production | ||
| /build | ||
|
|
||
| # misc | ||
| .DS_Store | ||
| *.pem | ||
|
|
||
| # debug | ||
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* | ||
| .pnpm-debug.log* | ||
|
|
||
| # env files (can opt-in for committing if needed) | ||
| .env* | ||
|
|
||
| # vercel | ||
| .vercel | ||
|
|
||
| # typescript | ||
| *.tsbuildinfo | ||
| next-env.d.ts | ||
|
|
||
| # Sentry Config File | ||
| .env.sentry-build-plugin |
2 changes: 2 additions & 0 deletions
2
dev-packages/e2e-tests/test-applications/nextjs-16-cf-workers/.npmrc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| @sentry:registry=http://127.0.0.1:4873 | ||
| @sentry-internal:registry=http://127.0.0.1:4873 |
12 changes: 12 additions & 0 deletions
12
dev-packages/e2e-tests/test-applications/nextjs-16-cf-workers/app/(nested-layout)/layout.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import { PropsWithChildren } from 'react'; | ||
|
|
||
| export const dynamic = 'force-dynamic'; | ||
|
|
||
| export default function Layout({ children }: PropsWithChildren<{}>) { | ||
| return ( | ||
| <div> | ||
| <p>Layout</p> | ||
| {children} | ||
| </div> | ||
| ); | ||
| } |
12 changes: 12 additions & 0 deletions
12
...-applications/nextjs-16-cf-workers/app/(nested-layout)/nested-layout/[dynamic]/layout.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import { PropsWithChildren } from 'react'; | ||
|
|
||
| export const dynamic = 'force-dynamic'; | ||
|
|
||
| export default function Layout({ children }: PropsWithChildren<{}>) { | ||
| return ( | ||
| <div> | ||
| <p>DynamicLayout</p> | ||
| {children} | ||
| </div> | ||
| ); | ||
| } |
15 changes: 15 additions & 0 deletions
15
...st-applications/nextjs-16-cf-workers/app/(nested-layout)/nested-layout/[dynamic]/page.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| export const dynamic = 'force-dynamic'; | ||
|
|
||
| export default async function Page() { | ||
| return ( | ||
| <div> | ||
| <p>Dynamic Page</p> | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| export async function generateMetadata() { | ||
| return { | ||
| title: 'I am dynamic page generated metadata', | ||
| }; | ||
| } |
12 changes: 12 additions & 0 deletions
12
...tests/test-applications/nextjs-16-cf-workers/app/(nested-layout)/nested-layout/layout.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import { PropsWithChildren } from 'react'; | ||
|
|
||
| export const dynamic = 'force-dynamic'; | ||
|
|
||
| export default function Layout({ children }: PropsWithChildren<{}>) { | ||
| return ( | ||
| <div> | ||
| <p>Layout</p> | ||
| {children} | ||
| </div> | ||
| ); | ||
| } |
11 changes: 11 additions & 0 deletions
11
...e-tests/test-applications/nextjs-16-cf-workers/app/(nested-layout)/nested-layout/page.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| export const dynamic = 'force-dynamic'; | ||
|
|
||
| export default function Page() { | ||
| return <p>Hello World!</p>; | ||
| } | ||
|
|
||
| export async function generateMetadata() { | ||
| return { | ||
| title: 'I am generated metadata', | ||
| }; | ||
| } |
3 changes: 3 additions & 0 deletions
3
...-tests/test-applications/nextjs-16-cf-workers/app/api/endpoint-behind-middleware/route.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| export function GET() { | ||
| return Response.json({ name: 'John Doe' }); | ||
| } |
Binary file added
BIN
+25.3 KB
dev-packages/e2e-tests/test-applications/nextjs-16-cf-workers/app/favicon.ico
Binary file not shown.
23 changes: 23 additions & 0 deletions
23
dev-packages/e2e-tests/test-applications/nextjs-16-cf-workers/app/global-error.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| 'use client'; | ||
|
|
||
| import * as Sentry from '@sentry/nextjs'; | ||
| import NextError from 'next/error'; | ||
| import { useEffect } from 'react'; | ||
|
|
||
| export default function GlobalError({ error }: { error: Error & { digest?: string } }) { | ||
| useEffect(() => { | ||
| Sentry.captureException(error); | ||
| }, [error]); | ||
|
|
||
| return ( | ||
| <html> | ||
| <body> | ||
| {/* `NextError` is the default Next.js error page component. Its type | ||
| definition requires a `statusCode` prop. However, since the App Router | ||
| does not expose status codes for errors, we simply pass 0 to render a | ||
| generic error message. */} | ||
| <NextError statusCode={0} /> | ||
| </body> | ||
| </html> | ||
| ); | ||
| } |
17 changes: 17 additions & 0 deletions
17
...packages/e2e-tests/test-applications/nextjs-16-cf-workers/app/isr-test/[product]/page.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| export const revalidate = 60; // ISR: revalidate every 60 seconds | ||
| export const dynamicParams = true; // Allow dynamic params beyond generateStaticParams | ||
|
|
||
| export async function generateStaticParams(): Promise<Array<{ product: string }>> { | ||
| return [{ product: 'laptop' }, { product: 'phone' }, { product: 'tablet' }]; | ||
| } | ||
|
|
||
| export default async function ISRProductPage({ params }: { params: Promise<{ product: string }> }) { | ||
| const { product } = await params; | ||
|
|
||
| return ( | ||
| <div> | ||
| <h1>ISR Product: {product}</h1> | ||
| <div id="isr-product-id">{product}</div> | ||
| </div> | ||
| ); | ||
| } |
15 changes: 15 additions & 0 deletions
15
dev-packages/e2e-tests/test-applications/nextjs-16-cf-workers/app/isr-test/static/page.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| export const revalidate = 60; // ISR: revalidate every 60 seconds | ||
| export const dynamicParams = true; | ||
|
|
||
| export async function generateStaticParams(): Promise<never[]> { | ||
| return []; | ||
| } | ||
|
|
||
| export default function ISRStaticPage() { | ||
| return ( | ||
| <div> | ||
| <h1>ISR Static Page</h1> | ||
| <div id="isr-static-marker">static-isr</div> | ||
| </div> | ||
| ); | ||
| } |
7 changes: 7 additions & 0 deletions
7
dev-packages/e2e-tests/test-applications/nextjs-16-cf-workers/app/layout.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| export default function Layout({ children }: { children: React.ReactNode }) { | ||
| return ( | ||
| <html lang="en"> | ||
| <body>{children}</body> | ||
| </html> | ||
| ); | ||
| } |
34 changes: 34 additions & 0 deletions
34
dev-packages/e2e-tests/test-applications/nextjs-16-cf-workers/app/metrics/page.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| 'use client'; | ||
|
|
||
| import * as Sentry from '@sentry/nextjs'; | ||
|
|
||
| export default function Page() { | ||
| const handleClick = async () => { | ||
| Sentry.metrics.count('test.page.count', 1, { | ||
| attributes: { | ||
| page: '/metrics', | ||
| 'random.attribute': 'Apples', | ||
| }, | ||
| }); | ||
| Sentry.metrics.distribution('test.page.distribution', 100, { | ||
| attributes: { | ||
| page: '/metrics', | ||
| 'random.attribute': 'Manzanas', | ||
| }, | ||
| }); | ||
| Sentry.metrics.gauge('test.page.gauge', 200, { | ||
| attributes: { | ||
| page: '/metrics', | ||
| 'random.attribute': 'Mele', | ||
| }, | ||
| }); | ||
| await fetch('/metrics/route-handler'); | ||
| }; | ||
|
|
||
| return ( | ||
| <div> | ||
| <h1>Metrics page</h1> | ||
| <button onClick={handleClick}>Emit</button> | ||
| </div> | ||
| ); | ||
| } |
23 changes: 23 additions & 0 deletions
23
...kages/e2e-tests/test-applications/nextjs-16-cf-workers/app/metrics/route-handler/route.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| import * as Sentry from '@sentry/nextjs'; | ||
|
|
||
| export const GET = async () => { | ||
| Sentry.metrics.count('test.route.handler.count', 1, { | ||
| attributes: { | ||
| endpoint: '/metrics/route-handler', | ||
| 'random.attribute': 'Potatoes', | ||
| }, | ||
| }); | ||
| Sentry.metrics.distribution('test.route.handler.distribution', 100, { | ||
| attributes: { | ||
| endpoint: '/metrics/route-handler', | ||
| 'random.attribute': 'Patatas', | ||
| }, | ||
| }); | ||
| Sentry.metrics.gauge('test.route.handler.gauge', 200, { | ||
| attributes: { | ||
| endpoint: '/metrics/route-handler', | ||
| 'random.attribute': 'Patate', | ||
| }, | ||
| }); | ||
| return Response.json({ message: 'Bueno' }); | ||
| }; |
17 changes: 17 additions & 0 deletions
17
...es/e2e-tests/test-applications/nextjs-16-cf-workers/app/nested-rsc-error/[param]/page.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| import { Suspense } from 'react'; | ||
|
|
||
| export const dynamic = 'force-dynamic'; | ||
|
|
||
| export default async function Page() { | ||
| return ( | ||
| <Suspense fallback={<p>Loading...</p>}> | ||
| {/* @ts-ignore */} | ||
| <Crash />; | ||
| </Suspense> | ||
| ); | ||
| } | ||
|
|
||
| async function Crash() { | ||
| throw new Error('I am technically uncatchable'); | ||
| return <p>unreachable</p>; | ||
| } | ||
logaretm marked this conversation as resolved.
Show resolved
Hide resolved
|
||
11 changes: 11 additions & 0 deletions
11
...ackages/e2e-tests/test-applications/nextjs-16-cf-workers/app/non-isr-test/[item]/page.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| // No generateStaticParams - this is NOT an ISR page | ||
| export default async function NonISRPage({ params }: { params: Promise<{ item: string }> }) { | ||
| const { item } = await params; | ||
|
|
||
| return ( | ||
| <div> | ||
| <h1>Non-ISR Dynamic Page: {item}</h1> | ||
| <div id="non-isr-item-id">{item}</div> | ||
| </div> | ||
| ); | ||
| } |
3 changes: 3 additions & 0 deletions
3
dev-packages/e2e-tests/test-applications/nextjs-16-cf-workers/app/page.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| export default function Page() { | ||
| return <p>Next 16 test app</p>; | ||
| } |
8 changes: 8 additions & 0 deletions
8
...packages/e2e-tests/test-applications/nextjs-16-cf-workers/app/pageload-tracing/layout.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| import { PropsWithChildren } from 'react'; | ||
|
|
||
| export const dynamic = 'force-dynamic'; | ||
|
|
||
| export default async function Layout({ children }: PropsWithChildren<unknown>) { | ||
| await new Promise(resolve => setTimeout(resolve, 500)); | ||
| return <>{children}</>; | ||
| } |
14 changes: 14 additions & 0 deletions
14
dev-packages/e2e-tests/test-applications/nextjs-16-cf-workers/app/pageload-tracing/page.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| export const dynamic = 'force-dynamic'; | ||
|
|
||
| export default async function Page() { | ||
| await new Promise(resolve => setTimeout(resolve, 1000)); | ||
| return <p>I am page 2</p>; | ||
| } | ||
|
|
||
| export async function generateMetadata() { | ||
| (await fetch('https://example.com/', { cache: 'no-store' })).text(); | ||
|
|
||
| return { | ||
| title: 'my title', | ||
| }; | ||
| } |
3 changes: 3 additions & 0 deletions
3
...-tests/test-applications/nextjs-16-cf-workers/app/parameterized/[one]/beep/[two]/page.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| export default function ParameterizedPage() { | ||
| return <div>Dynamic page two</div>; | ||
| } |
3 changes: 3 additions & 0 deletions
3
...es/e2e-tests/test-applications/nextjs-16-cf-workers/app/parameterized/[one]/beep/page.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| export default function BeepPage() { | ||
| return <div>Beep</div>; | ||
| } |
3 changes: 3 additions & 0 deletions
3
...ackages/e2e-tests/test-applications/nextjs-16-cf-workers/app/parameterized/[one]/page.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| export default function ParameterizedPage() { | ||
| return <div>Dynamic page one</div>; | ||
| } |
3 changes: 3 additions & 0 deletions
3
...ckages/e2e-tests/test-applications/nextjs-16-cf-workers/app/parameterized/static/page.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| export default function StaticPage() { | ||
| return <div>Static page</div>; | ||
| } |
9 changes: 9 additions & 0 deletions
9
dev-packages/e2e-tests/test-applications/nextjs-16-cf-workers/app/prefetching/page.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| import Link from 'next/link'; | ||
|
|
||
| export default function Page() { | ||
| return ( | ||
| <Link id="prefetch-link" href="/prefetching/to-be-prefetched"> | ||
| link | ||
| </Link> | ||
| ); | ||
| } |
5 changes: 5 additions & 0 deletions
5
...2e-tests/test-applications/nextjs-16-cf-workers/app/prefetching/to-be-prefetched/page.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| export const dynamic = 'force-dynamic'; | ||
|
|
||
| export default function Page() { | ||
| return <p>Hello</p>; | ||
| } |
7 changes: 7 additions & 0 deletions
7
...ckages/e2e-tests/test-applications/nextjs-16-cf-workers/app/redirect/destination/page.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| export default function RedirectDestinationPage() { | ||
| return ( | ||
| <div> | ||
| <h1>Redirect Destination</h1> | ||
| </div> | ||
| ); | ||
| } |
18 changes: 18 additions & 0 deletions
18
dev-packages/e2e-tests/test-applications/nextjs-16-cf-workers/app/redirect/origin/page.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| import { redirect } from 'next/navigation'; | ||
|
|
||
| async function redirectAction() { | ||
| 'use server'; | ||
|
|
||
| redirect('/redirect/destination'); | ||
| } | ||
|
|
||
| export default function RedirectOriginPage() { | ||
| return ( | ||
| <> | ||
| {/* @ts-ignore */} | ||
logaretm marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| <form action={redirectAction}> | ||
| <button type="submit">Redirect me</button> | ||
| </form> | ||
| </> | ||
| ); | ||
| } | ||
8 changes: 8 additions & 0 deletions
8
...s/e2e-tests/test-applications/nextjs-16-cf-workers/app/route-handler/[xoxo]/edge/route.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| import { NextResponse } from 'next/server'; | ||
|
|
||
| export const runtime = 'edge'; | ||
| export const dynamic = 'force-dynamic'; | ||
|
|
||
| export async function GET() { | ||
| return NextResponse.json({ message: 'Hello Edge Route Handler' }); | ||
| } |
7 changes: 7 additions & 0 deletions
7
...s/e2e-tests/test-applications/nextjs-16-cf-workers/app/route-handler/[xoxo]/node/route.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import { NextResponse } from 'next/server'; | ||
|
|
||
| export const dynamic = 'force-dynamic'; | ||
|
|
||
| export async function GET() { | ||
| return NextResponse.json({ message: 'Hello Node Route Handler' }); | ||
| } |
8 changes: 8 additions & 0 deletions
8
...ts/test-applications/nextjs-16-cf-workers/app/streaming-rsc-error/[param]/client-page.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| 'use client'; | ||
|
|
||
| import { use } from 'react'; | ||
|
|
||
| export function RenderPromise({ stringPromise }: { stringPromise: Promise<string> }) { | ||
| const s = use(stringPromise); | ||
| return <>{s}</>; | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.