-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
deno-esbuild: A request for WebAssembly support #2323
Comments
The Deno API is not built to use WASM at all, so this isn't supposed to work anyway. The only reason doing this doesn't throw an error right now is that the Why do you want to use WebAssembly instead of native? It can easily be 10x slower. |
It would avoid the need for an additional I'm transpiling a single file, so the wasm version would be more than enough for my use case. |
This would also allow esbuild to run on Deno Deploy et al, which I'd love to see. |
I tried poking at this and it seems relatively straightforward. Caveats:
|
Re: loading interface - the deno_emit wasm module has a way to provide a custom loader function, which is basically: type Loader = (spec: string) => Promise<LoadResponseModule>;
interface LoadResponseModule {
/** A module with code has been loaded. */
kind: 'module';
/** The string URL of the resource. If there were redirects, the final
* specifier should be set here, otherwise the requested specifier. */
specifier: string;
/** For remote resources, a record of headers should be set, where the key's
* have been normalized to be lower case values. */
headers?: Record<string, string>;
/** The string value of the loaded resources. */
content: string;
} I've been working on getting the emit wasm running on Deno Deploy (see bundle.deno.dev), and it appears to be working, although a much smaller library than esbuild. To me though, while running a future esbuild wasm on an edge platform would be cool, just being able to run it locally without needing the process permission would be very useful as well. |
I'd like to be able to run esbuild transform in a Deno program, but using a loaded wasmModule (e.g. instantiated in Deno with
WebAssembly.compileStreaming
from a fetch response fromhttps://unpkg.com/esbuild-wasm@0.14.43/esbuild.wasm
).tried:
It seems like this should be able to work, given Deno has the wasmModule loaded.
Thanks!
- John
The text was updated successfully, but these errors were encountered: