agent-rs icon indicating copy to clipboard operation
agent-rs copied to clipboard

why ic-agent is not a wasm-compatible crate?

Open Nanue1 opened this issue 3 years ago • 6 comments

I want to use rust to implement the front end. When I use ic-agent in wasm, I can't compile it normally.

Nanue1 avatar Jul 11 '22 14:07 Nanue1

hyper-rustls = { version = "0.23.0", features = [ "webpki-roots" ] } @eric-swanson
Is it because of this crate that ic-agent is no longer a no-std crate?

Nanue1 avatar Jul 11 '22 14:07 Nanue1

You need to use ic-cdk instead. ic-agent is a client library, which can only be used when you are outside of the network. Even if you can compile it in Wasm, many features won't work in the canister code.

chenyan-dfinity avatar Jul 11 '22 17:07 chenyan-dfinity

My wasm front-end program is running in chrome, I can't use ic-cdk, should ic-agent consider supporting no-std? @chenyan-dfinity

Nanue1 avatar Jul 12 '22 05:07 Nanue1

I'm confused. If you want to run in browser, why not use agent-js?

chenyan-dfinity avatar Jul 12 '22 21:07 chenyan-dfinity

I think it's because they don't want to use JS at all

I want to use rust to implement the front end.

smallstepman avatar Jul 14 '22 11:07 smallstepman

I think it's because they don't want to use JS at all

I want to use rust to implement the front end.

Yes, I'm trying to use the rust language for cross-platform development

Nanue1 avatar Jul 14 '22 18:07 Nanue1