Skip to content

Commit 34736c5

Browse files
committed
try without node?
1 parent ac6e277 commit 34736c5

File tree

4 files changed

+4
-18
lines changed

4 files changed

+4
-18
lines changed

analyze-wasm/build.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const result: {
1111
} = await transpile(fileURLToPath(new URL(name + ".wasm", folder)), {
1212
instantiation: "async",
1313
name,
14+
nodejsCompat: false,
1415
outDir: fileURLToPath(new URL(folder)),
1516
});
1617

analyze-wasm/wasm/arcjet_analyze_js_req.component.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -601,15 +601,7 @@ const I32_MAX = 2_147_483_647;
601601
const I32_MIN = -2_147_483_648;
602602
const _typeCheckValidI32 = (n) => typeof n === 'number' && n >= I32_MIN && n <= I32_MAX;
603603

604-
const isNode = typeof process !== 'undefined' && process.versions && process.versions.node;
605-
let _fs;
606-
async function fetchCompile (url) {
607-
if (isNode) {
608-
_fs = _fs || await import('node:fs/promises');
609-
return WebAssembly.compile(await _fs.readFile(url));
610-
}
611-
return fetch(url).then(WebAssembly.compileStreaming);
612-
}
604+
const fetchCompile = url => fetch(url).then(WebAssembly.compileStreaming);
613605

614606
class ComponentError extends Error {
615607
constructor (value) {

redact-wasm/build.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const result: {
1111
} = await transpile(fileURLToPath(new URL(name + ".wasm", folder)), {
1212
instantiation: "async",
1313
name,
14+
nodejsCompat: false,
1415
outDir: fileURLToPath(new URL(folder)),
1516
});
1617

redact-wasm/wasm/arcjet_analyze_bindings_redact.component.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -601,15 +601,7 @@ const I32_MAX = 2_147_483_647;
601601
const I32_MIN = -2_147_483_648;
602602
const _typeCheckValidI32 = (n) => typeof n === 'number' && n >= I32_MIN && n <= I32_MAX;
603603

604-
const isNode = typeof process !== 'undefined' && process.versions && process.versions.node;
605-
let _fs;
606-
async function fetchCompile (url) {
607-
if (isNode) {
608-
_fs = _fs || await import('node:fs/promises');
609-
return WebAssembly.compile(await _fs.readFile(url));
610-
}
611-
return fetch(url).then(WebAssembly.compileStreaming);
612-
}
604+
const fetchCompile = url => fetch(url).then(WebAssembly.compileStreaming);
613605

614606
class RepTable {
615607
#data = [0, null];

0 commit comments

Comments
 (0)