···2233// Here we don't want to run the tests in parallel
44export default configurePlaywright("memory-queue", {
55- isCI: !!process.env.CI,
65 parallel: false,
76 multipleBrowsers: false,
87});
···2233// Here we don't want to run the tests in parallel
44export default configurePlaywright("r2-incremental-cache", {
55- isCI: !!process.env.CI,
65 parallel: false,
76 multipleBrowsers: false,
87});
···2233// Here we don't want to run the tests in parallel
44export default configurePlaywright("static-assets-incremental-cache", {
55- isCI: !!process.env.CI,
65 parallel: false,
76});
+1-2
examples/playground14/e2e/instrumentation.spec.ts
···11import { test, expect } from "@playwright/test";
22-import { describe } from "node:test";
3243test.describe("instrumentation", () => {
54 test("the instrumentation register hook should work for the nodejs runtime", async ({ page }) => {
···20192120 // Note: we cannot test this since currently both runtimes share the same global scope
2221 // (see: https://github.com/opennextjs/opennextjs-cloudflare/issues/408)
2323- describe.skip("isolation", () => {
2222+ test.describe.skip("isolation", () => {
2423 test("the instrumentation register hook nodejs logic should not effect edge routes", async ({ page }) => {
2524 const res = await page.request.get("/middleware-instrumentation");
2625 const respJson: Record<string, string> = await res.json();
···11export function register() {
22 // Note: we register instrumentation for both the nodejs and edge runtime, we do that using the NEXT_RUNTIME env
33 // variable as recommended in the official docs:
44- // https://nextjs.org/docs/app/building-your-application/optimizing/instrumentation#importing-runtime-specific-code
44+ // https://nextjs.org/docs/app/building-your-application/optimizing/instrumentation#importing-runtime-specific-code
5566 if (process.env.NEXT_RUNTIME === "nodejs") {
77 globalThis["__NODEJS_INSTRUMENTATION_SETUP"] =
+1-2
examples/playground15/e2e/instrumentation.spec.ts
···11import { test, expect } from "@playwright/test";
22-import { describe } from "node:test";
3243test.describe("instrumentation", () => {
54 test("the instrumentation register hook should work for the nodejs runtime", async ({ page }) => {
···20192120 // Note: we cannot test this since currently both runtimes share the same global scope
2221 // (see: https://github.com/opennextjs/opennextjs-cloudflare/issues/408)
2323- describe.skip("isolation", () => {
2222+ test.describe.skip("isolation", () => {
2423 test("the instrumentation register hook nodejs logic should not effect edge routes", async ({ page }) => {
2524 const res = await page.request.get("/middleware-instrumentation");
2625 const respJson: Record<string, string> = await res.json();
···11export function register() {
22 // Note: we register instrumentation for both the nodejs and edge runtime, we do that using the NEXT_RUNTIME env
33 // variable as recommended in the official docs:
44- // https://nextjs.org/docs/app/building-your-application/optimizing/instrumentation#importing-runtime-specific-code
44+ // https://nextjs.org/docs/app/building-your-application/optimizing/instrumentation#importing-runtime-specific-code
5566 const timeout = setTimeout(() => {
77 console.log("This is a delayed log from the instrumentation register callback");
···11+# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
22+33+# dependencies
44+/node_modules
55+/.pnp
66+.pnp.*
77+.yarn/*
88+!.yarn/patches
99+!.yarn/plugins
1010+!.yarn/releases
1111+!.yarn/versions
1212+1313+# testing
1414+/coverage
1515+1616+# next.js
1717+/.next/
1818+/out/
1919+2020+# production
2121+/build
2222+2323+# misc
2424+.DS_Store
2525+*.pem
2626+2727+# debug
2828+npm-debug.log*
2929+yarn-debug.log*
3030+yarn-error.log*
3131+.pnpm-debug.log*
3232+3333+# env files (can opt-in for committing if needed)
3434+.env*
3535+3636+# vercel
3737+.vercel
3838+3939+# typescript
4040+*.tsbuildinfo
4141+next-env.d.ts
4242+4343+# wrangler
4444+.wrangler
4545+4646+# playwright
4747+/test-results/
4848+/playwright-report/
4949+/blob-report/
5050+/playwright/.cache/
+36
examples/playground16/README.md
···11+This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
22+33+## Getting Started
44+55+First, run the development server:
66+77+```bash
88+npm run dev
99+# or
1010+yarn dev
1111+# or
1212+pnpm dev
1313+# or
1414+bun dev
1515+```
1616+1717+Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
1818+1919+You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
2020+2121+This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
2222+2323+## Learn More
2424+2525+To learn more about Next.js, take a look at the following resources:
2626+2727+- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
2828+- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
2929+3030+You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
3131+3232+## Deploy on Vercel
3333+3434+The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
3535+3636+Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
···11+export function register() {
22+ // Note: we register instrumentation for both the nodejs and edge runtime, we do that using the NEXT_RUNTIME env
33+ // variable as recommended in the official docs:
44+ // https://nextjs.org/docs/app/building-your-application/optimizing/instrumentation#importing-runtime-specific-code
55+66+ const timeout = setTimeout(() => {
77+ console.log("This is a delayed log from the instrumentation register callback");
88+ }, 0);
99+1010+ if (process.env.NEXT_RUNTIME === "nodejs") {
1111+ globalThis["__NODEJS_INSTRUMENTATION_SETUP"] =
1212+ "this value has been set by calling the instrumentation `register` callback in the nodejs runtime";
1313+ // This is to test that we have access to the node version of setTimeout
1414+ timeout.unref();
1515+ clearTimeout(timeout);
1616+ }
1717+1818+ if (process.env.NEXT_RUNTIME === "edge") {
1919+ globalThis["__EDGE_INSTRUMENTATION_SETUP"] =
2020+ "this value has been set by calling the instrumentation `register` callback in the edge runtime";
2121+ }
2222+}