Skip to content

Commit 58c1a03

Browse files
committed
convert to non-breaking wasm
1 parent d88759a commit 58c1a03

File tree

9 files changed

+273
-326
lines changed

9 files changed

+273
-326
lines changed

.github/workflows/ci.yml

+11-6
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ jobs:
3030
if: startsWith(matrix.rust, 'nightly')
3131
run: cargo check -Z features=dev_dep
3232
- run: cargo test
33-
- run: cargo test --no-default-features
34-
- run: cargo test --no-default-features --features io
35-
- run: cargo test --no-default-features --features timer
3633

3734
# Copied from: https://github.com/rust-lang/stacker/pull/19/files
3835
windows_gnu:
@@ -89,6 +86,17 @@ jobs:
8986
# if: startsWith(matrix.os, 'ubuntu')
9087
# run: cross build --target x86_64-unknown-illumos
9188

89+
wasm:
90+
runs-on: ubuntu-latest
91+
steps:
92+
- uses: actions/checkout@v3
93+
- name: Install Rust
94+
run: rustup update stable && rustup default stable
95+
- run: rustup target add wasm32-unknown-unknown
96+
- name: Install wasm-pack
97+
uses: taiki-e/install-action@wasm-pack
98+
- run: wasm-pack test --headless --chrome
99+
92100
msrv:
93101
runs-on: ubuntu-latest
94102
strategy:
@@ -101,9 +109,6 @@ jobs:
101109
- name: Install Rust
102110
run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
103111
- run: cargo build
104-
- run: cargo build --no-default-features
105-
- run: cargo build --no-default-features --features io
106-
- run: cargo build --no-default-features --features timer
107112

108113
clippy:
109114
runs-on: ubuntu-latest

Cargo.toml

+12-10
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,20 @@ harness = false
2020

2121
[dependencies]
2222
cfg-if = "1.0.0"
23-
concurrent-queue = { version = "1.2.2", optional = true }
23+
concurrent-queue = { version = "1.2.2" }
2424
futures-lite = "1.11.0"
2525
log = "0.4.11"
2626
once_cell = "1.4.1"
2727
parking = "2.0.0"
28-
polling = { version = "2.0.0", optional = true }
29-
slab = { version = "0.4.2", optional = true }
30-
socket2 = { version = "0.4.2", features = ["all"], optional = true }
3128
waker-fn = "1.1.0"
3229

33-
[features]
34-
default = ["io", "timer"]
35-
io = ["polling", "slab", "socket2"]
36-
timer = ["concurrent-queue"]
30+
[target.'cfg(not(target_family = "wasm"))'.dependencies]
31+
polling = { version = "2.0.0"}
32+
slab = { version = "0.4.2" }
33+
socket2 = { version = "0.4.2", features = ["all"] }
34+
35+
[target.'cfg(target_family = "wasm")'.dependencies]
36+
wasm-bindgen-test = "0.2"
3737

3838
[build-dependencies]
3939
autocfg = "1"
@@ -46,12 +46,14 @@ winapi = { version = "0.3.9", features = ["winsock2"] }
4646

4747
[dev-dependencies]
4848
async-channel = "1"
49-
async-net = "1"
5049
blocking = "1"
5150
criterion = "0.3.6"
51+
tempfile = "3"
52+
53+
[target.'cfg(not(target_family = "wasm"))'.dev-dependencies]
54+
async-net = "1"
5255
getrandom = "0.2.7"
5356
signal-hook = "0.3"
54-
tempfile = "3"
5557

5658
[target.'cfg(target_os = "linux")'.dev-dependencies]
5759
inotify = { version = "0.10", default-features = false }

0 commit comments

Comments
 (0)