Skip to content

Latest commit

 

History

History
150 lines (137 loc) · 8.88 KB

File metadata and controls

150 lines (137 loc) · 8.88 KB

Critical Priority

  • Compatibility with wasm-bindgen.
  • Do we agree with the new name js-bindgen? Maybe web-bindgen is 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 rwat and the prettyplease fork to the wasm-bindgen ORG.

High Priority

  • Test Runner:
    • Consider moving environment variables to CLI arguments.
    • Lint and format TS files and minimize JS files.
    • Add support for --test-threads and multi-threaded tests where possible for panic = "abort".
    • Add support for panic = "unwind".
    • Add support for --force-run-in-process.
    • Add support for --skip, --quiet, --show-output, --color and --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 substring should 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-capture output against libtest.
    • 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 TokenStream from str parsing 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. Internal extern { fn <name> ... } definition can shadow parameter values.
  • js-bindgen macro custom section generation can produce name collisions with intermediate variables.
  • Allocate slots on the externref table 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 a cfg flag?
  • Validate and improve performance of JsString encoding/decoding. See Emscripten's or wasm-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_LINKER in a build.rs. Which would require a separate library crate for js-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.rs pointing 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 to Input/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, Option and so on.

Medium Priority

  • 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.

Low Priority

  • 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.

Upstream

This is a list of upstream issues that could make our lives significantly easier: