summaryrefslogtreecommitdiff
path: root/cli/global_state.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2020-05-07 20:43:27 +0200
committerGitHub <noreply@github.com>2020-05-07 20:43:27 +0200
commit2b66b8a03e4f81cc158be40d07534f26fa762c2b (patch)
treebdeb6b1e6737bd839c87e2d6d178da42d9004ca4 /cli/global_state.rs
parent93cf3bd5341d5985201ea0905280082d5a3310f9 (diff)
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
Diffstat (limited to 'cli/global_state.rs')
-rw-r--r--cli/global_state.rs10
1 files changed, 1 insertions, 9 deletions
diff --git a/cli/global_state.rs b/cli/global_state.rs
index dbea5f827..460203364 100644
--- a/cli/global_state.rs
+++ b/cli/global_state.rs
@@ -3,7 +3,6 @@ use crate::compilers::CompiledModule;
use crate::compilers::JsCompiler;
use crate::compilers::TargetLib;
use crate::compilers::TsCompiler;
-use crate::compilers::WasmCompiler;
use crate::deno_dir;
use crate::file_fetcher::SourceFileFetcher;
use crate::flags;
@@ -36,7 +35,6 @@ pub struct GlobalStateInner {
pub file_fetcher: SourceFileFetcher,
pub js_compiler: JsCompiler,
pub ts_compiler: TsCompiler,
- pub wasm_compiler: WasmCompiler,
pub lockfile: Option<Mutex<Lockfile>>,
pub compiler_starts: AtomicUsize,
compile_lock: AsyncMutex<()>,
@@ -87,7 +85,6 @@ impl GlobalState {
file_fetcher,
ts_compiler,
js_compiler: JsCompiler {},
- wasm_compiler: WasmCompiler::default(),
lockfile,
compiler_starts: AtomicUsize::new(0),
compile_lock: AsyncMutex::new(()),
@@ -116,12 +113,6 @@ impl GlobalState {
let compile_lock = self.compile_lock.lock().await;
let compiled_module = match out.media_type {
- msg::MediaType::Json | msg::MediaType::Unknown => {
- state1.js_compiler.compile(out).await
- }
- msg::MediaType::Wasm => {
- state1.wasm_compiler.compile(state1.clone(), &out).await
- }
msg::MediaType::TypeScript
| msg::MediaType::TSX
| msg::MediaType::JSX => {
@@ -152,6 +143,7 @@ impl GlobalState {
state1.js_compiler.compile(out).await
}
}
+ _ => state1.js_compiler.compile(out).await,
}?;
drop(compile_lock);