@netlify/plugin-nextjs 5.9.3 → 5.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build/content/prerendered.js +2 -2
- package/dist/build/content/static.js +2 -2
- package/dist/build/functions/edge.js +1 -1
- package/dist/esm-chunks/{chunk-BEIUVQZK.js → chunk-G3TOKXOX.js} +7 -1
- package/dist/esm-chunks/{chunk-HGXG447M.js → chunk-OAVVYSTW.js} +6 -21
- package/dist/esm-chunks/{package-MI2MBCHL.js → package-AJQOUMDK.js} +1 -1
- package/dist/index.js +12 -12
- package/dist/run/handlers/cache.cjs +1 -1
- package/dist/run/handlers/server.js +17 -15
- package/dist/run/handlers/tracing.js +1 -1
- package/dist/run/headers.js +2 -1
- package/edge-runtime/vendor.ts +0 -1
- package/package.json +1 -1
- package/dist/esm-chunks/{chunk-J4D25YDX.js → chunk-BVYZSEV6.js} +3 -3
- package/dist/esm-chunks/{chunk-NTLBFRPA.js → chunk-HWMLYAVP.js} +3 -3
- package/dist/esm-chunks/{next-H2VMRX5P.js → next-37W7QRMR.js} +3 -3
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
import {
|
|
8
8
|
copyFetchContent,
|
|
9
9
|
copyPrerenderedContent
|
|
10
|
-
} from "../../esm-chunks/chunk-
|
|
10
|
+
} from "../../esm-chunks/chunk-BVYZSEV6.js";
|
|
11
|
+
import "../../esm-chunks/chunk-TYCYFZ22.js";
|
|
11
12
|
import "../../esm-chunks/chunk-5QSXBV7L.js";
|
|
12
13
|
import "../../esm-chunks/chunk-GNGHTHMQ.js";
|
|
13
14
|
import "../../esm-chunks/chunk-ZSVHJNNY.js";
|
|
14
15
|
import "../../esm-chunks/chunk-KGYJQ2U2.js";
|
|
15
16
|
import "../../esm-chunks/chunk-ZENB67PD.js";
|
|
16
17
|
import "../../esm-chunks/chunk-APO262HE.js";
|
|
17
|
-
import "../../esm-chunks/chunk-TYCYFZ22.js";
|
|
18
18
|
import "../../esm-chunks/chunk-OEQOKJGE.js";
|
|
19
19
|
export {
|
|
20
20
|
copyFetchContent,
|
|
@@ -10,14 +10,14 @@ import {
|
|
|
10
10
|
copyStaticExport,
|
|
11
11
|
publishStaticDir,
|
|
12
12
|
unpublishStaticDir
|
|
13
|
-
} from "../../esm-chunks/chunk-
|
|
13
|
+
} from "../../esm-chunks/chunk-HWMLYAVP.js";
|
|
14
|
+
import "../../esm-chunks/chunk-TYCYFZ22.js";
|
|
14
15
|
import "../../esm-chunks/chunk-5QSXBV7L.js";
|
|
15
16
|
import "../../esm-chunks/chunk-GNGHTHMQ.js";
|
|
16
17
|
import "../../esm-chunks/chunk-ZSVHJNNY.js";
|
|
17
18
|
import "../../esm-chunks/chunk-KGYJQ2U2.js";
|
|
18
19
|
import "../../esm-chunks/chunk-ZENB67PD.js";
|
|
19
20
|
import "../../esm-chunks/chunk-APO262HE.js";
|
|
20
|
-
import "../../esm-chunks/chunk-TYCYFZ22.js";
|
|
21
21
|
import "../../esm-chunks/chunk-OEQOKJGE.js";
|
|
22
22
|
export {
|
|
23
23
|
copyStaticAssets,
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import {
|
|
8
8
|
clearStaleEdgeHandlers,
|
|
9
9
|
createEdgeHandlers
|
|
10
|
-
} from "../../esm-chunks/chunk-
|
|
10
|
+
} from "../../esm-chunks/chunk-OAVVYSTW.js";
|
|
11
11
|
import "../../esm-chunks/chunk-GFYWJNQR.js";
|
|
12
12
|
import "../../esm-chunks/chunk-KGYJQ2U2.js";
|
|
13
13
|
import "../../esm-chunks/chunk-APO262HE.js";
|
|
@@ -7,6 +7,9 @@
|
|
|
7
7
|
import {
|
|
8
8
|
getRegionalBlobStore
|
|
9
9
|
} from "./chunk-K4RDUZYO.js";
|
|
10
|
+
import {
|
|
11
|
+
getLogger
|
|
12
|
+
} from "./chunk-LVXJQ2G2.js";
|
|
10
13
|
import {
|
|
11
14
|
encodeBlobKey
|
|
12
15
|
} from "./chunk-TYCYFZ22.js";
|
|
@@ -145,7 +148,7 @@ var adjustDateHeader = async ({
|
|
|
145
148
|
headers.set("x-nextjs-date", headers.get("date") ?? lastModifiedDate.toUTCString());
|
|
146
149
|
headers.set("date", lastModifiedDate.toUTCString());
|
|
147
150
|
};
|
|
148
|
-
var setCacheControlHeaders = ({ headers, status }, request, requestContext) => {
|
|
151
|
+
var setCacheControlHeaders = ({ headers, status }, request, requestContext, nextConfig) => {
|
|
149
152
|
if (typeof requestContext.routeHandlerRevalidate !== "undefined" && ["GET", "HEAD"].includes(request.method) && !headers.has("cdn-cache-control") && !headers.has("netlify-cdn-cache-control")) {
|
|
150
153
|
const cdnCacheControl = (
|
|
151
154
|
// if we are serving already stale response, instruct edge to not attempt to cache that response
|
|
@@ -154,6 +157,9 @@ var setCacheControlHeaders = ({ headers, status }, request, requestContext) => {
|
|
|
154
157
|
headers.set("netlify-cdn-cache-control", cdnCacheControl);
|
|
155
158
|
return;
|
|
156
159
|
}
|
|
160
|
+
if (status === 308 && request.url.endsWith("/") !== nextConfig.trailingSlash) {
|
|
161
|
+
getLogger().withFields({ trailingSlash: nextConfig.trailingSlash, location: headers.get("location") }).log("NetlifyHeadersHandler.trailingSlashRedirect");
|
|
162
|
+
}
|
|
157
163
|
if (status === 404 && request.url.endsWith(".php")) {
|
|
158
164
|
headers.set("cache-control", "public, max-age=0, must-revalidate");
|
|
159
165
|
headers.set("netlify-cdn-cache-control", `max-age=31536000, durable`);
|
|
@@ -409,9 +409,7 @@ var require_dist = __commonJS({
|
|
|
409
409
|
var import_fast_glob = __toESM(require_out(), 1);
|
|
410
410
|
var import_path_to_regexp = __toESM(require_dist(), 1);
|
|
411
411
|
import { cp, mkdir, readFile, rm, writeFile } from "node:fs/promises";
|
|
412
|
-
import { dirname, join
|
|
413
|
-
import { sep as posixSep } from "node:path/posix";
|
|
414
|
-
var toPosixPath = (path) => path.split(sep).join(posixSep);
|
|
412
|
+
import { dirname, join } from "node:path";
|
|
415
413
|
var writeEdgeManifest = async (ctx, manifest) => {
|
|
416
414
|
await mkdir(ctx.edgeFunctionsDir, { recursive: true });
|
|
417
415
|
await writeFile(join(ctx.edgeFunctionsDir, "manifest.json"), JSON.stringify(manifest, null, 2));
|
|
@@ -471,14 +469,13 @@ var writeHandlerFile = async (ctx, { matchers, name }) => {
|
|
|
471
469
|
await writeFile(
|
|
472
470
|
join(handlerDirectory, `${handlerName}.js`),
|
|
473
471
|
`
|
|
474
|
-
import { decode as _base64Decode } from './edge-runtime/vendor/deno.land/std@0.175.0/encoding/base64.ts';
|
|
475
472
|
import { init as htmlRewriterInit } from './edge-runtime/vendor/deno.land/x/htmlrewriter@v1.0.0/src/index.ts'
|
|
476
|
-
import {handleMiddleware} from './edge-runtime/middleware.ts';
|
|
473
|
+
import { handleMiddleware } from './edge-runtime/middleware.ts';
|
|
477
474
|
import handler from './server/${name}.js';
|
|
478
475
|
|
|
479
|
-
await htmlRewriterInit({ module_or_path:
|
|
480
|
-
htmlRewriterWasm
|
|
481
|
-
)})
|
|
476
|
+
await htmlRewriterInit({ module_or_path: Uint8Array.from(${JSON.stringify([
|
|
477
|
+
...htmlRewriterWasm
|
|
478
|
+
])}) });
|
|
482
479
|
|
|
483
480
|
export default (req, context) => handleMiddleware(req, context, handler);
|
|
484
481
|
`
|
|
@@ -493,21 +490,9 @@ var copyHandlerDependencies = async (ctx, { name, files, wasm }) => {
|
|
|
493
490
|
const parts = [shim];
|
|
494
491
|
const outputFile = join(destDir, `server/${name}.js`);
|
|
495
492
|
if (wasm?.length) {
|
|
496
|
-
const base64ModulePath = join(
|
|
497
|
-
destDir,
|
|
498
|
-
"edge-runtime/vendor/deno.land/std@0.175.0/encoding/base64.ts"
|
|
499
|
-
);
|
|
500
|
-
const base64ModulePathRelativeToOutputFile = toPosixPath(
|
|
501
|
-
relative(dirname(outputFile), base64ModulePath)
|
|
502
|
-
);
|
|
503
|
-
parts.push(`import { decode as _base64Decode } from "${base64ModulePathRelativeToOutputFile}";`);
|
|
504
493
|
for (const wasmChunk of wasm ?? []) {
|
|
505
494
|
const data = await readFile(join(srcDir, wasmChunk.filePath));
|
|
506
|
-
parts.push(
|
|
507
|
-
`const ${wasmChunk.name} = _base64Decode(${JSON.stringify(
|
|
508
|
-
data.toString("base64")
|
|
509
|
-
)}).buffer`
|
|
510
|
-
);
|
|
495
|
+
parts.push(`const ${wasmChunk.name} = Uint8Array.from(${JSON.stringify([...data])})`);
|
|
511
496
|
}
|
|
512
497
|
}
|
|
513
498
|
for (const file of files) {
|
package/dist/index.js
CHANGED
|
@@ -4,25 +4,26 @@
|
|
|
4
4
|
return createRequire(import.meta.url);
|
|
5
5
|
})();
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
clearStaleEdgeHandlers,
|
|
9
|
-
createEdgeHandlers
|
|
10
|
-
} from "./esm-chunks/chunk-HGXG447M.js";
|
|
11
|
-
import {
|
|
12
|
-
clearStaleServerHandlers,
|
|
13
|
-
createServerHandler
|
|
14
|
-
} from "./esm-chunks/chunk-DLVROEVU.js";
|
|
15
7
|
import {
|
|
16
8
|
copyPrerenderedContent
|
|
17
|
-
} from "./esm-chunks/chunk-
|
|
18
|
-
import "./esm-chunks/chunk-IJZEDP6B.js";
|
|
9
|
+
} from "./esm-chunks/chunk-BVYZSEV6.js";
|
|
19
10
|
import {
|
|
20
11
|
copyStaticAssets,
|
|
21
12
|
copyStaticContent,
|
|
22
13
|
copyStaticExport,
|
|
23
14
|
publishStaticDir,
|
|
24
15
|
unpublishStaticDir
|
|
25
|
-
} from "./esm-chunks/chunk-
|
|
16
|
+
} from "./esm-chunks/chunk-HWMLYAVP.js";
|
|
17
|
+
import "./esm-chunks/chunk-TYCYFZ22.js";
|
|
18
|
+
import {
|
|
19
|
+
clearStaleEdgeHandlers,
|
|
20
|
+
createEdgeHandlers
|
|
21
|
+
} from "./esm-chunks/chunk-OAVVYSTW.js";
|
|
22
|
+
import {
|
|
23
|
+
clearStaleServerHandlers,
|
|
24
|
+
createServerHandler
|
|
25
|
+
} from "./esm-chunks/chunk-DLVROEVU.js";
|
|
26
|
+
import "./esm-chunks/chunk-IJZEDP6B.js";
|
|
26
27
|
import {
|
|
27
28
|
wrapTracer
|
|
28
29
|
} from "./esm-chunks/chunk-5QSXBV7L.js";
|
|
@@ -48,7 +49,6 @@ import {
|
|
|
48
49
|
import "./esm-chunks/chunk-KGYJQ2U2.js";
|
|
49
50
|
import "./esm-chunks/chunk-ZENB67PD.js";
|
|
50
51
|
import "./esm-chunks/chunk-APO262HE.js";
|
|
51
|
-
import "./esm-chunks/chunk-TYCYFZ22.js";
|
|
52
52
|
import "./esm-chunks/chunk-UYKENJEU.js";
|
|
53
53
|
import "./esm-chunks/chunk-OEQOKJGE.js";
|
|
54
54
|
|
|
@@ -203,7 +203,7 @@ var import_constants = require("next/dist/lib/constants.js");
|
|
|
203
203
|
|
|
204
204
|
// package.json
|
|
205
205
|
var name = "@netlify/plugin-nextjs";
|
|
206
|
-
var version = "5.9.
|
|
206
|
+
var version = "5.9.4";
|
|
207
207
|
|
|
208
208
|
// src/shared/cache-types.cts
|
|
209
209
|
var isCachedPageValue = (value) => value.kind === "PAGE" || value.kind === "PAGES";
|
|
@@ -7,25 +7,25 @@
|
|
|
7
7
|
import {
|
|
8
8
|
getTracer
|
|
9
9
|
} from "../../esm-chunks/chunk-NEZW7TGG.js";
|
|
10
|
-
import {
|
|
11
|
-
createRequestContext,
|
|
12
|
-
getLogger,
|
|
13
|
-
getRequestContext
|
|
14
|
-
} from "../../esm-chunks/chunk-LVXJQ2G2.js";
|
|
15
10
|
import {
|
|
16
11
|
adjustDateHeader,
|
|
17
12
|
setCacheControlHeaders,
|
|
18
13
|
setCacheStatusHeader,
|
|
19
14
|
setCacheTagsHeaders,
|
|
20
15
|
setVaryHeaders
|
|
21
|
-
} from "../../esm-chunks/chunk-
|
|
16
|
+
} from "../../esm-chunks/chunk-G3TOKXOX.js";
|
|
22
17
|
import "../../esm-chunks/chunk-K4RDUZYO.js";
|
|
18
|
+
import {
|
|
19
|
+
createRequestContext,
|
|
20
|
+
getLogger,
|
|
21
|
+
getRequestContext
|
|
22
|
+
} from "../../esm-chunks/chunk-LVXJQ2G2.js";
|
|
23
23
|
import {
|
|
24
24
|
nextResponseProxy
|
|
25
25
|
} from "../../esm-chunks/chunk-XS27YRA5.js";
|
|
26
|
+
import "../../esm-chunks/chunk-TYCYFZ22.js";
|
|
26
27
|
import "../../esm-chunks/chunk-5QSXBV7L.js";
|
|
27
28
|
import "../../esm-chunks/chunk-GNGHTHMQ.js";
|
|
28
|
-
import "../../esm-chunks/chunk-TYCYFZ22.js";
|
|
29
29
|
import {
|
|
30
30
|
__commonJS,
|
|
31
31
|
__toESM
|
|
@@ -3124,7 +3124,7 @@ function setupWaitUntil() {
|
|
|
3124
3124
|
}
|
|
3125
3125
|
|
|
3126
3126
|
// src/run/handlers/server.ts
|
|
3127
|
-
var nextImportPromise = import("../../esm-chunks/next-
|
|
3127
|
+
var nextImportPromise = import("../../esm-chunks/next-37W7QRMR.js");
|
|
3128
3128
|
setupWaitUntil();
|
|
3129
3129
|
var nextHandler;
|
|
3130
3130
|
var nextConfig;
|
|
@@ -3185,21 +3185,23 @@ var server_default = async (request) => {
|
|
|
3185
3185
|
span.setAttribute("responseCacheKey", requestContext.responseCacheKey);
|
|
3186
3186
|
}
|
|
3187
3187
|
await adjustDateHeader({ headers: response.headers, request, span, tracer, requestContext });
|
|
3188
|
-
setCacheControlHeaders(response, request, requestContext);
|
|
3188
|
+
setCacheControlHeaders(response, request, requestContext, nextConfig);
|
|
3189
3189
|
setCacheTagsHeaders(response.headers, requestContext);
|
|
3190
3190
|
setVaryHeaders(response.headers, request, nextConfig);
|
|
3191
3191
|
setCacheStatusHeader(response.headers);
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3192
|
+
async function waitForBackgroundWork() {
|
|
3193
|
+
await nextHandlerPromise;
|
|
3194
|
+
res.emit("close");
|
|
3195
|
+
await requestContext.backgroundWorkPromise;
|
|
3195
3196
|
}
|
|
3196
3197
|
const keepOpenUntilNextFullyRendered = new TransformStream({
|
|
3197
3198
|
async flush() {
|
|
3198
|
-
await
|
|
3199
|
-
res.emit("close");
|
|
3200
|
-
await requestContext.backgroundWorkPromise;
|
|
3199
|
+
await waitForBackgroundWork();
|
|
3201
3200
|
}
|
|
3202
3201
|
});
|
|
3202
|
+
if (!response.body) {
|
|
3203
|
+
await waitForBackgroundWork();
|
|
3204
|
+
}
|
|
3203
3205
|
return new Response(response.body?.pipeThrough(keepOpenUntilNextFullyRendered), response);
|
|
3204
3206
|
});
|
|
3205
3207
|
};
|
|
@@ -68868,7 +68868,7 @@ var import_sdk_trace_node = __toESM(require_src20(), 1);
|
|
|
68868
68868
|
var import_semantic_conventions = __toESM(require_src(), 1);
|
|
68869
68869
|
var {
|
|
68870
68870
|
default: { version, name }
|
|
68871
|
-
} = await import("../../esm-chunks/package-
|
|
68871
|
+
} = await import("../../esm-chunks/package-AJQOUMDK.js");
|
|
68872
68872
|
var sdk = new import_sdk_node.NodeSDK({
|
|
68873
68873
|
resource: new import_resources.Resource({
|
|
68874
68874
|
[import_semantic_conventions.SEMRESATTRS_SERVICE_NAME]: name,
|
package/dist/run/headers.js
CHANGED
|
@@ -10,8 +10,9 @@ import {
|
|
|
10
10
|
setCacheStatusHeader,
|
|
11
11
|
setCacheTagsHeaders,
|
|
12
12
|
setVaryHeaders
|
|
13
|
-
} from "../esm-chunks/chunk-
|
|
13
|
+
} from "../esm-chunks/chunk-G3TOKXOX.js";
|
|
14
14
|
import "../esm-chunks/chunk-K4RDUZYO.js";
|
|
15
|
+
import "../esm-chunks/chunk-LVXJQ2G2.js";
|
|
15
16
|
import "../esm-chunks/chunk-TYCYFZ22.js";
|
|
16
17
|
import "../esm-chunks/chunk-OEQOKJGE.js";
|
|
17
18
|
export {
|
package/edge-runtime/vendor.ts
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
// It acts as a seed that populates the `vendor/` directory and should not be
|
|
3
3
|
// imported directly.
|
|
4
4
|
|
|
5
|
-
import 'https://deno.land/std@0.175.0/encoding/base64.ts'
|
|
6
5
|
import 'https://deno.land/std@0.175.0/http/cookie.ts'
|
|
7
6
|
import 'https://deno.land/std@0.175.0/node/buffer.ts'
|
|
8
7
|
import 'https://deno.land/std@0.175.0/node/events.ts'
|
package/package.json
CHANGED
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
return createRequire(import.meta.url);
|
|
5
5
|
})();
|
|
6
6
|
|
|
7
|
+
import {
|
|
8
|
+
encodeBlobKey
|
|
9
|
+
} from "./chunk-TYCYFZ22.js";
|
|
7
10
|
import {
|
|
8
11
|
wrapTracer
|
|
9
12
|
} from "./chunk-5QSXBV7L.js";
|
|
@@ -20,9 +23,6 @@ import {
|
|
|
20
23
|
import {
|
|
21
24
|
require_semver
|
|
22
25
|
} from "./chunk-APO262HE.js";
|
|
23
|
-
import {
|
|
24
|
-
encodeBlobKey
|
|
25
|
-
} from "./chunk-TYCYFZ22.js";
|
|
26
26
|
import {
|
|
27
27
|
__toESM
|
|
28
28
|
} from "./chunk-OEQOKJGE.js";
|
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
return createRequire(import.meta.url);
|
|
5
5
|
})();
|
|
6
6
|
|
|
7
|
+
import {
|
|
8
|
+
encodeBlobKey
|
|
9
|
+
} from "./chunk-TYCYFZ22.js";
|
|
7
10
|
import {
|
|
8
11
|
wrapTracer
|
|
9
12
|
} from "./chunk-5QSXBV7L.js";
|
|
@@ -17,9 +20,6 @@ import {
|
|
|
17
20
|
import {
|
|
18
21
|
require_out
|
|
19
22
|
} from "./chunk-KGYJQ2U2.js";
|
|
20
|
-
import {
|
|
21
|
-
encodeBlobKey
|
|
22
|
-
} from "./chunk-TYCYFZ22.js";
|
|
23
23
|
import {
|
|
24
24
|
__toESM
|
|
25
25
|
} from "./chunk-OEQOKJGE.js";
|
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
import {
|
|
8
8
|
getTracer
|
|
9
9
|
} from "./chunk-NEZW7TGG.js";
|
|
10
|
-
import {
|
|
11
|
-
getRequestContext
|
|
12
|
-
} from "./chunk-LVXJQ2G2.js";
|
|
13
10
|
import {
|
|
14
11
|
getRegionalBlobStore
|
|
15
12
|
} from "./chunk-K4RDUZYO.js";
|
|
13
|
+
import {
|
|
14
|
+
getRequestContext
|
|
15
|
+
} from "./chunk-LVXJQ2G2.js";
|
|
16
16
|
import "./chunk-5QSXBV7L.js";
|
|
17
17
|
import "./chunk-GNGHTHMQ.js";
|
|
18
18
|
import {
|