-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add WASM Support #52
Add WASM Support #52
Conversation
@clehner the build failed because of the issue with how |
Looks good. @theosirian I think this might fix the issue with features: spruceid/ssi#85 Also looks like we must make the diff --git a/lib/Cargo.toml b/lib/Cargo.toml
index 954ccc6..4b3a3a8 100644
--- a/lib/Cargo.toml
+++ b/lib/Cargo.toml
@@ -9 +9 @@ edition = "2018"
-ssi = { path = "../../ssi" }
+ssi = { path = "../../ssi", default-features = false } |
Works for me:
I had to use I can build and run it with #55 and the following merged: diff --git a/lib/Cargo.toml b/lib/Cargo.toml
index 341b4ab..03c543b 100644
--- a/lib/Cargo.toml
+++ b/lib/Cargo.toml
@@ -9,2 +9,3 @@ default = ["ring"]
ring = ["ssi/ring"]
+wasm = []
@@ -24,5 +25 @@ lazy_static = "1.4"
crate-type = ["lib", "staticlib", "cdylib"]
-
-[features]
-default = []
-wasm = []
diff --git a/wasm/Cargo.toml b/wasm/Cargo.toml
index 18793e3..ac0a460 100644
--- a/wasm/Cargo.toml
+++ b/wasm/Cargo.toml
@@ -18,2 +18,3 @@ chrono = { version = "0.4", features = ["wasmbind"] }
path = "../lib"
+default-features = false
features = ["wasm"] I see more of what you mean about the behavior of workspace features. i.e. "Features in a workspace are unified across all roots selected on the command-line." rust-lang/cargo#8366 (comment) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index ed1b1a3..3cbb0ae 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -53,6 +53,9 @@ jobs:
- name: Build
- run: cargo build --verbose --workspace
+ run: cargo build --verbose --workspace --exclude didkit-wasm
- - name: Test
- run: cargo test --verbose --workspace
+ - name: Test (non-WASM)
+ run: cargo test --verbose --workspace --exclude didkit-wasm
+
+ - name: Test (WASM)
+ run: cargo test --verbose -p didkit-wasm Also, what about testing |
Building correctly for me as well. I also didn't find anything on testing from the JS side. We could try manually running |
Reopened because accidentally auto-closed by spruceid/ssi#85 (comment). |
Maybe it would be possible to have tests run by Or we could just do the build only, and manually test it in the browser when preparing releases. |
Something like selenium-rs to load the webpage with the test? For now, maybe manually testing is okay. |
5e20661
to
2371255
Compare
Rebased onto current |
3f8c3aa
to
f51551a
Compare
Adds WASM support to DIDKit using `wasm-pack`.
f51551a
to
09ce2c4
Compare
Thanks @theosirian. Looks good; waiting for CI now. |
Adds WASM support to DIDKit using
wasm-pack
/wasm-bindgen
.Added a
wasm
feature on DIDKit to prevent compiling C and Java integration on thewasm-pack
build.Added
DIDKitLoader
for web targets to facilitate working with the WASM code on browsers.Added a test for all current methods on DIDKit using
DIDKitLoader
and the WASM build.This is a substitute for #15.