Skip to content

[rfw] Remove the RFW WASM example #9551

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

Merged
merged 1 commit into from
Jul 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion customer_testing.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ pushd packages/rfw

# Update the subpackages so that the analysis doesn't get confused.
pushd example/remote; flutter packages get; popd
pushd example/wasm; flutter packages get; popd
pushd test_coverage; dart pub get; popd

flutter analyze --no-fatal-infos
Expand Down
1 change: 1 addition & 0 deletions packages/rfw/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## NEXT

* Updates minimum supported SDK version to Flutter 3.27/Dart 3.6.
* Removes the wasm example.

## 1.0.31

Expand Down
18 changes: 8 additions & 10 deletions packages/rfw/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -582,11 +582,9 @@ The last kind of argument that widgets can have is callbacks.

Since remote widget libraries are declarative and not code, they
cannot represent executable closures. Instead, they are represented as
events. For example, here is how the "7" button from the
[calculator example](https://github.com/flutter/packages/blob/main/packages/rfw/example/wasm/logic/calculator.rfwtxt)
is represented:
events. For example:

<?code-excerpt "example/wasm/logic/calculator.rfwtxt (button7)"?>
<?code-excerpt "test/readme_test.dart (button7)"?>
```rfwtxt
CalculatorButton(label: "7", onPressed: event "digit" { arguments: [7] }),
```
Expand All @@ -600,7 +598,7 @@ In that example, `CalculatorButton` is itself a remote widget that is
defined in terms of a `Button`, and the `onPressed` argument
is passed to the `onPressed` of the `Button`, like this:

<?code-excerpt "example/wasm/logic/calculator.rfwtxt (CalculatorButton)"?>
<?code-excerpt "test/readme_test.dart (CalculatorButton)"?>
```rfwtxt
widget CalculatorButton = Padding(
padding: [8.0],
Expand Down Expand Up @@ -762,8 +760,8 @@ by calling
[`encodeLibraryBlob`](https://pub.dev/documentation/rfw/latest/formats/encodeLibraryBlob.html)
on the results of calling `parseLibraryFile`.

The example in `example/wasm` has some [elaborate remote
widgets](https://github.com/flutter/packages/blob/main/packages/rfw/example/wasm/logic/calculator.rfwtxt),
The example in `example/remote` has some [elaborate remote
widgets](https://github.com/flutter/packages/blob/main/packages/rfw/example/remote/remote_widget_libraries/counter_app2.rfwtxt),
including some that manipulate state (`Button`).

#### State
Expand All @@ -773,12 +771,12 @@ Buttons must react immediately (in milliseconds) and cannot wait for
logic that's possibly running on a remote server (maybe many hundreds
of milliseconds away).

The aforementioned `Button` widget in the `wasm` example tracks a
local "down" state, manipulates it in reaction to
The aforementioned `Button` widget in the `remote_widget_libraries` example
tracks a local "down" state, manipulates it in reaction to
`onTapDown`/`onTapUp` events, and changes the shadow and margins of
the button based on its state:

<?code-excerpt "example/wasm/logic/calculator.rfwtxt (Button)"?>
<?code-excerpt "example/remote/remote_widget_libraries/counter_app2.rfwtxt (Button)"?>
```rfwtxt
widget Button { down: false } = GestureDetector(
onTap: args.onPressed,
Expand Down
3 changes: 0 additions & 3 deletions packages/rfw/example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,3 @@ There are several examples.

* `remote` is a proof-of-concept showing files being obtained from a
remote server and rendered by the application at runtime.

* `wasm` shows how package:rfw can be combined with package:wasm to
configure logic as well as the user interface at runtime.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ widget Counter = Container(
),
);

// #docregion Button
widget Button { down: false } = GestureDetector(
onTap: args.onPressed,
onTapDown: set state.down = true,
Expand Down Expand Up @@ -57,3 +58,4 @@ widget Button { down: false } = GestureDetector(
),
),
);
// #enddocregion Button
46 changes: 0 additions & 46 deletions packages/rfw/example/wasm/.gitignore

This file was deleted.

10 changes: 0 additions & 10 deletions packages/rfw/example/wasm/.metadata

This file was deleted.

3 changes: 0 additions & 3 deletions packages/rfw/example/wasm/.pluginToolsConfig.yaml

This file was deleted.

45 changes: 0 additions & 45 deletions packages/rfw/example/wasm/README.md

This file was deleted.

96 changes: 0 additions & 96 deletions packages/rfw/example/wasm/lib/main.dart

This file was deleted.

1 change: 0 additions & 1 deletion packages/rfw/example/wasm/linux/.gitignore

This file was deleted.

Loading