Skip to content
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

Tracking progress of .wasm fetch #62

Open
connorjclark opened this issue Apr 28, 2022 · 1 comment
Open

Tracking progress of .wasm fetch #62

connorjclark opened this issue Apr 28, 2022 · 1 comment

Comments

@connorjclark
Copy link

The current fetch approach of loading a wasm module allows you to track the progress of the (often large) network resource, and indicate its progress to the user (you just wrap fetch with something like this).

The whole point of this proposal is to make the wasm exports available "statically", so the entire loading phase is made opaque. But I wonder if a dynamic import could somehow provide hooks to track progress?

const wasm = import('some.wasm');

wasm.onProgress(...)

const {exportedFn} = await wasm;

I understand this is not possible with dynamic imports today, so this is probably the wrong place to talk about this idea... In any case, it'd be good to mention "indicate progress" use case as a non-goal, as it's the first thing I thought of (and is a reason I wouldn't make use of this if the binary is large enough).

@annevk
Copy link
Member

annevk commented Apr 29, 2022

This seems like a good thing to raise with TC39: https://github.com/tc39/proposals.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants