@netlify/plugin-nextjs 5.9.0 → 5.9.1
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/functions/edge.js +1 -1
- package/dist/esm-chunks/{chunk-BFYMHE3E.js → chunk-HGXG447M.js} +13 -0
- package/dist/esm-chunks/{package-LCNINN36.js → package-BD57IC76.js} +1 -1
- package/dist/index.js +9 -9
- package/dist/run/handlers/tracing.js +1 -1
- package/edge-runtime/lib/middleware.ts +1 -1
- package/edge-runtime/lib/response.ts +5 -2
- package/edge-runtime/vendor/deno.land/x/htmlrewriter@v1.0.0/pkg/htmlrewriter.js +1218 -0
- package/edge-runtime/vendor/deno.land/x/htmlrewriter@v1.0.0/pkg/htmlrewriter_bg.wasm +0 -0
- package/edge-runtime/vendor/deno.land/x/htmlrewriter@v1.0.0/src/index.ts +80 -0
- package/edge-runtime/vendor/deno.land/x/{html_rewriter@v0.1.0-pre.17/vendor/html_rewriter.d.ts → htmlrewriter@v1.0.0/src/types.d.ts} +8 -25
- package/edge-runtime/vendor/import_map.json +0 -2
- package/edge-runtime/vendor.ts +1 -1
- package/package.json +1 -1
- package/edge-runtime/vendor/deno.land/std@0.134.0/fmt/colors.ts +0 -536
- package/edge-runtime/vendor/deno.land/std@0.134.0/testing/_diff.ts +0 -360
- package/edge-runtime/vendor/deno.land/std@0.134.0/testing/asserts.ts +0 -866
- package/edge-runtime/vendor/deno.land/x/html_rewriter@v0.1.0-pre.17/index.ts +0 -133
- package/edge-runtime/vendor/deno.land/x/html_rewriter@v0.1.0-pre.17/vendor/asyncify.js +0 -112
- package/edge-runtime/vendor/deno.land/x/html_rewriter@v0.1.0-pre.17/vendor/html_rewriter.js +0 -974
- package/edge-runtime/vendor/raw.githubusercontent.com/worker-tools/resolvable-promise/master/index.ts +0 -50
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import {
|
|
8
8
|
clearStaleEdgeHandlers,
|
|
9
9
|
createEdgeHandlers
|
|
10
|
-
} from "../../esm-chunks/chunk-
|
|
10
|
+
} from "../../esm-chunks/chunk-HGXG447M.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";
|
|
@@ -462,11 +462,24 @@ var writeHandlerFile = async (ctx, { matchers, name }) => {
|
|
|
462
462
|
join(handlerRuntimeDirectory, "next.config.json"),
|
|
463
463
|
JSON.stringify(minimalNextConfig)
|
|
464
464
|
);
|
|
465
|
+
const htmlRewriterWasm = await readFile(
|
|
466
|
+
join(
|
|
467
|
+
ctx.pluginDir,
|
|
468
|
+
"edge-runtime/vendor/deno.land/x/htmlrewriter@v1.0.0/pkg/htmlrewriter_bg.wasm"
|
|
469
|
+
)
|
|
470
|
+
);
|
|
465
471
|
await writeFile(
|
|
466
472
|
join(handlerDirectory, `${handlerName}.js`),
|
|
467
473
|
`
|
|
474
|
+
import { decode as _base64Decode } from './edge-runtime/vendor/deno.land/std@0.175.0/encoding/base64.ts';
|
|
475
|
+
import { init as htmlRewriterInit } from './edge-runtime/vendor/deno.land/x/htmlrewriter@v1.0.0/src/index.ts'
|
|
468
476
|
import {handleMiddleware} from './edge-runtime/middleware.ts';
|
|
469
477
|
import handler from './server/${name}.js';
|
|
478
|
+
|
|
479
|
+
await htmlRewriterInit({ module_or_path: _base64Decode(${JSON.stringify(
|
|
480
|
+
htmlRewriterWasm.toString("base64")
|
|
481
|
+
)}).buffer });
|
|
482
|
+
|
|
470
483
|
export default (req, context) => handleMiddleware(req, context, handler);
|
|
471
484
|
`
|
|
472
485
|
);
|
package/dist/index.js
CHANGED
|
@@ -4,18 +4,9 @@
|
|
|
4
4
|
return createRequire(import.meta.url);
|
|
5
5
|
})();
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
clearStaleEdgeHandlers,
|
|
9
|
-
createEdgeHandlers
|
|
10
|
-
} from "./esm-chunks/chunk-BFYMHE3E.js";
|
|
11
|
-
import {
|
|
12
|
-
clearStaleServerHandlers,
|
|
13
|
-
createServerHandler
|
|
14
|
-
} from "./esm-chunks/chunk-DLVROEVU.js";
|
|
15
7
|
import {
|
|
16
8
|
copyPrerenderedContent
|
|
17
9
|
} from "./esm-chunks/chunk-BVYZSEV6.js";
|
|
18
|
-
import "./esm-chunks/chunk-IJZEDP6B.js";
|
|
19
10
|
import {
|
|
20
11
|
copyStaticAssets,
|
|
21
12
|
copyStaticContent,
|
|
@@ -24,6 +15,15 @@ import {
|
|
|
24
15
|
unpublishStaticDir
|
|
25
16
|
} from "./esm-chunks/chunk-HWMLYAVP.js";
|
|
26
17
|
import "./esm-chunks/chunk-TYCYFZ22.js";
|
|
18
|
+
import {
|
|
19
|
+
clearStaleEdgeHandlers,
|
|
20
|
+
createEdgeHandlers
|
|
21
|
+
} from "./esm-chunks/chunk-HGXG447M.js";
|
|
22
|
+
import {
|
|
23
|
+
clearStaleServerHandlers,
|
|
24
|
+
createServerHandler
|
|
25
|
+
} from "./esm-chunks/chunk-DLVROEVU.js";
|
|
26
|
+
import "./esm-chunks/chunk-IJZEDP6B.js";
|
|
27
27
|
import {
|
|
28
28
|
wrapTracer
|
|
29
29
|
} from "./esm-chunks/chunk-5QSXBV7L.js";
|
|
@@ -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-BD57IC76.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,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Context } from '@netlify/edge-functions'
|
|
2
2
|
|
|
3
|
-
import { ElementHandlers } from '../vendor/deno.land/x/
|
|
3
|
+
import type { ElementHandlers } from '../vendor/deno.land/x/htmlrewriter@v1.0.0/src/index.ts'
|
|
4
4
|
|
|
5
5
|
type NextDataTransform = <T>(data: T) => T
|
|
6
6
|
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { Context } from '@netlify/edge-functions'
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
HTMLRewriter,
|
|
4
|
+
type TextChunk,
|
|
5
|
+
} from '../vendor/deno.land/x/htmlrewriter@v1.0.0/src/index.ts'
|
|
3
6
|
|
|
4
7
|
import { updateModifiedHeaders } from './headers.ts'
|
|
5
8
|
import type { StructuredLogger } from './logging.ts'
|
|
@@ -79,7 +82,7 @@ export const buildResponse = async ({
|
|
|
79
82
|
|
|
80
83
|
if (response.dataTransforms.length > 0) {
|
|
81
84
|
rewriter.on('script[id="__NEXT_DATA__"]', {
|
|
82
|
-
text(textChunk) {
|
|
85
|
+
text(textChunk: TextChunk) {
|
|
83
86
|
// Grab all the chunks in the Next data script tag
|
|
84
87
|
buffer += textChunk.text
|
|
85
88
|
if (textChunk.lastInTextNode) {
|