diff --git a/CHANGELOG.md b/CHANGELOG.md index ad10e9a884..7f8106406a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## 2.0.0-dev.42 + +* Please refer to https://fzyzcjy.github.io/flutter_rust_bridge/guides/miscellaneous/whats-new for what's changed in V2. +* Support brackets and nesting in pub use (such as pub use `a::{b, x::{y,z}}`) #2120 +* Support providing configuration both by command line and by config file at the same time #2119 +* Tell user reasons when skipping traits #2121 +* Update default template comments #2118 +* Allow using arbitrary frb attribute as an indicator to include an item #2121 +* Improve hints when user specify custom wasm-pack-rustflags but does not contain default one #2122 + ## 2.0.0-dev.41 * Please refer to https://fzyzcjy.github.io/flutter_rust_bridge/guides/miscellaneous/whats-new for what's changed in V2. diff --git a/website/docs/guides/custom/codegen.md b/website/docs/guides/custom/codegen.md index 9873e6c2cc..8b78b576c6 100644 --- a/website/docs/guides/custom/codegen.md +++ b/website/docs/guides/custom/codegen.md @@ -4,6 +4,9 @@ It is equivalent to provide a parameter using the three approaches below. +In addition, you can provide configs by both configuration file / pubspec.yaml and command line at the same time. +The latter takes precedence when in conflict. + ### Configuration file The suggested mode to run `flutter_rust_bridge_codegen`, diff --git a/website/docs/guides/misc-features/modules.md b/website/docs/guides/misc-features/modules.md new file mode 100644 index 0000000000..3820ed48db --- /dev/null +++ b/website/docs/guides/misc-features/modules.md @@ -0,0 +1,23 @@ +# Modules + +:::info +Currently, only commonly used module syntaxes are supported +(feel free to create an issue if you need something not implemented yet). +When implementing more sophisticated module grammar parser, +it is possible to have breaking changes caused by improved understanding of modules not following semver. +However, such changes are usually trivial to migrate. +::: + +## Support of modules + +Since `flutter_rust_bridge` utilizes cargo-expand to understand the source code, +many Rust module grammar are supported automatically. +For example, `mod something;` and `mod another_inline_module { ... }` are both allowed. + +## Support of `pub use` + +It is supported to have code like: + +* `pub use a::b::c;` (normal imports) +* `pub use a::b::*;` (wildcard imports) +* `pub use a::{b, x::{y,z}};` (multiple imports even with such nesting) diff --git a/website/docs/guides/traits/implementations.md b/website/docs/guides/traits/implementations.md index eb8fd4a66c..227215ff35 100644 --- a/website/docs/guides/traits/implementations.md +++ b/website/docs/guides/traits/implementations.md @@ -3,6 +3,12 @@ The `impl A for B` is supported, and is translated to a `class B implements A`. In addition, the methods inside this `impl` block will also be converted automatically. +## Unignore a function + +Some trait implementations are ignored by default to avoid generating meaningless things to Dart side such as `clone` and `deref`. +However, if a function is ignored while you want it, you can put arbitrary attributes on it to tell flutter_rust_bridge you want it. +For example, `#[frb] fn f() { .. }` suffices. Attributes with real contents like `#[frb(sync)] fn f() { .. }` also works. + ## Example For example, suppose we write down: diff --git a/website/sidebars.js b/website/sidebars.js index c274bcd2f4..492697be6d 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -295,6 +295,7 @@ const sidebars = { 'guides/misc-features/preambles', 'guides/misc-features/proxy', 'guides/misc-features/multi-input', + 'guides/misc-features/modules', 'guides/misc-features/dart-type-rename', 'guides/misc-features/ignoring', 'guides/misc-features/override-prefix',