diff --git a/Cargo.lock b/Cargo.lock index 2e38df4..43bf4a6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -91,9 +91,10 @@ dependencies = [ [[package]] name = "cel_js_example" -version = "0.0.0" +version = "0.1.0" dependencies = [ "cel", + "serde_json", ] [[package]] @@ -112,6 +113,12 @@ dependencies = [ "serde", ] +[[package]] +name = "itoa" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + [[package]] name = "js-sys" version = "0.3.77" @@ -287,6 +294,12 @@ version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" +[[package]] +name = "ryu" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + [[package]] name = "scopeguard" version = "1.2.0" @@ -313,6 +326,18 @@ dependencies = [ "syn", ] +[[package]] +name = "serde_json" +version = "1.0.142" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "030fedb782600dcbd6f02d479bf0d817ac3bb40d644745b769d6a96bc3afc5a7" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + [[package]] name = "smallvec" version = "1.15.1" diff --git a/Cargo.toml b/Cargo.toml index 84867ce..71aa4b8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,10 +3,11 @@ description = "Example of running cel-rust interpreter in browser" edition = "2024" name = "cel_js_example" publish = false -version = "0.0.0" +version = "0.1.0" [dependencies] cel = "0.11.0" +serde_json = "1.0" [lib] crate-type = ["cdylib", "rlib"] diff --git a/index.html b/index.html index b082291..4239346 100644 --- a/index.html +++ b/index.html @@ -3,20 +3,72 @@
-- Using cel-rust compiled to web assembly. - Change the input to see it update. + Using cel-rust compiled to WebAssembly. + Change the CEL expression or JSON context to see it update in real-time.
- - + +