Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4a95d5e

Browse filesBrowse files
committed
fix: use uint8array for user's wasm modules used in middleware instead of base64
1 parent 25f6f30 commit 4a95d5e
Copy full SHA for 4a95d5e

File tree

Expand file treeCollapse file tree

2 files changed

+1
-16
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+1
-16
lines changed
Open diff view settings
Collapse file

‎edge-runtime/vendor.ts‎

Copy file name to clipboardExpand all lines: edge-runtime/vendor.ts
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// It acts as a seed that populates the `vendor/` directory and should not be
33
// imported directly.
44

5-
import 'https://deno.land/std@0.175.0/encoding/base64.ts'
65
import 'https://deno.land/std@0.175.0/http/cookie.ts'
76
import 'https://deno.land/std@0.175.0/node/buffer.ts'
87
import 'https://deno.land/std@0.175.0/node/events.ts'
Collapse file

‎src/build/functions/edge.ts‎

Copy file name to clipboardExpand all lines: src/build/functions/edge.ts
+1-15Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -126,23 +126,9 @@ const copyHandlerDependencies = async (
126126
const outputFile = join(destDir, `server/${name}.js`)
127127

128128
if (wasm?.length) {
129-
const base64ModulePath = join(
130-
destDir,
131-
'edge-runtime/vendor/deno.land/std@0.175.0/encoding/base64.ts',
132-
)
133-
134-
const base64ModulePathRelativeToOutputFile = toPosixPath(
135-
relative(dirname(outputFile), base64ModulePath),
136-
)
137-
138-
parts.push(`import { decode as _base64Decode } from "${base64ModulePathRelativeToOutputFile}";`)
139129
for (const wasmChunk of wasm ?? []) {
140130
const data = await readFile(join(srcDir, wasmChunk.filePath))
141-
parts.push(
142-
`const ${wasmChunk.name} = _base64Decode(${JSON.stringify(
143-
data.toString('base64'),
144-
)}).buffer`,
145-
)
131+
parts.push(`const ${wasmChunk.name} = Uint8Array.from(${JSON.stringify([...data])})`)
146132
}
147133
}
148134

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.