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

Stop using singleton instance on Dart bindings #991

Open
wants to merge 16 commits into
base: flutter_rust_bridge_v2
Choose a base branch
from

Conversation

erdemyerebasmaz
Copy link
Contributor

@erdemyerebasmaz erdemyerebasmaz commented May 27, 2024

This PR implements frb v2 Methods support.

  • connect now returns a BindingsBreezServices which we can call BreezServices API from.

TODO:

  • Add migration guide.
  • See if it's possible to get rid of BreezSDK wrapper class as a whole, or slim it down as much as possible

@erdemyerebasmaz erdemyerebasmaz requested a review from roeierez May 27, 2024 15:21
@erdemyerebasmaz erdemyerebasmaz changed the title [frb v2] Stop using singleton instance on Dart bindings [frb] Stop using singleton instance on Dart bindings May 27, 2024
@erdemyerebasmaz erdemyerebasmaz force-pushed the flutter_rust_bridge_v2 branch from fad13f5 to 9a7b4eb Compare May 27, 2024 15:28
@erdemyerebasmaz erdemyerebasmaz force-pushed the automatic-arbitrary-rust-type branch 3 times, most recently from 1f2eb17 to 90eb956 Compare May 27, 2024 15:43
@erdemyerebasmaz erdemyerebasmaz force-pushed the flutter_rust_bridge_v2 branch from 9a7b4eb to 797375d Compare May 27, 2024 15:45
@erdemyerebasmaz erdemyerebasmaz force-pushed the automatic-arbitrary-rust-type branch 3 times, most recently from 35d6966 to ff1697e Compare May 27, 2024 17:51
@erdemyerebasmaz erdemyerebasmaz requested a review from dangeross May 27, 2024 18:00
@erdemyerebasmaz erdemyerebasmaz marked this pull request as ready for review May 27, 2024 18:00
Remove old files
@erdemyerebasmaz erdemyerebasmaz force-pushed the automatic-arbitrary-rust-type branch from ff1697e to 26a79ad Compare May 28, 2024 09:19
@erdemyerebasmaz erdemyerebasmaz force-pushed the automatic-arbitrary-rust-type branch from 26a79ad to 6ba9731 Compare May 28, 2024 09:35
@erdemyerebasmaz erdemyerebasmaz force-pushed the automatic-arbitrary-rust-type branch from 6ba9731 to bb04fa4 Compare May 28, 2024 09:44
@erdemyerebasmaz erdemyerebasmaz changed the title [frb] Stop using singleton instance on Dart bindings Stop using singleton instance on Dart bindings May 28, 2024
libs/sdk-core/src/binding.rs Outdated Show resolved Hide resolved

impl BindingBreezServices {
/// See [BreezServices::sync]
pub async fn sync(&self) -> Result<()> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does using async functions work for the bindings? Just curious, as previously we block an async call in a sync function

Copy link
Contributor Author

@erdemyerebasmaz erdemyerebasmaz May 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, they do. Async Rust code is supported with v2.

Copy link
Collaborator

@dangeross dangeross left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's looking good

@erdemyerebasmaz
Copy link
Contributor Author

I think it's looking good

Thanks. I'm thinking of writing the migration guide and merging the changes.

I'll open an issue for

See if it's possible to get rid of BreezSDK wrapper class as a whole, or slim it down as much as possible

and address it in scope of another PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants