Introducing the Nexus Protocol for Flutter + FaaS Integrated Development
The Nexus protocol unifies Flutter UI and FaaS function development by using a shared Dart runtime and an Action‑based messaging layer—handled by the LogicEngine—to trigger remote requests, native APIs, and state changes, enabling hot‑reload, incremental JsonPatch updates, and a seamless client‑server integration model.
Background: Serverless aims to let developers focus on application logic, and FaaS is a lightweight, event‑driven implementation of Serverless.
Alibaba's Xianyu team adopts a Flutter + FaaS model to achieve cloud‑native integrated development. The internal terms Logic_engine and Nexus_Framework have been used to support this integration.
Today we introduce the Nexus protocol, the underlying player of this integration.
Origin of the Nexus protocol
Initially the team only understood “integration” as using Dart for both Flutter UI and FaaS functions, but the concrete design was unclear.
Through discussions the team defined integration as two aspects:
Language integration
Development‑mode and architecture integration
The goal is to eliminate the gap between Flutter page development and FaaS function development.
Language integration
Flutter uses Dart, so the same language is used for FaaS. A modified Dart runtime was ported to the internal Gaïa FaaS platform, enabling hot‑reload on both client and server.
Development‑mode and architecture integration
The team wants developers to treat the Flutter page and the FaaS function as a single system. Traditional front‑end/back‑end separation is replaced by a unified call model.
The Nexus protocol is designed as an Action ‑based message that can trigger remote requests, native API calls, or state changes. Typical UI initialization follows the flow remote req → state change → render.
Three core actions cover most scenarios:
UI rendering (state change)
Side‑effect handling (nativeapi)
Custom actions for complex interactions
State updates can be sent as full state or as incremental JsonPatch objects.
The LogicEngine acts as the executor of the Nexus protocol. Developers register functions to the engine as Action handlers. Calls are issued via a post function, which may execute locally or on FaaS.
In summary, the Nexus protocol provides a unified, Action‑driven communication layer between client and FaaS, enabling seamless UI updates and side‑effect handling.
Future work includes moving from JSON to a type‑safe IDL and supporting bidirectional calls.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
