[PR #2231] [CLOSED] Dispatch events over gRPC #5161

Closed
opened 2026-03-23 22:17:31 +00:00 by mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/AppFlowy-IO/AppFlowy/pull/2231
Author: @abichinger
Created: 4/10/2023
Status: Closed

Base: mainHead: feat/flowy-grpc


📝 Commits (8)

  • a13ccb4 feat: add flowy-grpc
  • eaca6fc fix: FToast appearing behind popup
  • 04bdbd8 fix: init default directory if saved location fails
  • 2b6f641 feat: add CloudLocationDialog
  • 61f2524 fix: switch cloud locations
  • f0c8386 refactor: move ffiPort into FFIDispatcher
  • eb96b54 fix: CloudLocationDialog typo
  • eb23ca2 fix: add static runtime

📊 Changes

23 files changed (+840 additions, -151 deletions)

View changed files

📝 .dockerignore (+2 -1)
Dockerfile (+54 -0)
📝 frontend/appflowy_flutter/lib/startup/tasks/rust_sdk.dart (+10 -4)
📝 frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/settings_file_customize_location_view.dart (+77 -2)
📝 frontend/appflowy_flutter/packages/appflowy_backend/lib/appflowy_backend.dart (+11 -10)
📝 frontend/appflowy_flutter/packages/appflowy_backend/lib/dispatch/dispatch.dart (+152 -18)
📝 frontend/appflowy_flutter/packages/appflowy_backend/lib/rust_stream.dart (+6 -7)
📝 frontend/appflowy_flutter/packages/appflowy_backend/pubspec.yaml (+1 -0)
📝 frontend/appflowy_flutter/packages/flowy_infra_ui/lib/src/flowy_overlay/flowy_overlay.dart (+3 -6)
📝 frontend/appflowy_flutter/pubspec.lock (+23 -9)
📝 frontend/rust-lib/Cargo.lock (+181 -76)
📝 frontend/rust-lib/Cargo.toml (+1 -0)
📝 frontend/rust-lib/dart-ffi/src/lib.rs (+7 -1)
📝 frontend/rust-lib/flowy-core/src/lib.rs (+5 -3)
frontend/rust-lib/flowy-grpc/Cargo.toml (+25 -0)
frontend/rust-lib/flowy-grpc/build.rs (+4 -0)
frontend/rust-lib/flowy-grpc/proto/flowygrpc.proto (+31 -0)
frontend/rust-lib/flowy-grpc/src/server.rs (+166 -0)
📝 frontend/rust-lib/flowy-notification/src/lib.rs (+62 -5)
📝 frontend/rust-lib/flowy-test/Cargo.toml (+1 -0)

...and 3 more files

📄 Description

I have been playing around with gRPC as an alternative to dart:ffi. So far I only tried it on my local system with a single user.

Generating dart files

mkdir appflowy_flutter/packages/appflowy_backend/lib/protobuf/flowy-grpc
protoc --dart_out=grpc:appflowy_flutter/packages/appflowy_backend/lib/protobuf/flowy-grpc -I rust-lib/flowy-grpc/proto flowygrpc.proto

The code generation should be done inside flowy_codegen, but I couldn't figure out how to do that.

Running the server

cd rust-lib/flowy-grpc
RUST_LOG=trace cargo run --bin grpc-server

using docker:

docker build -t appflowy-grpc .
docker run -d -p 50051:50051 --name appflowy appflowy-grpc

Feature Preview

https://user-images.githubusercontent.com/8122139/231019141-50776546-c40c-4de0-888b-ee76123dfc02.mp4


PR Checklist

  • My code adheres to the AppFlowy Style Guide
  • I've listed at least one issue that this PR fixes in the description above.
  • I've added a test(s) to validate changes in this PR, or this PR only contains semantic changes.
  • All existing tests are passing.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/AppFlowy-IO/AppFlowy/pull/2231 **Author:** [@abichinger](https://github.com/abichinger) **Created:** 4/10/2023 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/flowy-grpc` --- ### 📝 Commits (8) - [`a13ccb4`](https://github.com/AppFlowy-IO/AppFlowy/commit/a13ccb4068ad06f10112e12e89b7f2a78dc41a54) feat: add flowy-grpc - [`eaca6fc`](https://github.com/AppFlowy-IO/AppFlowy/commit/eaca6fc195c9be2ca0ad5b3383b204e7661952b9) fix: FToast appearing behind popup - [`04bdbd8`](https://github.com/AppFlowy-IO/AppFlowy/commit/04bdbd8fbd6eb85774034057dbd6259d2634e083) fix: init default directory if saved location fails - [`2b6f641`](https://github.com/AppFlowy-IO/AppFlowy/commit/2b6f641fa66e0db9ff1139b076f8f87e815552cc) feat: add CloudLocationDialog - [`61f2524`](https://github.com/AppFlowy-IO/AppFlowy/commit/61f2524e6b9b691b7091a4ef3d1423655668f91d) fix: switch cloud locations - [`f0c8386`](https://github.com/AppFlowy-IO/AppFlowy/commit/f0c83865f96923e57936718cce7eb4f5d257cc04) refactor: move ffiPort into FFIDispatcher - [`eb96b54`](https://github.com/AppFlowy-IO/AppFlowy/commit/eb96b54cf1122008287ebee1dd9eececaf39d8bf) fix: CloudLocationDialog typo - [`eb23ca2`](https://github.com/AppFlowy-IO/AppFlowy/commit/eb23ca257a375be89cd49cb68cbdcd92d446c63c) fix: add static runtime ### 📊 Changes **23 files changed** (+840 additions, -151 deletions) <details> <summary>View changed files</summary> 📝 `.dockerignore` (+2 -1) ➕ `Dockerfile` (+54 -0) 📝 `frontend/appflowy_flutter/lib/startup/tasks/rust_sdk.dart` (+10 -4) 📝 `frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/settings_file_customize_location_view.dart` (+77 -2) 📝 `frontend/appflowy_flutter/packages/appflowy_backend/lib/appflowy_backend.dart` (+11 -10) 📝 `frontend/appflowy_flutter/packages/appflowy_backend/lib/dispatch/dispatch.dart` (+152 -18) 📝 `frontend/appflowy_flutter/packages/appflowy_backend/lib/rust_stream.dart` (+6 -7) 📝 `frontend/appflowy_flutter/packages/appflowy_backend/pubspec.yaml` (+1 -0) 📝 `frontend/appflowy_flutter/packages/flowy_infra_ui/lib/src/flowy_overlay/flowy_overlay.dart` (+3 -6) 📝 `frontend/appflowy_flutter/pubspec.lock` (+23 -9) 📝 `frontend/rust-lib/Cargo.lock` (+181 -76) 📝 `frontend/rust-lib/Cargo.toml` (+1 -0) 📝 `frontend/rust-lib/dart-ffi/src/lib.rs` (+7 -1) 📝 `frontend/rust-lib/flowy-core/src/lib.rs` (+5 -3) ➕ `frontend/rust-lib/flowy-grpc/Cargo.toml` (+25 -0) ➕ `frontend/rust-lib/flowy-grpc/build.rs` (+4 -0) ➕ `frontend/rust-lib/flowy-grpc/proto/flowygrpc.proto` (+31 -0) ➕ `frontend/rust-lib/flowy-grpc/src/server.rs` (+166 -0) 📝 `frontend/rust-lib/flowy-notification/src/lib.rs` (+62 -5) 📝 `frontend/rust-lib/flowy-test/Cargo.toml` (+1 -0) _...and 3 more files_ </details> ### 📄 Description I have been playing around with gRPC as an alternative to `dart:ffi`. So far I only tried it on my local system with a single user. ### Generating dart files ``` mkdir appflowy_flutter/packages/appflowy_backend/lib/protobuf/flowy-grpc protoc --dart_out=grpc:appflowy_flutter/packages/appflowy_backend/lib/protobuf/flowy-grpc -I rust-lib/flowy-grpc/proto flowygrpc.proto ``` The code generation should be done inside `flowy_codegen`, but I couldn't figure out how to do that. ### Running the server ``` cd rust-lib/flowy-grpc RUST_LOG=trace cargo run --bin grpc-server ``` using docker: ``` docker build -t appflowy-grpc . docker run -d -p 50051:50051 --name appflowy appflowy-grpc ``` ### Feature Preview https://user-images.githubusercontent.com/8122139/231019141-50776546-c40c-4de0-888b-ee76123dfc02.mp4 <!--- List at least one issue here that this PR addresses. If it fixes the issue, please use the [fixes](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests) keyword to close the issue. For example: fixes https://github.com/AppFlowy-IO/AppFlowy/pull/2106 --> --- <!--- Before you mark this PR ready for review, run through this checklist! --> #### PR Checklist - [ ] My code adheres to the [AppFlowy Style Guide](https://appflowy.gitbook.io/docs/essential-documentation/contribute-to-appflowy/software-contributions/submitting-code/style-guides) - [ ] I've listed at least one issue that this PR fixes in the description above. - [ ] I've added a test(s) to validate changes in this PR, or this PR only contains semantic changes. - [ ] All existing tests are passing. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
mirror 2026-03-23 22:17:31 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AppFlowy-IO/AppFlowy#5161
No description provided.