Skip to content

[rfw] Remote Flutter Widgets package#452

Merged
fluttergithubbot merged 3 commits intoflutter:masterfrom
Hixie:rfw
Sep 16, 2021
Merged

[rfw] Remote Flutter Widgets package#452
fluttergithubbot merged 3 commits intoflutter:masterfrom
Hixie:rfw

Conversation

@Hixie
Copy link
Contributor

@Hixie Hixie commented Aug 30, 2021

This package defines a format for describing Flutter widget trees in
text or binary files that can be loaded dynamically at runtime.

Pre-launch Checklist

  • The title of the PR starts with the name of the package surrounded by square brackets, e.g. [shared_preferences]
  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy.
  • I updated CHANGELOG.md to add a description of the change.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

@google-cla google-cla bot added the cla: yes label Aug 30, 2021
@Hixie Hixie force-pushed the rfw branch 4 times, most recently from 57a08b1 to 4d99d31 Compare September 1, 2021 22:49
@Hixie
Copy link
Contributor Author

Hixie commented Sep 1, 2021

For review purposes I have split this into two commits, one containing mostly only boilerplate from flutter create and mechanical changes like adding license blocks, and the other containing files that are potentially interesting to review.

@Hixie Hixie force-pushed the rfw branch 5 times, most recently from 8c21d72 to 70cc385 Compare September 2, 2021 04:45
@stuartmorgan-g
Copy link
Collaborator

For anything you want to temporarily exclude on stable, in .cirrus.yml replace:

- ./script/tool_runner.sh this-will-fail-on-stable ...

with:

# Exclude rfw until <insert version here> because <reason>
- if [[ "$CHANNEL" == "master" ]]; then
-   ./script/tool_runner.sh this-will-fail-on-stable ...
- else
-   ./script/tool_runner.sh this-will-fail-on-stable ... --exclude=rfw
- fi

(We don't need to do this often enough to have built this ability into the tool; if it becomes an issue we certainly could.)

@chgibb
Copy link

chgibb commented Sep 14, 2021

What are the intended use cases for this package?

@Hixie
Copy link
Contributor Author

Hixie commented Sep 14, 2021

@chgibb
Copy link

chgibb commented Sep 14, 2021

Thanks for pointing that out! Indeed it does.

It looks like the rfw language is very focused on declarative UI and is not Turing-complete. Is this an explicit design goal? Is the focus on server-driven UI / UI as configuration?

@Hixie
Copy link
Contributor Author

Hixie commented Sep 14, 2021

Yes, this package's goal is just declarative UI. Imperative scripting is a problem already solved by other technologies, such as JavaScript, Wasm, or Lua. Or Dart, in principle, though in practice today we don't have a good way to execute arbitrary Dart dynamically at runtime on phones.

@chgibb
Copy link

chgibb commented Sep 14, 2021

Enabling this kind of out of band functionality is something I am enthralled with. If you can point me to design documents, blogs or other content digging into the motivations for a first-party package like rfw, I would be incredibly grateful.

@Hixie
Copy link
Contributor Author

Hixie commented Sep 14, 2021

@chgibb All the documentation is in the PR itself (there's extensive dartdocs, the README, and four examples). This was just an experiment, there wasn't really a motivating factor beyond my playing with what we could do in the space of server-driven UIs, which is something people ask for occasionally (see the discussion of use cases in the README in the PR). If you have any specific questions I'm more than happy to answer them. :-)

This package defines a format for describing Flutter widget trees in
text or binary files that can be loaded dynamically at runtime.

(This commit contains interesting new files for review; boilerplate
files from `flutter create` et al are in the next commit.)
This package defines a format for describing Flutter widget trees in
text or binary files that can be loaded dynamically at runtime.

(This commit contains only boilerplate from flutter create et al.)
@Hixie
Copy link
Contributor Author

Hixie commented Sep 16, 2021

@dnfield I've added a commit which addresses the review comments found in: Hixie@8cb0765
Thanks for your review so far! Your suggestions have definitely improved the package.

Copy link
Contributor

@dnfield dnfield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. None of my outstanding comments are blocking.

@dnfield
Copy link
Contributor

dnfield commented Sep 16, 2021

(I must admit I have not carefully reviewed every line of code, but I did try to look more at docs and surface API, as well as tests, which look good enough to get this going to me)

late final WasmFunction _dataFetcher;

Future<void> _loadLogic() async {
final DateTime expiryDate = DateTime.now().subtract(const Duration(hours: 6));
Copy link

@treeplate treeplate Sep 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expireDate, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, ok

@Hixie
Copy link
Contributor Author

Hixie commented Sep 16, 2021

Thanks @dnfield!

@fluttergithubbot fluttergithubbot merged commit 881fccf into flutter:master Sep 16, 2021
stuartmorgan-g pushed a commit that referenced this pull request Oct 31, 2024
* Allow for a global override of how color filtering is handled wrt to the cache, and allow individual widgets to opt in or out

* update golden
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants