From 2b66b8a03e4f81cc158be40d07534f26fa762c2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Thu, 7 May 2020 20:43:27 +0200 Subject: BREAKING: Remove support for .wasm imports (#5135) Importing .wasm files is non-standardized therefore deciding to support current functionality past 1.0 release is risky. Besides that .wasm import posed many challenges in our codebase due to complex interactions with TS compiler which spawned thread for each encountered .wasm import. This commit removes: - cli/compilers/wasm.rs - cli/compilers/wasm_wrap.js - two integration tests related to .wasm imports --- cli/tests/051_wasm_import/remote.ts | 3 --- cli/tests/051_wasm_import/simple.wasm | Bin 226 -> 0 bytes cli/tests/051_wasm_import/simple.wat | 31 ------------------------------- cli/tests/051_wasm_import/wasm-dep.js | 17 ----------------- 4 files changed, 51 deletions(-) delete mode 100644 cli/tests/051_wasm_import/remote.ts delete mode 100644 cli/tests/051_wasm_import/simple.wasm delete mode 100644 cli/tests/051_wasm_import/simple.wat delete mode 100644 cli/tests/051_wasm_import/wasm-dep.js (limited to 'cli/tests/051_wasm_import') diff --git a/cli/tests/051_wasm_import/remote.ts b/cli/tests/051_wasm_import/remote.ts deleted file mode 100644 index 761a5248e..000000000 --- a/cli/tests/051_wasm_import/remote.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function jsRemoteFn(): number { - return 2019; -} diff --git a/cli/tests/051_wasm_import/simple.wasm b/cli/tests/051_wasm_import/simple.wasm deleted file mode 100644 index 8e544fe30..000000000 Binary files a/cli/tests/051_wasm_import/simple.wasm and /dev/null differ diff --git a/cli/tests/051_wasm_import/simple.wat b/cli/tests/051_wasm_import/simple.wat deleted file mode 100644 index 5e73db97b..000000000 --- a/cli/tests/051_wasm_import/simple.wat +++ /dev/null @@ -1,31 +0,0 @@ -;; From https://github.com/nodejs/node/blob/bbc254db5db672643aad89a436a4938412a5704e/test/fixtures/es-modules/simple.wat -;; MIT Licensed -;; $ wat2wasm simple.wat -o simple.wasm - -(module - (import "./wasm-dep.js" "jsFn" (func $jsFn (result i32))) - (import "./wasm-dep.js" "jsInitFn" (func $jsInitFn)) - (import "http://127.0.0.1:4545/cli/tests/051_wasm_import/remote.ts" "jsRemoteFn" (func $jsRemoteFn (result i32))) - (export "add" (func $add)) - (export "addImported" (func $addImported)) - (export "addRemote" (func $addRemote)) - (start $startFn) - (func $startFn - call $jsInitFn - ) - (func $add (param $a i32) (param $b i32) (result i32) - local.get $a - local.get $b - i32.add - ) - (func $addImported (param $a i32) (result i32) - local.get $a - call $jsFn - i32.add - ) - (func $addRemote (param $a i32) (result i32) - local.get $a - call $jsRemoteFn - i32.add - ) -) diff --git a/cli/tests/051_wasm_import/wasm-dep.js b/cli/tests/051_wasm_import/wasm-dep.js deleted file mode 100644 index 70b16348b..000000000 --- a/cli/tests/051_wasm_import/wasm-dep.js +++ /dev/null @@ -1,17 +0,0 @@ -function assertEquals(actual, expected, msg) { - if (actual !== expected) { - throw new Error(msg || ""); - } -} - -export function jsFn() { - state = "WASM JS Function Executed"; - return 42; -} - -export let state = "JS Function Executed"; - -export function jsInitFn() { - assertEquals(state, "JS Function Executed", "Incorrect state"); - state = "WASM Start Executed"; -} -- cgit v1.2.3