Question: How do I import a Rust function from front-end-f47407f6508404f8.js dynamically?
My thought is that I would do:
import { do_something } from './dist/front-end-xxxxxxxxx.js';
However, every time I make a change to my lib.rs file, the name of the target JavaScript file in the dist/ folder changes (presumably some hashing function).
What's the correct way to reference the WASM JS wrapper from my application's JS module?
This is the snippet on the website that does the import and assignment of all bindings to window.wasmBindings:
import init, * as bindings from '/index-7eeee8fa37b7636a.js';
window.wasmBindings = bindings;
init('/index-7eeee8fa37b7636a_bg.wasm');
I don't currently see anywhere in the Trunk documentation where they tell you that your Rust functions can be called using the window.wasmBindings reference, hence my confusion.