From 17fd61aa85874559d62e79c411326b612fcefa1e Mon Sep 17 00:00:00 2001 From: Thomas Hunter II Date: Thu, 21 Nov 2024 14:58:04 -0800 Subject: [PATCH 1/2] next.js: support v15.x (#4928) - support was actually functioning in the previous next.js 14.2.7 commit - this basically just enables testing and enables patching newer versions --- .github/workflows/appsec.yml | 2 +- .github/workflows/plugins.yml | 2 +- packages/datadog-instrumentations/src/next.js | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/appsec.yml b/.github/workflows/appsec.yml index 09b72e86e60..45edbde6ebc 100644 --- a/.github/workflows/appsec.yml +++ b/.github/workflows/appsec.yml @@ -210,7 +210,7 @@ jobs: version: - 18 - latest - range: ['9.5.0', '11.1.4', '13.2.0', '>=14.0.0 <=14.2.6', '>=14.2.7 <15'] + range: ['9.5.0', '11.1.4', '13.2.0', '>=14.0.0 <=14.2.6', '>=14.2.7 <15', '>=15.0.0'] runs-on: ubuntu-latest env: PLUGINS: next diff --git a/.github/workflows/plugins.yml b/.github/workflows/plugins.yml index 2ce02b3eca8..b9b4b387e4a 100644 --- a/.github/workflows/plugins.yml +++ b/.github/workflows/plugins.yml @@ -758,7 +758,7 @@ jobs: version: - 18 - latest - range: ['9.5.0', '11.1.4', '13.2.0', '>=14.0.0 <=14.2.6', '>=14.2.7 <15'] + range: ['9.5.0', '11.1.4', '13.2.0', '>=14.0.0 <=14.2.6', '>=14.2.7 <15', '>=15.0.0'] runs-on: ubuntu-latest env: PLUGINS: next diff --git a/packages/datadog-instrumentations/src/next.js b/packages/datadog-instrumentations/src/next.js index 3cba8d4a068..56ce695fe76 100644 --- a/packages/datadog-instrumentations/src/next.js +++ b/packages/datadog-instrumentations/src/next.js @@ -200,7 +200,7 @@ function finish (ctx, result, err) { // however, it is not provided as a class function or exported property addHook({ name: 'next', - versions: ['>=13.3.0 <15'], + versions: ['>=13.3.0'], file: 'dist/server/web/spec-extension/adapters/next-request.js' }, NextRequestAdapter => { shimmer.wrap(NextRequestAdapter.NextRequestAdapter, 'fromNodeNextRequest', fromNodeNextRequest => { @@ -215,7 +215,7 @@ addHook({ addHook({ name: 'next', - versions: ['>=11.1 <15'], + versions: ['>=11.1'], file: 'dist/server/serve-static.js' }, serveStatic => shimmer.wrap(serveStatic, 'serveStatic', wrapServeStatic)) @@ -225,7 +225,7 @@ addHook({ file: 'dist/next-server/server/serve-static.js' }, serveStatic => shimmer.wrap(serveStatic, 'serveStatic', wrapServeStatic)) -addHook({ name: 'next', versions: ['>=11.1 <15'], file: 'dist/server/next-server.js' }, nextServer => { +addHook({ name: 'next', versions: ['>=11.1'], file: 'dist/server/next-server.js' }, nextServer => { const Server = nextServer.default shimmer.wrap(Server.prototype, 'handleRequest', wrapHandleRequest) @@ -242,7 +242,7 @@ addHook({ name: 'next', versions: ['>=11.1 <15'], file: 'dist/server/next-server }) // `handleApiRequest` changes parameters/implementation at 13.2.0 -addHook({ name: 'next', versions: ['>=13.2 <15'], file: 'dist/server/next-server.js' }, nextServer => { +addHook({ name: 'next', versions: ['>=13.2'], file: 'dist/server/next-server.js' }, nextServer => { const Server = nextServer.default shimmer.wrap(Server.prototype, 'handleApiRequest', wrapHandleApiRequestWithMatch) return nextServer @@ -276,7 +276,7 @@ addHook({ addHook({ name: 'next', - versions: ['>=13 <15'], + versions: ['>=13'], file: 'dist/server/web/spec-extension/request.js' }, request => { const nextUrlDescriptor = Object.getOwnPropertyDescriptor(request.NextRequest.prototype, 'nextUrl') From 000d5ec7be27e13c8a1a39dc3205438892bcd87b Mon Sep 17 00:00:00 2001 From: Thomas Hunter II Date: Thu, 21 Nov 2024 15:05:45 -0800 Subject: [PATCH 2/2] v5.27.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9c67de94aa1..d9477b3cc79 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dd-trace", - "version": "5.27.0", + "version": "5.27.1", "description": "Datadog APM tracing client for JavaScript", "main": "index.js", "typings": "index.d.ts",