Skip to content
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

Remote Flutter Widgets (rfw) package feedback thread #90218

Open
Hixie opened this issue Sep 16, 2021 · 77 comments
Open

Remote Flutter Widgets (rfw) package feedback thread #90218

Hixie opened this issue Sep 16, 2021 · 77 comments
Assignees
Labels
p: rfw Remote Flutter Widgets package P3 Issues that are less important to the Flutter project package flutter/packages repository. See also p: labels. team-ecosystem Owned by Ecosystem team triaged-ecosystem Triaged by Ecosystem team

Comments

@Hixie
Copy link
Contributor

Hixie commented Sep 16, 2021

This issue is intended to collect feedback regarding the rfw package.

If you have found a bug with RFW, please file a new issue. This issue is specifically for discussing the package's general applicability to your use cases, to determine if this is a useful direction for us to follow, and to report experiences you may have with writing applications with this package. Thanks in advance.

@Hixie Hixie added p: rfw Remote Flutter Widgets package package flutter/packages repository. See also p: labels. labels Sep 16, 2021
@Hixie Hixie self-assigned this Sep 16, 2021
@shuoch-g
Copy link

Hi, Ian,

Very thrilled to see flutter team's effort on the dynamic UI ! We are evaluating on how to leverage rfw in our project.

First of all, may I ask about the compatibility policy we will have in rfw ?

In our project we will send down configuration data from server (DynamicMap analogue in rfw) and our runtime evaluator will translate them to widget constructor calls. As the evaluator code (decoder + WidgetBuilder analogue in rfw) is released with our app's apk, we want the server returned configuration to be always compatible with the evaluator that is released in a client version.

This is how we solve this: For each client release, we will snapshot the "capabilities" of the evaluator by the branch cut. The capabilities include

  1. which set of widgets are supported, and their names.
  2. which set of arguments are supported for each widget, and their name/type.

these snapshot capabilities data will be kept in our database, and keyed by the app release version.

Before the configuration data is sent to client with version A, we will retrieve the capabilities data for version A, and go through all configuration data and validate that all configuration key/value are supported in the capabilities. Our feature is authored in a single place, but when releasing to different client versions we will do tree-shaking or branching and release different configuration data targeting different client apk versions.

Could rfw package provide an interface that returns a structured data object that encodes all widgets / arguments its WidgetBuilders can support ? If it makes sense to you, happy to contribute as well.

@Hixie
Copy link
Contributor Author

Hixie commented Sep 29, 2021

Right now there's no compatibility policy but there could be one. I think it makes sense to have a policy that we never break things.

I don't know how easy it would be to accurately return what the supported API is. You can get the list of widgets easily enough by querying the map of constructors, but getting the arguments is non-trivial.

@Hixie

This comment has been minimized.

@Hixie

This comment has been minimized.

@shuoch-g
Copy link

shuoch-g commented Oct 11, 2021

This package is not part of the flutter core repo, but a critical contribution to the flutter community.

Flutter as a cross-platform app development framework lacks a go-to solution to let server dynamically control the runtime behavior.
Meanwhile, some important platforms that flutter can support (namely, Android, iOS) have seen such solutions, from early days of PhoneGap, to ReactNative, etc. If I used to enjoy the dynamic server release cycle while working on Android/iOS, but then have to discard if I migrate to Flutter, it would be very under expectation. Go to flutter community and the quest to have dynamic release support is clearly there (see reactions to #14330 (comment)), this package is not solving a non-critical problem at all.

Even today there are quite a lot of solutions in the flutter community to tackle the same problem space, e,g https://github.com/Tencent/mxflutter. Many such solutions can benefit from this package if it can provide an official server payload specifications on widget constructions. #14330 (comment)

@fzyzcjy
Copy link
Contributor

fzyzcjy commented Jan 8, 2022

@Hixie As suggested by you a few months ago, we are interested in cooperating rfw with flutter_rust_bridge. Could you please provide some suggestions on the details?

Related: fzyzcjy/flutter_rust_bridge#296

@Hixie
Copy link
Contributor Author

Hixie commented Jan 8, 2022

(responded in the other issue — thanks!)

@mhoad
Copy link

mhoad commented Mar 12, 2022

@Hixie I only just came across this package yesterday and haven’t had a chance to kick the tires on it yet but I’m incredibly optimistic about this direction especially when it comes to app delivery and I am curious to hear your thoughts about what kinds of ways this could be extended and built upon in the future.

One of the things I find hardest with Flutter web currently is just how much code I have to ship to get that first frame on the screen and the lack of modularity compared to say how I might deliver a regular HTML / JS / CSS based web app.

It also gives me more control it seems over what kind of experience I want to render for what kind of user which I appreciate because again I feel like currently I’m in a position where I need to ship all possible set of experiences not only when the user might only want a tiny fraction of them but I have to do all of this before I even render a frame which is upsetting for everyone.

I would love to see what a Flutter application server could look like.

@Hixie
Copy link
Contributor Author

Hixie commented Mar 18, 2022

This technique doesn't reduce the amount of code you have to send down, really, since you still have to send the whole Flutter engine and the whole framework, but certainly something using this or another solution along this lines could give you more flexibility in terms of what the application does.

@dengzq
Copy link

dengzq commented Apr 1, 2022

Hi! Thanks for doing this for dynamic ui !
Here we can already map the widgets that we support and render them. But how can we do for dynamic logic ? For example , logic in tap() method or other calculation logic.

Are there any solutions for logic dynamic? Thanks a lot.

@hmbenhaim
Copy link

Hi thanks for the package, I always wanted dynamic widget like you have in html,
Just wanted to ask will you add like regular imports for consistency, like import "package:flutter/material.dart" it will be a lot easier to manage the code this way,

@Hixie
Copy link
Contributor Author

Hixie commented May 12, 2022

@hmbenhaim do you mean from an .rfwtxt file?

@0xchase
Copy link

0xchase commented Jul 18, 2022

Hey, I just wanted to add that I've found this package useful in designing a (sort of) interactive UI designer for my app. I hope it continues to be developed and maintained.

@isAlmogK
Copy link

isAlmogK commented Dec 4, 2022

Hi, I have a couple of questions and hope someone from the team can help; in general, this could be very useful, especially if you need to load custom widgets for enterprise customers, at least in our use case.

My first question is whether there are plans to support this package, as I see there has not been a big use case. The second question would it be possible to load the following into a widget build method from, let's say Firestore

MultiSelect(
                onSaved: (val) {
                  setState(() {
                    for (final element in commandsType) {
                      final contain =
                          commandTypeName.where((item) => item == element.name);
                      if (contain.isEmpty) {
                        commandTypeName.add(element.name as String);
                      }
                    }
                    dynamicTrainingType.commands =
                        commandTypeName.cast<String>();
                  });
                },
                buttonText: 'Select Commands',
                items: _commandItems,
                initialVue: commandsType,
                onConfirm: (dynamic vr) {
                  setState(() {
                    dynamicTrainingType.commands?.clear();
                    commandsType = vr as List<dynamic>;
                  });
                },
              ),

@Hixie
Copy link
Contributor Author

Hixie commented Dec 4, 2022

@isAlmogK Can you elaborate on what you mean by "support" exactly?

For the second question, I'm not sure I understand exactly what you are asking; in general package:rfw does not allow imperative code to be sent from the server, only declarative widgets. You could send code as JavaScript or Wasm or some such though. If you have a clearer description of your use case I could try to advise in more detail.

@dkbast
Copy link

dkbast commented Dec 13, 2022

Just wanted to give this another try (had it working when it first came out but didn't have a usecase then, now I do), but currently I'm unable to run the example/wasm app, no matter the plattform I get an error that wasm could not be initialized, this happens in the build method of the example widget:

[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: WasmError: Wasm library not found. Did you `dart run wasm:setup`?
#0      _getLibPath (package:wasm/src/runtime.dart:119:3)
#1      new WasmRuntime._init (package:wasm/src/runtime.g.dart:118:52)
#2      runtime (package:wasm/src/runtime.dart:20:29)
#3      runtime (package:wasm/src/runtime.dart)
#4      new WasmModule (package:wasm/src/module.dart:21:14)
#5      _ExampleState._loadLogi

from what I see wasm was initialized correctly - I'm on a M1 mac.

wasm ➤ dart run wasm:setup                                                                                                                                                                                                                                              git:main*
Dart SDK directory: /opt/homebrew/Caskroom/flutter/2.5.3/flutter/bin/cache/dart-sdk/
Dart SDK include directory: /opt/homebrew/Caskroom/flutter/2.5.3/flutter/bin/cache/dart-sdk/include/
Source directory: /Users/userhome/.pub-cache/hosted/pub.dartlang.org/wasm-0.1.0+1/bin/
Output directory: /Users/userhome/src/github.com/flutter/packages/packages/rfw/example/wasm/.dart_tool/wasm/
Target: aarch64-apple-darwin
OS: darwin
Output library: /Users/userhome/src/github.com/flutter/packages/packages/rfw/example/wasm/.dart_tool/wasm/libwasmer.dylib

cargo build --target aarch64-apple-darwin --target-dir /Users/userhome/src/github.com/flutter/packages/packages/rfw/example/wasm/.dart_tool/wasm/ --manifest-path /Users/userhome/.pub-cache/hosted/pub.dartlang.org/wasm-0.1.0+1/bin/Cargo.toml --release

    Finished release [optimized] target(s) in 0.17s

clang -DDART_SHARED_LIB -DNDEBUG -fno-exceptions -fPIC -O3 -target aarch64-apple-darwin -I /opt/homebrew/Caskroom/flutter/2.5.3/flutter/bin/cache/dart-sdk/include/ -I /Users/userhome/src/github.com/flutter/packages/packages/rfw/example/wasm/.dart_tool/wasm/include/ -c /opt/homebrew/Caskroom/flutter/2.5.3/flutter/bin/cache/dart-sdk/include/dart_api_dl.c -o /Users/userhome/src/github.com/flutter/packages/packages/rfw/example/wasm/.dart_tool/wasm/dart_api_dl.o


clang++ -DDART_SHARED_LIB -DNDEBUG -fno-exceptions -fno-rtti -fPIC -O3 -std=c++11 -target aarch64-apple-darwin -I /opt/homebrew/Caskroom/flutter/2.5.3/flutter/bin/cache/dart-sdk/include/ -I /Users/userhome/src/github.com/flutter/packages/packages/rfw/example/wasm/.dart_tool/wasm/include/ -c /Users/userhome/.pub-cache/hosted/pub.dartlang.org/wasm-0.1.0+1/bin/finalizers.cc -o /Users/userhome/src/github.com/flutter/packages/packages/rfw/example/wasm/.dart_tool/wasm/finalizers.o


clang++ -shared -fPIC -target aarch64-apple-darwin /Users/userhome/src/github.com/flutter/packages/packages/rfw/example/wasm/.dart_tool/wasm/dart_api_dl.o /Users/userhome/src/github.com/flutter/packages/packages/rfw/example/wasm/.dart_tool/wasm/finalizers.o /Users/userhome/src/github.com/flutter/packages/packages/rfw/example/wasm/.dart_tool/wasm/aarch64-apple-darwin/release/libwasmer.a -o /Users/userhome/src/github.com/flutter/packages/packages/rfw/example/wasm/.dart_tool/wasm/libwasmer.dylib

@Hixie
Copy link
Contributor Author

Hixie commented Dec 13, 2022

Can you get the wasm package to work in isolation?

@dkbast
Copy link

dkbast commented Dec 14, 2022

-> looks like the hello_world example is running just fine

wasmtest ➤ dart run                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       git:main*
Building package executable... 
Built wasmtest:wasmtest.
1522756 == 1522756

had to reinstall rust, but still no luck with rfw, did initialise wasm with flutter pub run as well, so this is not the issue.

@Hixie
Copy link
Contributor Author

Hixie commented Dec 14, 2022

I have no idea... does it work on a Linux box? On this Linux machine, modulo some other issue I'm having with LIBGL, if I just check out the rfw repo and go into the example/wasm directory and run flutter pub run wasm:setup; flutter run -d linux it seems to work.

@dkbast
Copy link

dkbast commented Dec 14, 2022

Just hopped on my old Macbook with Intel processor and got the same error - the fact that the debug entitlements for network access are missing from macos/Runner/DebugProfile.entitlements leads me to believe that this has not been tested for macos? Because the example as is, is not runnable on a mac without adding this:

<key>com.apple.security.network.client</key>
<true/>

Currently I don't have access to another machine, but if it works on linux for you, thats good - that probably narrows this issue down to being mac specific (but not M1 mac specific)

@Hixie
Copy link
Contributor Author

Hixie commented Dec 14, 2022

Aah, yes, it is probably that exact problem, indeed.

@dkbast
Copy link

dkbast commented Dec 16, 2022

I just created a small script to checkout and run the wasm example on a mac machine, to make this easier to test and reproduce: https://gist.github.com/dkbast/6af0c48eda59817b525798743f737918

# A shell script which sets everything up to run the rfw wasm example
# Setup Rust:
brew install rustup
rustup-init
source "$HOME/.cargo/env"
# clone the project
git clone https://github.com/flutter/packages.git

cd packages/packages/rfw

cd example/wasm

# Add internet access to the debug entitlements:
echo '<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>com.apple.security.app-sandbox</key>
	<true/>
	<key>com.apple.security.cs.allow-jit</key>
	<true/>
	<key>com.apple.security.network.server</key>
    <true/>
    <key>com.apple.security.network.client</key>
    <true/>
</dict>
</plist>' > macos/Runner/DebugProfile.entitlements



# get dependencies
flutter pub get

# initialize wasm and build wasm runtime, this is why we need rust
flutter pub run wasm:setup

# build and run the wasm example
flutter run -d macos

@johnmccutchan
Copy link
Contributor

Can you elaborate on what you mean by "source maps" in this context?

imagine I have some rfw text that creates button widget with text fetchec from DynamicContent
using the key "foo.bar".

I'd like to be able to track what sections of the rfw text map to the Button (or any widget). Also which keys in the DynamicContent are used by the widget.

Think Chrome DevTools where you can hover over a DOM element and navigate to the HTML tag in the source view and vice versa.

@Hixie
Copy link
Contributor Author

Hixie commented Jan 6, 2024

Can you file two bugs, one for each of these requests? We can look into what it would take to implement that.

@tugorez
Copy link
Contributor

tugorez commented Jan 17, 2024

Filed #141658 to add support for widget builders.

@tugorez
Copy link
Contributor

tugorez commented Jan 17, 2024

Filed #141665 to discuss wheter it makes sense to break the existing parser implementation into multiple subpackages to facilitate evolving the RFW language.

@tugorez
Copy link
Contributor

tugorez commented Jan 17, 2024

Filed #141666 to discuss RFW ergonomics

@tugorez
Copy link
Contributor

tugorez commented Jan 17, 2024

Filed #141668 to register even more local widgets in RFW.

@tugorez
Copy link
Contributor

tugorez commented Jan 17, 2024

Filed #141669 to track adding more example apps to RFW.

@tugorez
Copy link
Contributor

tugorez commented Jan 17, 2024

Filed #141670 to track migrating some tests to use dart testing utils (instead of flutter testing utils).

@tugorez
Copy link
Contributor

tugorez commented Jan 17, 2024

Filed #141709 to notify developers about missmatching arguments.

@tugorez
Copy link
Contributor

tugorez commented Jan 21, 2024

Filed #141948 to discuss/explore alternatives to rfwtxt.

@tugorez
Copy link
Contributor

tugorez commented Jan 21, 2024

@Hixie what happens if an RFW library imports two other libraries that contain a widget with the same name? Does the RFW compiler throw? One shadows the other? Do we have a mechanism to deal with that in place? Curious if you gave it a thought already. Also happy to file a new issue to discuss the language itself.

import core1; // Has a container definition
import core2; // Has a container defition as well

widget root = Container();

BTW I'm new to github so please let me know if I'm using gh issues the wrong way by using them as subthreads of this discussion.

@Hixie
Copy link
Contributor Author

Hixie commented Jan 22, 2024

One shadows the other. There's a TODO somewhere about having enabling prefixes if it becomes a significant problem.

@ScottS2017
Copy link

ScottS2017 commented Apr 15, 2024

Regarding my experience and improving the Dev Exp, this package uses a docs approach that is seen in many places and it unfortunately doesn't always help.

E.G.: I'm trying to work with the core widgets and the syntax for doing so isn't clear. The examples given work fine, but when I start trying to add more parameters and other widgets, things break down. So I naturally go looking through the docs, in particular, createCoreWidgets( ) at https://pub.dev/documentation/rfw/latest/rfw/createCoreWidgets.html. There we find a list of widgets and English language descriptions of parameter syntax for exceptions to the norm. Since the English descriptions are not easy to visualize for someone who has never seen this package before, even if the person is a native English speaker like me, I clicked on some links for the widgets with the expectation I would find an RFW JSON example of how to implement each widget I clicked on.

Instead, I found they're just links back to the standard widget catalog. This is not helpful, because anyone working with RFW's core widgets is already going to be more than a little familiar with the listed widgets such as Container, Text, and so on. We don't need a refresher on how the normal widgets work, we need to see how to make each widget work with RFW.

As for the English language descriptions, here is the one for color:
"Color values are represented as integers. The hex literal values are most convenient for this, the alpha, red, green, and blue channels map to the 32 bit hex integer as 0xAARRGGBB."

But what we actually need is:
To use a Color parameter, simply use the hex value of the color without declaring a Color or Colors, like this: "color: 0xFFFF00FF,"

What prompted this reply is that I can't seem to make a TextStyle work no matter what I try. There is an English language entry in the docs for createCoreWidgets( ) that states, "For each, every parameter is implemented using the same name. Parameters that take structured types are represented using maps, with each named parameter of that type's default constructor represented by a key, with the following notable caveats and exceptions..."

When I read that my gut reaction was, "What on earth does that mean?? I'm more confused now than before I read that..."

TextStyle is not listed as an exception, so apparently I'm supposed to use a map in some way that I can't find an sample of in the examples "Hello" or Local (Remote and WASM don't contain JSON examples in their main.dart files.)

Here is the example of Text from the Hello example:
"Text(text: ["Hello, ", data.greet.name, "!"], textDirection: "ltr"),"

So far so good, until I try to use the same approach to change the color of the text:
Text(text: ["Hello, ", data.greet.name, "!"], textDirection: "ltr", style: TextStyle(color: 0xFF00FF00),),

This causes an error not in the Text, but in the widget after the Text: "Expected symbol ":" but found ( at line..."

Instead of just trying to find out about Text, I thought it better to go searching for a way to understand this whole approach because I'm sure there are dozens of other situations to which the same issue would apply.

In short, the very first thing a user should see after the general description of any package are examples of exactly which syntax the developer has to type on the keyboard in order to use it that package in an app. We need that far more than English language descriptions, and for people who aren't trained formally as engineers the lack of this in so much documentation is a never ending source of blockers, frustration, and slow downs. I can't even begin to tell you how often I read all sorts of docs for different packages and think, "Okay, that's what it's doing at a high level but how do I make it do something in my code? What exact syntax do I need to type with my fingers in order to get this thing to work?

One last point, this reminds me of when the core Flutter docs were so confusing because they were written by engineers on the team, for other engineers on the team, without much thought to whether or not the general public would be able to understand what they were reading. This is what was behind much of the effort to rewrite docs over the last few years. I wonder if the RFW contributors were writing these docs mainly for each other, rather than for the people who were coming to this cold, with no idea what any of it is about.

EDIT: Gemini 1.5 FTW. It helps to have a million token context in which you can load half the source code. It found the TextStyle encoder/decoder. In case anyone else is having similar issues, here is the actual syntax:

style: {
'color': 0xFF00FF00, // Green color
'fontSize': 24.0,
},

So it appears to be a matter of omitting some of the constructors from time to time, in this case TextStyle. We just put the constructor's parameters in a map:

parentClassParameterName: {
'childClassParameter': value, // Note the quotes around 'childClassParameter'
'otherChildClassParameter': value,
}

I can't guarantee that's correct in all cases, but it's good for TextStyle.

@Hixie
Copy link
Contributor Author

Hixie commented Apr 15, 2024

yeah, sorry for the poor quality documentation. there was a lot to document and i ran out of steam before getting to examples.

@uberchilly
Copy link

I didn't find a way to show double or int variables passed into the widget with the Text widget, because it only supports String and disregards other types, but there is also no easy way to inline convert double/int to string, or is there? One solution would be to provide local widgets like DoubleText and IntText, and do necessary conversions there, but is there any other way of doing this?

@Hixie
Copy link
Contributor Author

Hixie commented Apr 18, 2024

The simplest way is to have the data include both stringified and numeric versions.

@ScottS2017
Copy link

ScottS2017 commented Apr 18, 2024

@Hixie is there any chance you could just make a one screen widget that includes uses of color, padding (AnimatedPadding, I know), gradient, and other such things? I'm just thinking you could make a "kids watercolor" where you throw in a bunch of junk that doesn't really go together, but just shows us what syntax to use for each thing that's not done the same way normal Flutter code is done. I'm so very close to having Gemini be able to build almost anything. I've got it working already, but I keep hitting blockers that are only because I can't give it examples of what syntax to use. It's able to use anything I've been able to feed it, but there are a lot of things I don't know about this syntax.

I don't know a use case for Gemini controlling the screen remotely, and building it in whatever way the AI decides to, but you have to admit the idea is fascinating. Now I just have to figure out how to take it from parlor trick to something useful.
image

@ScottS2017
Copy link

ScottS2017 commented Apr 21, 2024

Here is a sample widget showing how some parameters are used. I plan to update this as I keep learning more.

Column(
  children: [
    SizedBox(
      width: 100.0,
      height: 4.0,
      child: ColoredBox(
        color: 0xFF0000FF, // Colors are just the hex value of the color.
      ),
   ),
    Container(
      width: 100.0,
      height: 50.0,
      color: 0xFFFFFF00, // Colors are just the hex value of the color.
      padding: [16.0,10.0,6.0,10.0,], // Padding is just four doubles. The order is LTRB.
      child: Text(
        text: ["Hello World"], // The text parameter is named, and is a list of strings.
        textDirection: "ltr",
        // The style parameter is a map. The keys TextStyle parameters. Note the values like color are still used without the Color or Colors constructors.
        style: {
          'color': 0xFF00FF00, // Colors are just the hex value of the color.
          'fontSize': 24.0,
        },
      ),
    ),
    Icon(
      icon: 0xE2A0, // Icons are just the hex value of the icon, don't use the IconData constructor.
      fontFamily: "MaterialIcons", // Specify the icon font family.
      color: 0xFFFF00FF, // Colors are just the hex value of the color.
      size: 30.0,
    ),
  ],
),

@uberchilly
Copy link

I want to contribute material widget -> Slider to the library but I don't have Linux machine to create and run the golden tests and they are skipped on mac and windows machines that I have, so my code coverage is not 100% without golden tests. What can I do?

@Hixie
Copy link
Contributor Author

Hixie commented Apr 25, 2024

Join the Discord and beg someone to do it for you. :-) (link in the contributor docs)
See also #147187

@uberchilly
Copy link

You can check my pull request for Slider widget

@ScottS2017
Copy link

ScottS2017 commented May 31, 2024

A couple of points:

  1. There are use cases that have to utilize rfw text, particularly LLMs that can only generate a text string. Yes, such an implementation is well underway. Please keep the text approach alive and kicking, despite it's inferior performance.

  2. The guide I started above is also well underway, and is currently over 750 lines of code. It has to be that way because to get an LLM to work with RFW I have to explain everything about the syntax and how it works in the prompt, and I have to explain it as if the LLM is a three-year-old. Once it's done, or close to, I can make a gist and link to it from here.

@Hixie
Copy link
Contributor Author

Hixie commented May 31, 2024

For use cases that generate text from LLMs, the recommended way to transmit the data to the client is to encode the generated text as the binary format on the server, and transmit that. That said, given the speed of LLMs today, the resulting performance improvement in likely insignificant.

@arcticfox1919
Copy link

I have a question that I hope can be answered. Is it necessary for all code to be written within a single rfwtxt file? When dealing with complex UI nesting, I would prefer to encapsulate the code into different rfwtxt source files, rather than writing everything in one rfwtxt file.

@ScottS2017
Copy link

For use cases that generate text from LLMs, the recommended way to transmit the data to the client is to encode the generated text as the binary format on the server, and transmit that. That said, given the speed of LLMs today, the resulting performance improvement in likely insignificant.

I'm a little confused by this because LLMs can only output text. I haven't been using a server, how would that work?

And I agree, the performance choke point is always going to be the LLM.

@rodydavis
Copy link
Contributor

Made a RFW realtime editor!

https://rodydavis.github.io/rfw_studio/

@Hixie
Copy link
Contributor Author

Hixie commented Jul 26, 2024

@arcticfox1919

I have a question that I hope can be answered. Is it necessary for all code to be written within a single rfwtxt file?

Nope, rfwtxt supports imports.

@ScottS2017

LLMs can only output text. I haven't been using a server, how would that work?

You would take the rfwtxt output from the LLM, encode it in the binary format, and send that.

@JeffOlajos
Copy link

We are developers of Flutter Markup Language. and would like to discuss possibilities re: integration of RFW into FML. I can be reached via email at jeff@appdaddy.co or on discord @appdaddy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p: rfw Remote Flutter Widgets package P3 Issues that are less important to the Flutter project package flutter/packages repository. See also p: labels. team-ecosystem Owned by Ecosystem team triaged-ecosystem Triaged by Ecosystem team
Projects
None yet
Development

No branches or pull requests