Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
d45a4af
feat(compiler): add dart gRPC streaming-rejection gate
yash-agarwa-l May 30, 2026
c60a6a3
feat(compiler): emit dart grpc skeleton with codec helpers
yash-agarwa-l May 30, 2026
f7fd3ac
feat(compiler): emit dart grpc Client class
yash-agarwa-l May 30, 2026
32a6003
feat(compiler): emit dart grpc ServiceBase class
yash-agarwa-l May 30, 2026
ce9f651
feat(compiler): detect dart grpc class-name collisions
yash-agarwa-l May 30, 2026
d97f71c
feat(compiler): detect dart grpc method-name collisions
yash-agarwa-l May 30, 2026
e59a305
test(compiler): cover dart grpc codegen from proto and fbs frontends
yash-agarwa-l May 30, 2026
93b2e5e
test(compiler): include dart in parametric service-codegen tests
yash-agarwa-l May 30, 2026
71c3d9e
test(compiler): add opt-in dart analyze smoke test
yash-agarwa-l May 30, 2026
34fd564
fix(compiler): emit dart-format-clean dart grpc output
yash-agarwa-l May 31, 2026
2f7d69e
style(compiler): ruff format dart grpc files
yash-agarwa-l Jun 2, 2026
2defb2a
Merge remote-tracking branch 'upstream/main' into grpc-dart
yash-agarwa-l Jun 15, 2026
755bd6e
feat(compiler): emit dart grpc streaming methods
yash-agarwa-l Jun 15, 2026
4292d30
test(grpc): add java-dart grpc interop test
yash-agarwa-l Jun 15, 2026
e75e61f
style(compiler): ruff format test service file
yash-agarwa-l Jun 15, 2026
f6880f4
docs: document dart grpc support
yash-agarwa-l Jun 15, 2026
d7a591b
Merge remote-tracking branch 'upstream/main' into grpc-dart
yash-agarwa-l Jun 17, 2026
d33b55d
feat(compiler): make dart grpc self-sufficient with payload type reso…
yash-agarwa-l Jun 17, 2026
0025c4a
docs: align dart grpc docs and agent guidance with the auto-ready For…
yash-agarwa-l Jun 17, 2026
b602021
test(grpc): exercise all schemas in dart interop, rename to DartGrpcT…
yash-agarwa-l Jun 17, 2026
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
2 changes: 2 additions & 0 deletions .agents/languages/dart.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Load this file when changing `dart/`.
- Generated struct serializers should use serializer-owned field descriptors for runtime resolver decisions and emit direct field-specific write/read code for static schemas. Do not route generated hot writes through generic field-info value helpers such as `writeGeneratedStructFieldInfoValue`.
- Dart xlang or runtime ownership changes need local Dart package tests plus the Java-driven `DartXlangTest`; package-only smoke tests are not enough.
- When claiming non-VM Dart support, prove a relevant non-VM compile path such as `dart compile js` against active runtime or example code.
- Generated Dart gRPC service companions (`<stem>_grpc.dart`) are compiler-owned files that depend on the application-provided `grpc` package, not `dart/packages/fory`. Keep gRPC dependencies out of the Fory Dart runtime package.
- Dart generated schema modules (`<Stem>ForyModule`) are the source-file owners and own a ready `Fory` runtime: `getFory()` initializes a default runtime and registers the schema's types on first use, so generated gRPC companions never require a manual `install(...)`; `install(customFory)` stays optional injection. Keep `getFory()` ready by construction, and do not introduce package-derived aliases or duplicate serializer registration paths.

## Commands

Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -855,6 +855,55 @@ jobs:
cd integration_tests/grpc_tests/java
mvn -T16 --no-transfer-progress -Dtest=KotlinGrpcTest test

grpc_java_dart_tests:
name: Java/Dart gRPC Tests
needs: changes
if: needs.changes.outputs.grpc_tests == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: 21
distribution: "temurin"
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.11
cache: "pip"
- name: Set up Dart
uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c # v1.7.1
with:
sdk: stable
- name: Cache Maven local repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Install Java artifacts for gRPC tests
run: |
cd java
mvn -T16 --no-transfer-progress clean install -DskipTests -Dmaven.javadoc.skip=true -Dmaven.source.skip=true
- name: Generate gRPC test sources
run: python integration_tests/grpc_tests/generate_grpc.py
- name: Build Dart gRPC peer
run: |
cd integration_tests/grpc_tests/dart
dart pub get
dart run build_runner build
- name: Analyze and format-check generated Dart gRPC companions
run: |
cd integration_tests/grpc_tests/dart
dart analyze bin lib/generated/*/*_grpc.dart
dart format --output=none --set-exit-if-changed bin lib/generated/*/*_grpc.dart
- name: Run Java/Dart gRPC Tests
run: |
cd integration_tests/grpc_tests/java
mvn -T16 --no-transfer-progress -Dtest=DartGrpcTest test

javascript:
name: JavaScript CI
needs: changes
Expand Down
9 changes: 6 additions & 3 deletions compiler/fory_compiler/generators/dart.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

from fory_compiler.frontend.utils import parse_idl_file
from fory_compiler.generators.base import BaseGenerator, GeneratedFile
from fory_compiler.generators.services.dart import DartServiceGeneratorMixin
from fory_compiler.ir.ast import (
ArrayType,
Enum,
Expand All @@ -40,7 +41,7 @@
from fory_compiler.ir.types import PrimitiveKind


class DartGenerator(BaseGenerator):
class DartGenerator(DartServiceGeneratorMixin, BaseGenerator):
language_name = "dart"
file_extension = ".dart"

Expand Down Expand Up @@ -1291,8 +1292,10 @@ def generate_module_type(self, indent: int) -> List[str]:
lines.extend(
[
f"{self.indent_str * (indent + 1)}static Fory getFory() {{",
f"{self.indent_str * (indent + 2)}final fory = _fory;",
f"{self.indent_str * (indent + 2)}if (fory == null) throw StateError('Call {self.module_type_name()}.install(...) before using generated helpers.');",
f"{self.indent_str * (indent + 2)}final existing = _fory;",
f"{self.indent_str * (indent + 2)}if (existing != null) return existing;",
f"{self.indent_str * (indent + 2)}final fory = Fory();",
f"{self.indent_str * (indent + 2)}install(fory);",
f"{self.indent_str * (indent + 2)}return fory;",
f"{self.indent_str * (indent + 1)}}}",
"",
Expand Down
Loading
Loading