clarkmcc / cel-rust

Common Expression Language interpreter written in Rust
https://crates.io/crates/cel-interpreter
MIT License
362 stars 18 forks source link

Support non wasm-bindgen targets… #62

Closed alexsnaps closed 2 months ago

alexsnaps commented 2 months ago

Currently the dependency to chrono enables all default features… which includes wasmbind. As far as I can tell tho, only alloc is really required. When you target a wasm runtime that's not the browser, chances are high some bindings won't be available and mostly not needed (i.e. no Javascript).

"Simple fix" is to chrono = { version= "0.4.26", default-features = false, features = ["alloc"] } only depends on what's needed. But I could also see a wasm/wasi feature here that'd do the appropriate… wdyt? What sounds better limit to what's needed? Or introduce a "wasm profile", have possibly wasmbind as a default feature, but then now becomes "disablable" by users (which would map to what chrono does)? I can create the PR, no worries!

alexsnaps commented 2 months ago

For anybody running in the same issue, the error reported by the wasm runtime on loading the module would be something along the lines of:

Error: failed to acquire "__wbindgen_describe"
alexsnaps commented 1 month ago

@clarkmcc Do you think this could warrant a patch release? Maybe, tho I also understand it is an annoying thing to maintain, but do you think adding milestones would be a way to convey some (if only highlevel) overview of what you are aiming for for future releases...?

clarkmcc commented 1 month ago

@alexsnaps sure, I can get a patch release out today, no problem.

Milestones are a great idea, I'll look into writing some up.