Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,7 @@ jobs:
with:
node-version-file: 'dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}/package.json'
- name: Set up Bun
if: matrix.test-application == 'node-exports-test-app'
if: contains(fromJSON('["node-exports-test-app","nextjs-16-bun"]'), matrix.test-application)
uses: oven-sh/setup-bun@v2
- name: Set up AWS SAM
if: matrix.test-application == 'aws-serverless'
Expand Down
44 changes: 44 additions & 0 deletions dev-packages/e2e-tests/test-applications/nextjs-16-bun/.gitignore
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
4 changes: 4 additions & 0 deletions dev-packages/e2e-tests/test-applications/nextjs-16-bun/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@sentry:registry=http://127.0.0.1:4873
@sentry-internal:registry=http://127.0.0.1:4873
public-hoist-pattern[]=*import-in-the-middle*
public-hoist-pattern[]=*require-in-the-middle*
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>
);
}
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>
);
}
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',
};
}
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>
);
}
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',
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export function GET() {
return Response.json({ name: 'John Doe' });
}
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>
);
}
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>
);
}
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>;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function Page() {
return <p>Next 16 Bun test app</p>;
}
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}</>;
}
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',
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function ParameterizedPage() {
return <div>Dynamic page two</div>;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function BeepPage() {
return <div>Beep</div>;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function ParameterizedPage() {
return <div>Dynamic page one</div>;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function StaticPage() {
return <div>Static page</div>;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { checkHandler } from '../../utils';

export const dynamic = 'force-dynamic';

export const GET = checkHandler;
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { NextResponse } from 'next/server';

export const dynamic = 'force-dynamic';

export async function GET() {
const data = await fetch(`http://localhost:3030/propagation/test-outgoing-fetch-external-disallowed/check`, {
cache: 'no-store',
}).then(res => res.json());
return NextResponse.json(data);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { checkHandler } from '../../utils';

export const dynamic = 'force-dynamic';

export const GET = checkHandler;
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { NextResponse } from 'next/server';

export const dynamic = 'force-dynamic';

export async function GET() {
const data = await fetch(`http://localhost:3030/propagation/test-outgoing-fetch/check`, { cache: 'no-store' }).then(
res => res.json(),
);
return NextResponse.json(data);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { headers } from 'next/headers';
import { NextResponse } from 'next/server';

export async function checkHandler() {
const headerList = await headers();

const headerObj: Record<string, unknown> = {};
headerList.forEach((value, key) => {
headerObj[key] = value;
});

return NextResponse.json({ headers: headerObj });
}
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' });
}
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' });
}
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}</>;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Suspense } from 'react';
import { RenderPromise } from './client-page';

export const dynamic = 'force-dynamic';

export default async function Page() {
const crashingPromise = new Promise<string>((_, reject) => {
setTimeout(() => {
reject(new Error('I am a data streaming error'));
}, 100);
});

return (
<Suspense fallback={<p>Loading...</p>}>
<RenderPromise stringPromise={crashingPromise} />;
</Suspense>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import * as Sentry from '@sentry/nextjs';

Sentry.init({
environment: 'qa', // dynamic sampling bias to keep transactions
dsn: process.env.NEXT_PUBLIC_E2E_TEST_DSN,
tunnel: `http://localhost:3031/`, // proxy server
tracesSampleRate: 1.0,
sendDefaultPii: true,
});

export const onRouterTransitionStart = Sentry.captureRouterTransitionStart;
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import * as Sentry from '@sentry/nextjs';

export async function register() {
if (process.env.NEXT_RUNTIME === 'nodejs') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: is this still nodejs?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still node yes

await import('./sentry.server.config');
}

if (process.env.NEXT_RUNTIME === 'edge') {
await import('./sentry.edge.config');
}
}

export const onRequestError = Sentry.captureRequestError;
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { withSentryConfig } from '@sentry/nextjs';
import type { NextConfig } from 'next';

const nextConfig: NextConfig = {};

export default withSentryConfig(nextConfig, {
silent: true,
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "nextjs-16-bun",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "bun --bun next dev",
"build": "bun --bun next build > .tmp_build_stdout 2> .tmp_build_stderr || (cat .tmp_build_stdout && cat .tmp_build_stderr && exit 1)",
"clean": "npx rimraf node_modules pnpm-lock.yaml .tmp_dev_server_logs",
"start": "bun --bun next start",
"test:prod": "TEST_ENV=production playwright test",
"test:build": "pnpm install && pnpm build",
"test:assert": "pnpm test:prod"
},
"dependencies": {
"@sentry/nextjs": "latest || *",
"@sentry/core": "latest || *",
"import-in-the-middle": "^2",
"next": "16.1.5",
"react": "19.1.0",
"react-dom": "19.1.0",
"require-in-the-middle": "^8"
},
"devDependencies": {
"@playwright/test": "~1.56.0",
"@sentry-internal/test-utils": "link:../../../test-utils",
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
"typescript": "^5"
},
"volta": {
"extends": "../../package.json"
}
}
Loading
Loading