Investigate enabling passing paths based on `OUT_DIR` to `wasm-bindgen`
- Dominant language
- TypeScript
- Stars
- 1
- Forks
- 21
- Avg merge
- 12h 14m
- Merged PRs (30d)
- 41
Description
Ideally, it would be nice if we were able to provide const but dynamic paths to `wasm-bindgen`. Then, we could build TS into JS in `OUT_DIR` and use those generated files to pass to the `wasm-bindgen` macro, avoiding having to commit JS files.
However, the macro currently only supports referencing static file paths, inline JS or (I believe) NPM modules. There are some crates that utilize the inline JS code path to load the files through a different macro and in this way, enabling the use-case that we want; we can investigate doing something similar. More context in https://github.com/0xMiden/miden-client/issues/1493#issuecomment-3514229520
Contributor guide
Research direction
Examine the wasm-bindgen macro's current handling of static file paths and inline JS. Look at crates that use inline JS to load files dynamically. Start by reading the linked comment for context, then explore the web-sdk's build process to understand how OUT_DIR is used. Determine if a similar macro-based approach can be integrated to allow dynamic paths.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, typescript, wasm
- Domain
- build-system, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100