-
Notifications
You must be signed in to change notification settings - Fork 343
RFC: feat: allow omission of dart-opaque feature #2662
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
Conversation
Great job! I will handle the CI and merge it in the next batch. Btw curious why do you want to remove the dart-opaque feature (it is totally reasonable, just wondering what is the exact use case) |
Let me know if you have a preferred solution for the warning generated because of the 'dart-opaque' feature reference. I can take a look at it. I don't know what would be a good way to structure feature-gated generated code. Overall I'm trying to understand the FRB code better and trying to minimize surface area on the way to solving #2588. |
Not checked in detail but usually I just add more feature gates on it...
I see, looks reasonable! |
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.
Originally want to merge it, but after briefly checking it, what about removing the feat_no_dart_opaque
example, and instead add a test that modifies dart_minimal's rust features temporarily and ensure it compiles. Because it is possible we add tests to ensure it compiles when more feature flags gets removed, and it would be great to limit the number of frb_examples to avoid heavy CI.
Something like this? |
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.
It would be great to keep dart_minimal have the feature by default (to make users easier to use dart_minimal to reproduce some bugs), but yes your approach looks also ok :)
EDIT: Oh I see the default features below, looks good!
[features] | ||
default = ["dart-opaque"] | ||
dart-opaque = ["flutter_rust_bridge/dart-opaque"] |
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.
nit: is it possible we make it as simple as possible, say, is it possible to remove the dart-opaque line, and directly specify as flutter_rust_bridge/dart-opaque
? (just a quick nit, I forget whether rust supports so or not, if not then ignore)
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.
I don't know of another way to do this.
Great job! I will handle it soon (hopefully within a few days) |
Oops, I originally wanted to merge this to feat/2662 and then fix CI and then merge to master, but then realize some nits:
|
Github isn't letting me push more commits to this with the merge. Created #2681. |
Changes
Fixes #2661
In this implementation
flutter_rust_bridge::frb_generated_boilerplate_io
and web are still present in the generated code, and now they have a reference to adart-opaque
feature that isn't present by default in the client's Cargo.toml. This can be worked around by adding the feature declaration. Fixing this so the code isn't generated at all would be a much bigger change.