@vercel/next 3.0.4-canary.0 → 3.0.4-canary.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.
@@ -39,7 +39,8 @@ async function getNextjsEdgeFunctionSource(filePaths, params, outputDir, wasm) {
|
|
39
39
|
* We validate at this point because we want to verify against user code.
|
40
40
|
* It should not count the Worker wrapper nor the Next.js wrapper.
|
41
41
|
*/
|
42
|
-
|
42
|
+
const wasmFiles = (wasm ?? []).map(({ filePath }) => (0, path_1.join)(outputDir, filePath));
|
43
|
+
await validateSize(text, wasmFiles);
|
43
44
|
// Wrap to fake module.exports
|
44
45
|
const getPageMatchCode = `(function () {
|
45
46
|
const module = { exports: {}, loaded: false };
|
@@ -64,9 +65,14 @@ function getWasmImportStatements(wasm = []) {
|
|
64
65
|
})
|
65
66
|
.join('\n');
|
66
67
|
}
|
67
|
-
async function
|
68
|
+
async function validateSize(script, wasmFiles) {
|
69
|
+
const buffers = [Buffer.from(script, 'utf8')];
|
70
|
+
for (const filePath of wasmFiles) {
|
71
|
+
buffers.push(await (0, fs_extra_1.readFile)(filePath));
|
72
|
+
}
|
73
|
+
const content = Buffer.concat(buffers);
|
68
74
|
const gzipped = await gzip(content);
|
69
75
|
if (gzipped.length > constants_1.EDGE_FUNCTION_SIZE_LIMIT) {
|
70
|
-
throw new Error(`Exceeds maximum edge function
|
76
|
+
throw new Error(`Exceeds maximum edge function size: ${(0, pretty_bytes_1.default)(gzipped.length)} / ${(0, pretty_bytes_1.default)(constants_1.EDGE_FUNCTION_SIZE_LIMIT)}`);
|
71
77
|
}
|
72
78
|
}
|
package/dist/index.js
CHANGED
@@ -44781,7 +44781,8 @@ async function getNextjsEdgeFunctionSource(filePaths, params, outputDir, wasm) {
|
|
44781
44781
|
* We validate at this point because we want to verify against user code.
|
44782
44782
|
* It should not count the Worker wrapper nor the Next.js wrapper.
|
44783
44783
|
*/
|
44784
|
-
|
44784
|
+
const wasmFiles = (wasm ?? []).map(({ filePath }) => (0, path_1.join)(outputDir, filePath));
|
44785
|
+
await validateSize(text, wasmFiles);
|
44785
44786
|
// Wrap to fake module.exports
|
44786
44787
|
const getPageMatchCode = `(function () {
|
44787
44788
|
const module = { exports: {}, loaded: false };
|
@@ -44806,10 +44807,15 @@ function getWasmImportStatements(wasm = []) {
|
|
44806
44807
|
})
|
44807
44808
|
.join('\n');
|
44808
44809
|
}
|
44809
|
-
async function
|
44810
|
+
async function validateSize(script, wasmFiles) {
|
44811
|
+
const buffers = [Buffer.from(script, 'utf8')];
|
44812
|
+
for (const filePath of wasmFiles) {
|
44813
|
+
buffers.push(await (0, fs_extra_1.readFile)(filePath));
|
44814
|
+
}
|
44815
|
+
const content = Buffer.concat(buffers);
|
44810
44816
|
const gzipped = await gzip(content);
|
44811
44817
|
if (gzipped.length > constants_1.EDGE_FUNCTION_SIZE_LIMIT) {
|
44812
|
-
throw new Error(`Exceeds maximum edge function
|
44818
|
+
throw new Error(`Exceeds maximum edge function size: ${(0, pretty_bytes_1.default)(gzipped.length)} / ${(0, pretty_bytes_1.default)(constants_1.EDGE_FUNCTION_SIZE_LIMIT)}`);
|
44813
44819
|
}
|
44814
44820
|
}
|
44815
44821
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@vercel/next",
|
3
|
-
"version": "3.0.4-canary.
|
3
|
+
"version": "3.0.4-canary.1",
|
4
4
|
"license": "MIT",
|
5
5
|
"main": "./dist/index",
|
6
6
|
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",
|
@@ -70,5 +70,5 @@
|
|
70
70
|
"typescript": "4.5.2",
|
71
71
|
"webpack-sources": "3.2.3"
|
72
72
|
},
|
73
|
-
"gitHead": "
|
73
|
+
"gitHead": "50af9f5b75e518379bbba2b6dcba0330710b0425"
|
74
74
|
}
|