-
Notifications
You must be signed in to change notification settings - Fork 288
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
Parse futures #2189
Parse futures #2189
Conversation
Looks great! Firstly, I wonder whether this is related: #2172 Secondly, my brainstorm on implementing this:
|
I think it is related to #2172, yes. I was trying to do exactly what you propose, but when a |
One way (just brainstorm, may or may not be the best way): Mimic what we do to parse, say, And, we put this early on https://github.com/vhdirk/flutter_rust_bridge/blob/2ae58f68ffd2e223199bec6c508c577a02ef49d5/frb_codegen/src/library/codegen/parser/mir/parser/ty/path.rs#L36 (e.g. just above that line). Then, that will take precedence. |
I've finally been able to find some time for this PR again. My latest commit makes it successfully parse @fzyzcjy: could you have another look please? There's a bit of cleaning up to do still, but I was trying not to touch too much things all at once. |
Great job! I will find some time to review it, probably within a day |
Well, I haven't actually tested the generated code. Not even once. But if it doesn't work immediately, I probably need some additional advice anyway :) |
Sure, take your time and ping me when needing any suggestion etc! |
I think I'm at a point where a proper review might be welcome. I think I broke some existing tests, but TBH, I don't quite know why that is :/ |
Sure! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job! The main idea looks quite reasonable, and I only have some nits
frb_codegen/src/library/codegen/generator/api_dart/spec_generator/info.rs
Outdated
Show resolved
Hide resolved
frb_codegen/src/library/codegen/parser/mir/parser/ty/impl_trait.rs
Outdated
Show resolved
Hide resolved
frb_codegen/src/library/codegen/parser/mir/parser/ty/concrete.rs
Outdated
Show resolved
Hide resolved
frb_codegen/src/library/codegen/parser/mir/parser/ty/concrete.rs
Outdated
Show resolved
Hide resolved
frb_codegen/src/library/codegen/parser/mir/parser/ty/concrete.rs
Outdated
Show resolved
Hide resolved
Try to copy-paste it to frb_example/dart_minimal and play with it, which is often easier (and faster) to debug. |
Btw CI may fail b/c some Dart updates, but my recent several PRs will fix it (along with other new code), so no worries about that. |
72752a0
to
4620d7a
Compare
So couple of things:
|
Maybe try to do sth like:
That one was meant to be "only compile when in wasm mode". Thus maybe try to change to |
Cross-link: #2234 (reply in thread) (since github does not auto cross-link between a discussion and a issue/pr) |
Closing this as I don't have time to work on it any more. FWIW: I need kotlin bindings, too, so I'm going for uniffi kotlin/swift. |
Sad to hear that :( |
Close #2172 Close #2222 (<--- edit by @fzyzcjy to let github understand it)
Changes
I've been trying to get stuff like this to work:
Due to restrictions of other usages for my library, I can't use async traits, so I have to resort to Future trait objects.
I'm not sure I'm on the right track with this. Any help would be appreciated.
Checklist
./frb_internal precommit --mode slow
(orfast
) is run (it internal runs code generator, does auto formatting, etc)../website
folder) are updated.Remark for PR creator
./frb_internal --help
shows utilities for development.