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

[Feature Request] Having a parameter to set the WASM URL #20

Closed
ThibaultNocchi opened this issue Mar 5, 2023 · 7 comments
Closed

[Feature Request] Having a parameter to set the WASM URL #20

ThibaultNocchi opened this issue Mar 5, 2023 · 7 comments

Comments

@ThibaultNocchi
Copy link

Hello,

As specified in #6, Vite bundles files with a hash. As jassub tries to load the WASM file from a static filename, loading it fails.

Solutions are either using the static copy plugin or disabling hashing by Vite.

I'm wondering if it'd be possible to have a parameter, such as the workerUrl one, to pass the WASM URL?

I've looked into the code, but I don't have the skills to see if it can be implemented as I don't have much experience with workers.

I don't mind if it's not implemented, just asking if it could be possible.

Thanks a lot!

@ThaUnknown
Copy link
Owner

not really, there's a PR proposing it, but I don't really like it, I recommend u use a static copy plugin

@ThibaultNocchi
Copy link
Author

Ok, no problem then. Thank you!

@ThibaultNocchi ThibaultNocchi closed this as not planned Won't fix, can't repro, duplicate, stale Mar 5, 2023
@ferferga
Copy link

ferferga commented Mar 6, 2023

@ThaUnknown Can you elaborate why, please?

Having the wasm file hashed should make deployments easier when the file changes, as its hash gets reloaded. I don't think static copying is an elegant solution either, since you need further configuration in the building pipeline and the static assets are not counted towards the bundle size stats when using Vite to build.

@ThaUnknown
Copy link
Owner

because you need to modify a lot in the emscripten build steps to keep the same "entry level" aka keep browser requirements low and be able to modify the path, and hate to break it to you but even with a custom path even if you magically change the WASM file during your development which is stupidly unlikely, it won't actually change the WASM, and EVEN IF you provided a custom path you'd still need to static copy the .wasm but with the hash...

WASM isn't really a problem in not counting it towards the bundle size stats and it really shouldnt be

@ferferga
Copy link

ferferga commented Mar 6, 2023

@ThaUnknown I wasn't talking about development, ofc hashing on development is useless.

My point was more towards production, where a version bump of your dependency where the WASM is also modified doesn't propagate in a deterministic way to clients, which might have cached versions.

@ThaUnknown
Copy link
Owner

yeah that's fair, honestly I don't know what's the best way to solve this issue, I've never really seen or used any libraries which used workers so I don't really know what's the "go-to" for this kind of thing

@ThaUnknown
Copy link
Owner

this was added in latest

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

3 participants