- Compatibility with
wasm-bindgen. - Do we agree with the new name
js-bindgen? Maybeweb-bindgenis the most accurate? #[js_sys]is probably also not the ideal name.- Stub implementation for non-supported targets.
- Add ourselves to the tool-conventions tool list.
- Move
rwatand theprettypleasefork to thewasm-bindgenORG.
- Test Runner:
- Consider moving environment variables to CLI arguments.
- Lint and format TS files and minimize JS files.
- Add support for
--test-threadsand multi-threaded tests where possible forpanic = "abort". - Add support for
panic = "unwind". - Add support for
--force-run-in-process. - Add support for
--skip,--quiet,--show-output,--colorand--format pretty. - E2E testing including output comparison with regular
cargo test. Test output on failure especially carefully. - Design a way to let users set the default driver, overwrite and whitelist drivers globally or for specific tests.
- Add multi-threading support when running with
target_feature = "atomics"where possible. - Crate feature to switch to
native-tls. - Add environment variable to set driver startup timeout.
- Properly emit errors when WebDrivers fail between startup and finish. Make sure we don't wait forever for something if the WebDriver or connection fails.
- Short-circuit if all tests are ignored.
- Don't actually print the JS stack on error. The panic handler should print a backtrace instead to align with Rust.
expected substringshould escape control characters like newlines.- Consider making the HTML background dark to make terminal colors more visible.
- Consider printing stacktraces in the console to make paths clickable. Alternatively explore making paths clickable in the window output directly.
- Add buttons for the server runner to run tests in various worker setting on demand.
- Optimize HTML output by syncing with rAF.
- Validate
--no-captureoutput againstlibtest. - Support return values.
- WebDriver Session Manager:
- Add some form of session number limits.
- Clean up cookies, storage, shared and service workers after session is returned to the pool.
- E2E testing for the linker. Should also ensure deterministic output.
- Can we use
TokenStreamfromstrparsing to simplify the code without affecting performance? - Escape namespaces and function names if they are not valid JS identifiers.
- Test raw Rust identifiers in function and parameter names.
#[js_sys]parameter and function name aren't allowed to collide. Internalextern { fn <name> ... }definition can shadow parameter values.js-bindgenmacro custom section generation can produce name collisions with intermediate variables.- Allocate slots on the
externreftable in batches. - Determine what to do with
js_sys::UnwrapThrowExt. Avoiding the panic machinery is nice for some very niche use-cases but it might be very annoying for most users. Maybe hide it behind acfgflag? - Validate and improve performance of
JsStringencoding/decoding. See Emscripten's orwasm-bindgen's implementation for inspiration. - Experiment if allocation is better for build times then iterator chaining in proc-macros.
- Find a way to prevent users from accidentally using the default linker.
- Supply an invalid object file that would be removed by our custom linker.
- Check
RUSTC_LINKERin abuild.rs. Which would require a separate library crate forjs-bindgen.
- Version all names to make packages compatible with other versions of itself.
- Embed crate version to make linker capable of detecting unsupported versions.
- We still need to look into what happens with old files. We might need to delete them ourselves.
- Evaluate the output directory of our Wasm object files. Some ideas:
- Store them next to the output file.
- Pass an environment variable from a
build.rspointing to the target directory and go from there. This seems to have failed. No build script instruction can reach the linker on Wasm.
- Memory-mapped file reading should lock files to make it safe.
- Add diagnostics for traits when they are not implemented, e.g.
Input/Output. - Inline JS code is getting quite complex, consider moving to external TS file.
- Add
#[cfg(debug_assertions)]checks toInput/Output. E.g. confirming that an output type is really what it claims to be. - Wrap Rust types that don't map 1:1 to our own types. E.g. pointers,
Optionand so on.
- Find a way to link to imports directly if no wrapper function is needed. This happens when no conversions on the WAT level are necessary.
- Provide an absolutely minimal allocator.
- Linker functionality should live in its own crate so a newer linker versions can support multiple versions.
- Can we remove custom sections in pre-processing by modifying
.rlibs? - Re-evaluate caching via the linker.
- Nicer error/warning messages from linker and when appropriate instruct users to file bug reports.
- Polish LLD linker argument parsing. Maybe learn from
wasm-component-ld. We need a way of handling the same argument being passed multiple times. - Print more debugging information in the linker but gate it behind
-v.
This is a list of upstream issues that could make our lives significantly easier:
- LLVM v22 delivers support for the GC proposal, with which we can implement the
externreftable much more efficiently. - LLVM has incomplete GC support for our needs:
llvm/llvm-project#136594. - Stable
asm!support for Wasm:rust-lang/rust#136382. asm!support with target features:rust-lang/rust#113221- Verbatim
asm!parameters:rust-lang/rust#132083. - Better stable proc-macro support:
quote!:rust-lang/rust#54722.- Diagnostics:
rust-lang/rust#54140. - Execution in non-proc-macro crates:
rust-lang/rust#130856.
- Elevate
wasm64-unknown-unknownto tier 2:rust-lang/rust#146944. - A way to flag proc-macros as
unsafe:rust-lang/rfcs#3715. - Link internal functions without exporting them:
rust-lang/rust#29603orrust-lang/rfcs#3834. - Our linker warnings should show up for users:
rust-lang/rust#136096. TextDe/Encodercould supportSharedArrayBuffers:TextDe/Encodercould support resizable buffers:whatwg/encoding#344.wasm-encoderio::Writesupport:bytecodealliance/wasm-tools#778- Improved test coverage data merging:
llvm/llvm-project#121194 - Cargo support for local development pre-processing:
rust-lang/cargo#12552orrust-lang/cargo#4511 - Rust has an issue with duplicate symbols during tests. E.g. this prevents us from having unit
tests in
js-sys.rust-lang/rust#145616 - Currently
cargo metadatadoesn't listbuild-stddependencies. This is an issue for caching in the CI, significantly increasing our build and test times.rust-lang/wg-cargo-std-aware#20 - Ask LLVM to remove the requirement for a
__linear_memorydeclaration on Wasm64.