@netlify/plugin-nextjs
Advanced tools
Comparing version 5.0.0-rc.5 to 5.0.0-rc.6
@@ -10,3 +10,3 @@ | ||
copyPrerenderedContent | ||
} from "../../esm-chunks/chunk-VSH4JS2L.js"; | ||
} from "../../esm-chunks/chunk-75UGFPYW.js"; | ||
import "../../esm-chunks/chunk-VZNKO4OO.js"; | ||
@@ -13,0 +13,0 @@ import "../../esm-chunks/chunk-TYCYFZ22.js"; |
@@ -1,2 +0,7 @@ | ||
import tracing, { trace } from '{{cwd}}/.netlify/dist/run/handlers/tracing.js' | ||
import { | ||
createRequestContext, | ||
runWithRequestContext, | ||
} from '{{cwd}}/.netlify/dist/run/handlers/request-context.cjs' | ||
import { getTracer } from '{{cwd}}/.netlify/dist/run/handlers/tracer.cjs' | ||
import tracing from '{{cwd}}/.netlify/dist/run/handlers/tracing.js' | ||
@@ -11,6 +16,9 @@ process.chdir('{{cwd}}') | ||
/** @type {import('@opentelemetry/api').Tracer} */ | ||
const tracer = trace.getTracer('Next.js Runtime') | ||
return tracer.startActiveSpan('Next.js Server Handler', async (span) => { | ||
try { | ||
const requestContext = createRequestContext( | ||
req.headers.get('x-nf-debug-logging') || req.headers.get('x-next-debug-logging'), | ||
) | ||
const tracer = getTracer() | ||
const handlerResponse = await runWithRequestContext(requestContext, () => { | ||
return tracer.withActiveSpan('Next.js Server Handler', async (span) => { | ||
span.setAttributes({ | ||
@@ -35,12 +43,10 @@ 'account.id': context.account.id, | ||
return response | ||
} catch (error) { | ||
span.recordException(error) | ||
if (error instanceof Error) { | ||
span.addEvent({ name: error.name, message: error.message }) | ||
} | ||
throw error | ||
} finally { | ||
span.end() | ||
} | ||
}) | ||
}) | ||
if (requestContext.serverTiming) { | ||
handlerResponse.headers.set('server-timing', requestContext.serverTiming) | ||
} | ||
return handlerResponse | ||
} | ||
@@ -47,0 +53,0 @@ |
@@ -0,3 +1,8 @@ | ||
import { | ||
createRequestContext, | ||
runWithRequestContext, | ||
} from './.netlify/dist/run/handlers/request-context.cjs' | ||
import serverHandler from './.netlify/dist/run/handlers/server.js' | ||
import tracing, { trace } from './.netlify/dist/run/handlers/tracing.js' | ||
import { getTracer } from './.netlify/dist/run/handlers/tracer.cjs' | ||
import tracing from './.netlify/dist/run/handlers/tracing.js' | ||
@@ -8,7 +13,9 @@ export default async function handler(req, context) { | ||
} | ||
const requestContext = createRequestContext( | ||
req.headers.get('x-nf-debug-logging') || req.headers.get('x-next-debug-logging'), | ||
) | ||
const tracer = getTracer() | ||
/** @type {import('@opentelemetry/api').Tracer} */ | ||
const tracer = trace.getTracer('Next.js Runtime') | ||
return tracer.startActiveSpan('Next.js Server Handler', async (span) => { | ||
try { | ||
const handlerResponse = await runWithRequestContext(requestContext, () => { | ||
return tracer.withActiveSpan('Next.js Server Handler', async (span) => { | ||
span.setAttributes({ | ||
@@ -29,12 +36,10 @@ 'account.id': context.account.id, | ||
return response | ||
} catch (error) { | ||
span.recordException(error) | ||
if (error instanceof Error) { | ||
span.addEvent({ name: error.name, message: error.message }) | ||
} | ||
throw error | ||
} finally { | ||
span.end() | ||
} | ||
}) | ||
}) | ||
if (requestContext.serverTiming) { | ||
handlerResponse.headers.set('server-timing', requestContext.serverTiming) | ||
} | ||
return handlerResponse | ||
} | ||
@@ -41,0 +46,0 @@ |
@@ -9,3 +9,3 @@ | ||
copyPrerenderedContent | ||
} from "./esm-chunks/chunk-VSH4JS2L.js"; | ||
} from "./esm-chunks/chunk-75UGFPYW.js"; | ||
import { | ||
@@ -12,0 +12,0 @@ copyStaticAssets, |
@@ -13,3 +13,3 @@ | ||
setVaryHeaders | ||
} from "../esm-chunks/chunk-637Y3P2U.js"; | ||
} from "../esm-chunks/chunk-M2ZKGJAI.js"; | ||
import "../esm-chunks/chunk-TYCYFZ22.js"; | ||
@@ -16,0 +16,0 @@ import "../esm-chunks/chunk-5JVNISGM.js"; |
{ | ||
"name": "@netlify/plugin-nextjs", | ||
"version": "5.0.0-rc.5", | ||
"version": "5.0.0-rc.6", | ||
"description": "Run Next.js seamlessly on Netlify", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4570980
122948