@netlify/plugin-nextjs 4.41.4 → 4.41.6
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/lib/templates/vendor.js +1 -1
- package/package.json +2 -2
- package/src/templates/edge/shims.js +3 -2
- package/src/templates/edge-shared/html-rewriter-wasm.ts +24 -0
- package/src/templates/edge-shared/utils.ts +42 -34
- package/src/templates/vendor/deno.land/x/htmlrewriter@v1.0.0/pkg/htmlrewriter.js +1218 -0
- package/src/templates/vendor/deno.land/x/htmlrewriter@v1.0.0/src/index.ts +80 -0
- package/src/templates/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/src/templates/vendor/import_map.json +1 -3
- package/src/templates/vendor/deno.land/std@0.134.0/fmt/colors.ts +0 -536
- package/src/templates/vendor/deno.land/std@0.134.0/testing/_diff.ts +0 -360
- package/src/templates/vendor/deno.land/std@0.134.0/testing/asserts.ts +0 -866
- package/src/templates/vendor/deno.land/x/html_rewriter@v0.1.0-pre.17/index.ts +0 -133
- package/src/templates/vendor/deno.land/x/html_rewriter@v0.1.0-pre.17/vendor/asyncify.js +0 -112
- package/src/templates/vendor/deno.land/x/html_rewriter@v0.1.0-pre.17/vendor/html_rewriter.js +0 -974
- package/src/templates/vendor/raw.githubusercontent.com/worker-tools/resolvable-promise/master/index.ts +0 -50
package/lib/templates/vendor.js
CHANGED
|
@@ -15,6 +15,6 @@ require("https://deno.land/std@0.175.0/node/assert.ts");
|
|
|
15
15
|
require("https://deno.land/std@0.175.0/node/util.ts");
|
|
16
16
|
require("https://deno.land/std@0.175.0/path/mod.ts");
|
|
17
17
|
require("https://deno.land/x/path_to_regexp@v6.2.1/index.ts");
|
|
18
|
-
require("https://deno.land/x/
|
|
18
|
+
require("https://deno.land/x/htmlrewriter@v1.0.0/src/index.ts");
|
|
19
19
|
require("https://esm.sh/v91/next@12.2.5/deno/dist/server/web/spec-extension/request.js");
|
|
20
20
|
require("https://esm.sh/v91/next@12.2.5/deno/dist/server/web/spec-extension/response.js");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netlify/plugin-nextjs",
|
|
3
|
-
"version": "4.41.
|
|
3
|
+
"version": "4.41.6",
|
|
4
4
|
"description": "Run Next.js seamlessly on Netlify",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"files": [
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"publish:test": "cd .. && npm ci && npm test",
|
|
56
56
|
"clean": "rimraf lib dist-types",
|
|
57
57
|
"build": "run-s build:*",
|
|
58
|
-
"build:vendor": "rimraf src/templates/vendor && curl -fsSL https://deno.land/x/install/install.sh | DENO_INSTALL=./.deno sh -s v1.46.3 && DENO_NO_PACKAGE_JSON=1 ./.deno/bin/deno vendor src/templates/vendor.ts --output=src/templates/vendor && node patch-import-map.mjs &&
|
|
58
|
+
"build:vendor": "rimraf src/templates/vendor && curl -fsSL https://deno.land/x/install/install.sh | DENO_INSTALL=./.deno sh -s v1.46.3 && DENO_NO_PACKAGE_JSON=1 ./.deno/bin/deno vendor src/templates/vendor.ts --output=src/templates/vendor && node patch-import-map.mjs && node generate-html-rewriter-wasm-module.mjs",
|
|
59
59
|
"build:tsc": "tsc",
|
|
60
60
|
"watch": "tsc --watch",
|
|
61
61
|
"prepare": "npm run build"
|
|
@@ -37,7 +37,8 @@ if (!('getAll' in Headers.prototype)) {
|
|
|
37
37
|
}
|
|
38
38
|
// Next uses blob: urls to refer to local assets, so we need to intercept these
|
|
39
39
|
const _fetch = globalThis.fetch
|
|
40
|
-
|
|
40
|
+
/* type {typeof globalThis.fetch} */
|
|
41
|
+
globalThis.fetch = async function fetch (url, init) {
|
|
41
42
|
try {
|
|
42
43
|
if (url instanceof URL && url.href?.startsWith('blob:')) {
|
|
43
44
|
const key = url.href.slice(5)
|
|
@@ -74,4 +75,4 @@ if (typeof require === 'undefined') {
|
|
|
74
75
|
|
|
75
76
|
// Next edge runtime uses "self" as a function-scoped global-like object, but some of the older polyfills expect it to equal globalThis
|
|
76
77
|
// See https://nextjs.org/docs/basic-features/supported-browsers-features#polyfills
|
|
77
|
-
|
|
78
|
+
globalThis.self = { ...globalThis, fetch }
|