Add wasm-bindgen.
This commit is contained in:
parent
a48d76321e
commit
b3f97dbb40
@ -56,6 +56,7 @@ tracing = { version = "0.1.37", optional = true }
|
||||
tracing-opentelemetry = { version = "0.20.0", optional = true }
|
||||
tracing-subscriber = { version = "0.3.17", optional = true, features = ["env-filter"] }
|
||||
walkdir = { version = "2.3.3", optional = true }
|
||||
wasm-bindgen = { version = "0.2.89", optional = true }
|
||||
|
||||
[build-dependencies]
|
||||
walkdir = "2.3.3"
|
||||
@ -66,7 +67,7 @@ compare = ["tokio/process", "tokio/macros"]
|
||||
foreign_document_test = ["compare", "dep:futures", "tokio/sync", "dep:walkdir", "tokio/process"]
|
||||
tracing = ["dep:opentelemetry", "dep:opentelemetry-otlp", "dep:opentelemetry-semantic-conventions", "dep:tokio", "dep:tracing", "dep:tracing-opentelemetry", "dep:tracing-subscriber"]
|
||||
event_count = []
|
||||
wasm = ["dep:serde"]
|
||||
wasm = ["dep:serde", "dep:wasm-bindgen"]
|
||||
|
||||
# Optimized build for any sort of release.
|
||||
[profile.release-lto]
|
||||
|
@ -1,6 +1,7 @@
|
||||
#![no_main]
|
||||
use wasm_bindgen::prelude::wasm_bindgen;
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn add(left: usize, right: usize) -> usize {
|
||||
#[wasm_bindgen]
|
||||
pub fn add(left: usize, right: usize) -> usize {
|
||||
left + right
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user