-
Notifications
You must be signed in to change notification settings - Fork 79
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
feat(didc-js): Javascript multi purpose library with candid utils #577
Conversation
Click to see raw report
|
Please consider using https://github.com/dfinity/candid/blob/master/rust/candid_parser/src/bindings/javascript.rs instead of |
The JS binding use case is different, this binding gives back JavaScript code iirc, which is not what I’m after. The target format aims to be a displayable value that we want back, but if you’re not happy with that idl2json lib because it’s incomplete, I’m happy to keep only candid as a target format since it already gives me enough for what I’m building. |
Right, it gives back JS code, and if you eval the code, you get a JS value that can be displayed. Candid UI uses that to display JSON format. If it sounds too hacky, we can just remove idl2json. |
Adds candid encoding/decoding to external canister method calls through the recently published [@dfinity/didc](https://www.npmjs.com/package/@dfinity/didc) lib from the candid [PR](dfinity/candid#577).
Overview
This library adds similar tools as
didc
but aims to be used in a Javascript environment.Requirements
Considered Solutions
We've also considered a similar approach as the candid ui which leverages a canister to expose a query method, but we ruled that out because we want to use this as the user types in a form which would result in many network requests.
Recommended Solution
Leverage
candid_parser
to create a javascript package exposing a compiled WebAssembly that uses those crates.Considerations
This is a new library, there's no consumer yet.