mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-20 08:16:31 +00:00
Dramatically improving the build time of web-sys (#2012)
* Pre-generating web-sys * Fixing build errors * Minor refactor for the unit tests * Changing to generate #[wasm_bindgen} annotations * Fixing code generation * Adding in main bin to wasm-bindgen-webidl * Fixing more problems * Adding in support for unstable APIs * Fixing bug with code generation * More code generation fixes * Improving the webidl program * Removing unnecessary cfg from the generated code * Splitting doc comments onto separate lines * Improving the generation for unstable features * Adding in support for string values in enums * Now runs rustfmt on the mod.rs file * Fixing codegen for constructors * Fixing webidl-tests * Fixing build errors * Another fix for build errors * Renaming typescript_name to typescript_type * Adding in docs for typescript_type * Adding in CI script to verify that web-sys is up to date * Fixing CI script * Fixing CI script * Don't suppress git diff output * Remove duplicate definitions of `Location` Looks to be a preexisting bug in wasm-bindgen? * Regenerate webidl * Try to get the git diff command right * Handle named constructors in WebIDL * Remove stray rustfmt.toml * Add back NamedConstructorBar definition in tests * Run stable rustfmt over everything * Don't run Cargo in a build script Instead refactor things so webidl-tests can use the Rust-code-generation as a library in a build script. Also fixes `cargo fmt` in the repository. * Fixup generated code * Running web-sys checks on stable * Improving the code generation a little * Running rustfmt Co-authored-by: Alex Crichton <alex@alexcrichton.com>
This commit is contained in:
@ -41,15 +41,14 @@ pub fn execute(
|
||||
global.__wbg_test_invoke = f => f();
|
||||
|
||||
async function main(tests) {{
|
||||
const support = require("./{0}");
|
||||
const wasm = require("./{0}_bg");
|
||||
const wasm = require("./{0}");
|
||||
|
||||
cx = new support.WasmBindgenTestContext();
|
||||
handlers.on_console_debug = support.__wbgtest_console_debug;
|
||||
handlers.on_console_log = support.__wbgtest_console_log;
|
||||
handlers.on_console_info = support.__wbgtest_console_info;
|
||||
handlers.on_console_warn = support.__wbgtest_console_warn;
|
||||
handlers.on_console_error = support.__wbgtest_console_error;
|
||||
cx = new wasm.WasmBindgenTestContext();
|
||||
handlers.on_console_debug = wasm.__wbgtest_console_debug;
|
||||
handlers.on_console_log = wasm.__wbgtest_console_log;
|
||||
handlers.on_console_info = wasm.__wbgtest_console_info;
|
||||
handlers.on_console_warn = wasm.__wbgtest_console_warn;
|
||||
handlers.on_console_error = wasm.__wbgtest_console_error;
|
||||
|
||||
// Forward runtime arguments. These arguments are also arguments to the
|
||||
// `wasm-bindgen-test-runner` which forwards them to node which we
|
||||
@ -57,7 +56,7 @@ pub fn execute(
|
||||
// filters for now.
|
||||
cx.args(process.argv.slice(2));
|
||||
|
||||
const ok = await cx.run(tests.map(n => wasm[n]));
|
||||
const ok = await cx.run(tests.map(n => wasm.__wasm[n]));
|
||||
if (!ok)
|
||||
exit(1);
|
||||
}}
|
||||
|
Reference in New Issue
Block a user