You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Embed the .wasm file as a base64 string in JavaScript (like described here and requested in wasm-pack two times: rustwasm/wasm-pack#831 & rustwasm/wasm-pack#1074).
This would be useful in scenarios where the JS engine is embedded as a scripting environment as the concept of "reading files from disk" does not work.
Another useful example is packaging the js code into a single file with esbuild, e.g. for aws lambda.
Proposed Solution
Let's add a new --inline option that will embed the .wasm file as a base64 string in JavaScript.
Alternatives
I don't have a good alternative right now. If anyone has a better idea, please comment.
The text was updated successfully, but these errors were encountered:
I don't see us adding both features in wasm-bindgen, because it can be done externally.
Unfortunately the Web is a platform with extremely diverse needs, so I'm generally against implementing a solution to every possible requirement out there and would rather see wasm-bindgen enabling other tools to be built around it, e.g. wasm-pack.
If wasm-bindgen has issues supporting external solution to this problem I'm more then happy to review a PR fixing or implementing something towards that.
Motivation
Embed the .wasm file as a base64 string in JavaScript (like described here and requested in wasm-pack two times: rustwasm/wasm-pack#831 & rustwasm/wasm-pack#1074).
This would be useful in scenarios where the JS engine is embedded as a scripting environment as the concept of "reading files from disk" does not work.
Another useful example is packaging the js code into a single file with esbuild, e.g. for aws lambda.
Proposed Solution
Let's add a new --inline option that will embed the .wasm file as a base64 string in JavaScript.
Alternatives
I don't have a good alternative right now. If anyone has a better idea, please comment.
The text was updated successfully, but these errors were encountered: