Open Larpoux opened 3 days ago
Totally agree! We should detect when seeing async fn
and mark it as async no matter how users choose default_dart_async=false.
Feel free to PR, or alternatively I will work on it in the next batch!
I am going to look to the frb code. Don’t do anything on this issue until I declare that it is too complicated for me and that I need your help.
Sure! If you need any hints (e.g. where to look at / how to fix) just ping me.
Please, how can I start FRB under debugger ? Can I use Rust Rover
for example ? Which project must I open ? Do I have to setup a specific configuration to run the debugger ?
frb code generator (frb_codegen
folder) is nothing but a standard Rust program. Thus yes, you can use arbitrary IDE you like (e.g. rustrover) and follow their guides to start debuggers.
You may need to add several command line flags: generate --config-file /path/to/your/flutter_rust_bridge/frb_example/integrate_third_party/flutter_rust_bridge.yaml
(IIRC that may work)
I am going to look to the frb code. Don’t do anything on this issue until I declare that it is too complicated for me and that I need your help.
Sure! If you need any hints (e.g. where to look at / how to fix) just ping me.
I did something to fix this issue, but I had many problems because we diverged. I finally was able to get rid of your modification, but now I realize that your modification is better than mine because I don’t handle correctly the case of a function which is not async, the default value is async, but the user specified #[frb(sync)]. I am going to restore your own patch tomorrow, but please, let me alone on this issue. Or tell me explicitly that I must not work any more on this issue.
I am going to restore your own patch tomorrow, but please, let me alone on this issue. Or tell me explicitly that I must not work any more on this issue.
This is stupid. Better for me to cancel my PR.
I guess you meant https://github.com/fzyzcjy/flutter_rust_bridge/pull/2181? No it is unrelated to this issue!
Firstly it was started (i.e. the first code commit time) before you mentioned wanting to work on this issue. Secondly it was done to fix the scenario that someone chooses default_dart_async: false
and then want to make a fn
(note: this isssue is about async fn
) async on Dart side. Thus it is parallal to this issue.
In other words, there are 3 scenarios when default_dart_async:false
:
fn
- it is dart sync#[frb(dart_async)] fn
- it should be dart async (after my PR yesterday)async fn
- it should be dart async (waiting for your PR)No problem, @fzyzcjy . I was very glad to have a preview of the frb code. I am going to check if [#2178] is solved by your commit. If not, I will reopen the issue and will redo a fix. Certainly today.
‘Thanks for your tremendous work. 👍 . Btw : Is it you the guy who created this amazing project ? I am really impressed by how sophisticated this project is. I hope to have some opportunities to work on it, because I can learn much things by working with the FRB team.
I am going to check if [...] is solved by your commit.
I guess not solved since I do not touch anything related to async fn
signature parsing.
Btw : Is it you the guy who created this amazing project ?
Yes - you can have a look at the commit history. But not only me - there are many people who contribute to this project (view https://github.com/fzyzcjy/flutter_rust_bridge#-acknowledgments-and-contributors for a full list and details). Many of them contribute something small like fixing a typo, but there are some people who contribute a lot to the project, making it grow from a tiny project into a much bigger one. On the other hand, v2's overhaul and new features are mostly done by me (again check the list/commit history for details).
Fixed by PR [#2187]. (I hope)
Describe the bug
When I set the parameter
default_dart_async: false
I get after, 10 errors. Most of them are in classContext
andContextOffline
.For example :
The
await
almost at the end of the fn is NOK, because the function is notasync
. I think the problem is tied with the declaration ofsuspend()
in the WebAudioApi-RS :Probably that our generated fn should be
async
tooSteps to reproduce
-
Logs
Expected behavior
No response
Generated binding code
No response
OS
No response
Version of
flutter_rust_bridge_codegen
No response
Flutter info
No response
Version of
clang++
No response
Additional context
No response