Skip to content

Commit

Permalink
Remove support for running wasmer in JS
Browse files Browse the repository at this point in the history
The top level crate had two different modes of operation, one for
regular computer use-cases and another for running inside a web
browser-like environment. The modules implementing these features were
mostly copies of each other, which meant that making changes to the
codebase which required changing the implementation of the `wasmer`
crate would require changes in 2 places every time.
  • Loading branch information
nagisa committed Jan 12, 2022
1 parent 9355502 commit 678b287
Show file tree
Hide file tree
Showing 31 changed files with 5 additions and 7,756 deletions.
57 changes: 0 additions & 57 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -412,11 +412,6 @@ test-packages:
cargo test --manifest-path lib/compiler-singlepass/Cargo.toml --release --no-default-features --features=std
cargo test --manifest-path lib/cli/Cargo.toml $(compiler_features) --release

test-js: test-js-api

test-js-api:
cd lib/api && wasm-pack test --node -- --no-default-features --features js-default,wat

#####
#
# Testing compilers.
Expand Down
40 changes: 1 addition & 39 deletions lib/api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,6 @@ edition = "2018"
[lib]
name = "wasmer"

#####
# This crate comes in 2 major flavors:
#
# - `sys`, where `wasmer` will be compiled to a native executable
# which provides compilers, engines, a full VM etc.
# - `js`, where `wasmer` will be compiled to WebAssembly to run in a
# JavaScript host.
#####

# Shared dependencies.
[dependencies]
# - Mandatory shared dependencies.
Expand Down Expand Up @@ -57,36 +48,13 @@ wat = "1.0"
tempfile = "3.1"
anyhow = "1.0"

# Dependencies and Develoment Dependencies for `js`.
[target.'cfg(target_arch = "wasm32")'.dependencies]
# - Mandatory dependencies for `js`.
wasmer-types = { path = "../types", version = "=2.1.2", package = "wasmer-types-near", default-features = false, features = ["std"] }
wasm-bindgen = "0.2.74"
js-sys = "0.3.51"
wasmer-derive = { path = "../derive", version = "=2.1.2", package = "wasmer-derive-near" }
# - Optional dependencies for `js`.
wasmparser = { version = "0.78", default-features = false, optional = true }
hashbrown = { version = "0.11", optional = true }
# - Development Dependencies for `js`.
[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
wat = "1.0"
anyhow = "1.0"
wasm-bindgen-test = "0.3.0"

# Specific to `js`.
#
# `wasm-opt` is on by default in for the release profile, but it can be
# disabled by setting it to `false`
[package.metadata.wasm-pack.profile.release]
wasm-opt = false

[badges]
maintenance = { status = "actively-developed" }

[features]
default = ["sys-default"]
std = []
core = ["hashbrown"]
core = []

# Features for `sys`.
sys = []
Expand Down Expand Up @@ -151,11 +119,5 @@ experimental-reference-types-extern-ref = [
jit = ["universal"]
native = ["dylib"]

# Features for `js`.
js = []
js-default = ["js", "std", "wasm-types-polyfill"]

wasm-types-polyfill = ["js", "wasmparser"]

[package.metadata.docs.rs]
features = ["compiler", "core", "cranelift", "default-compiler", "default-dylib", "default-engine", "dylib", "engine", "jit", "llvm", "native", "singlepass", "sys", "sys-default", "universal"]
140 changes: 0 additions & 140 deletions lib/api/src/js/cell.rs

This file was deleted.

Loading

0 comments on commit 678b287

Please sign in to comment.