Skip to content

Commit

Permalink
chore: doc
Browse files Browse the repository at this point in the history
  • Loading branch information
fzyzcjy committed Jun 20, 2024
1 parent d699cdb commit eaca5e2
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 0 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
3 changes: 3 additions & 0 deletions website/docs/guides/custom/codegen.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
Expand Down
23 changes: 23 additions & 0 deletions website/docs/guides/misc-features/modules.md
Original file line number Diff line number Diff line change
@@ -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)
6 changes: 6 additions & 0 deletions website/docs/guides/traits/implementations.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions website/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit eaca5e2

Please sign in to comment.