Skip to content
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: ic-cdk-bindgen replace import macro #390

Merged
merged 13 commits into from
Jul 12, 2023
Merged

feat: ic-cdk-bindgen replace import macro #390

merged 13 commits into from
Jul 12, 2023

Conversation

chenyan-dfinity
Copy link
Contributor

@chenyan-dfinity chenyan-dfinity commented Apr 25, 2023

Work with dfinity/candid#422

Proposed workflow:

  • Canister project add ic-cdk-bindgen as a build dependency that generates Rust bindings in the source directory with config options
use ic_cdk_bindgen::{Builder, Config};
fn main() {
    let counter = Config::new("counter");
    let mut builder = Builder::new();
    builder.add(counter);
    builder.build(None);  // default write to src/declarations
}
  • In the canister code,
mod declarations;
use declarations::counter::counter;

counter.inc().await?

@lwshang lwshang changed the title import did file feat: ic-cdk-bindgen replace import macro Jul 12, 2023
@lwshang lwshang merged commit ed1cdd9 into beta Jul 12, 2023
16 checks passed
@lwshang lwshang deleted the import-candid branch July 12, 2023 20:45
@lwshang lwshang mentioned this pull request Jul 13, 2023
3 tasks
lwshang added a commit that referenced this pull request Jul 13, 2023
* feat(breaking): bump CDK to use candid 0.9-beta (#367)

* bump CDK to use candid 0.9-beta

* make ic-ledger-types not breaking

* chore: release continue (#370)

* fix

* bump ver

* Add readme to ic-cdk-timers

---------

Co-authored-by: Adam Spofford <adam.spofford@dfinity.org>

* version and changelog

* fix chess

* disable examples using import

---------

Co-authored-by: Linwei Shang <linwei.shang@dfinity.org>
Co-authored-by: Adam Spofford <adam.spofford@dfinity.org>

* test

* add wasmtime in CI

* revert

* use patched ic-test-state-machine-client

* feat: ic-cdk-bindgen replace import macro (#390)

* import did file

* fix

* test

* fix counter example

* rename to ic-cdk-bindgen

* fix profile example

* no re-export

* enable all example tests in CI

* remove import and fix tests

* fix clippy

* fix ic-certified-map doc test

* fmt

---------

Co-authored-by: Linwei Shang <linwei.shang@dfinity.org>

* feat: add export_candid macro (#386)

* export candid

* fix build.sh

* actor macro

* add wasmtime in CI

* fix

* fix

* fix

* remove actor macro

* fix

* ic-cdk/wasi enables export_candid

* git forget declarations/

* fmt

* Warning features in Cargo.toml

* bump ic0 version

---------

Co-authored-by: Linwei Shang <linwei.shang@dfinity.org>

* prepare for release

* TODO comment

* changelog

* doc export_candid

* format changelog

* bump library and changelog

* explain why no doc for TransformFunc

* find solution for doc TransformFunc

* remove TODO

* doc hidden wasi mod

---------

Co-authored-by: Yan Chen <48968912+chenyan-dfinity@users.noreply.github.com>
Co-authored-by: Adam Spofford <adam.spofford@dfinity.org>
Co-authored-by: Yan Chen <yan.chen@dfinity.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants