rpc_dart_generator 0.4.5
rpc_dart_generator: ^0.4.5 copied to clipboard
Code generator for rpc_dart callers and responders.
0.4.5 #
- analyzer: '>=9.0.0 <11.0.0'
0.4.4 #
gRPC descriptor — fully-qualified type names:
- Message/enum field type references are now emitted with the same fully-qualified naming (
.<package>.TypeNamewhen a proto package is set,.TypeNameotherwise) as service input/output references. Previously fields used a bare.TypeNamewhile service refs used the package prefix, so with a package set the two never matched and cross-references were unresolvable in the descriptor pool. Both paths now share a single_qualifiedTypeNamehelper. Map/Set/Iterablefields no longer emit a garbagetype_name(e.g..Map): they are detected and rejected with alog.warning, skipping descriptor generation for the service rather than emitting an unresolvable reference. OnlyListis still treated as a repeated field.
0.4.3 #
gRPC descriptor — proto-wire stability (protobuf-wire fixes E/F/G):
- Added
@RpcProtoField(number)(exported frompackage:rpc_dart_generator/rpc_dart_generator.dart) to pin a model field's proto field number. WhengrpcDescriptor: true, annotated fields use the explicit number; unannotated fields fall back to declaration order and now emit alog.warningthat declaration-order numbering is unstable (reordering/inserting/removing a field silently changes the wire format). Duplicate numbers also warn. - Dart
enumfields now map to protoTYPE_ENUM(14) instead ofTYPE_MESSAGE(11), with the enum name astype_name. Other non-primitive types still map toTYPE_MESSAGE. - Consolidation note (backlog #5): the build-time
_ProtoWriteris now a byte-for-byte copy ofrpc_dart_grpc_reflection'sProtoWriter. The two are not merged into one shared class because that package ispublish_to: noneand this generator is published (a published package may not depend on an unpublished one). A parity test pins identical golden bytes on both sides, and a new test round-trips the generator's emitted descriptor through the reflection parser.
0.4.2 #
Fixes (audit):
- Fixed codec-name collisions: two distinct types sharing a simple name (e.g.
a.Fooandb.Foo) collapsed to onecodecFooand the second was silently dropped, causing wrong deserialization. Codec identifiers are now disambiguated by a stable library hash. Map<String, dynamic>and primitive types no longer emit a non-existentType.fromJson(which produced uncompilable output) -- they now useRpcBinaryCodecwith CBOR encode/decode.- String escaping in generated code now escapes
\,$,\n,\r,\t(not just'), so descriptions and removed-message text with special characters produce valid Dart literals. - gRPC descriptor: Dart
intnow maps to protoTYPE_INT64, aligned withrpc_dart_grpc_reflection.
0.4.1 #
- analyzer minimal version ^10.0.0
0.4.0 #
- Added
RpcServiceKind.peersupport:@RpcService(kind: RpcServiceKind.peer)generates a peer contract pair (XxxPeerabstract class +XxxPeerCallerconcrete implementation) instead of separate caller/responder. - Generated
XxxPeerextendsRpcPeerContractand registers both incoming handlers and outgoing call methods on the sameRpcPeerEndpoint. - Added
grpcDescriptorflag on@RpcService: whentrue, emitsstatic final grpcDescriptor = Uint8List.fromList(...)for use withRpcReflectionRegistry.addFileDescriptor(). - Updated to
rpc_dart: ^3.1.0.
0.3.1 #
- Updated to
rpc_dart: ^3.0.1.
0.3.0 #
- Generator emits
grpcDescriptorstatic field on generatedNamesclasses — aFileDescriptorProtobinary suitable forRpcReflectionRegistry.addFileDescriptor(). - Generator walks
DartTypefields at build time to produce schema bytes for gRPC Server Reflection (Tier 2). - Updated to
rpc_dart: ^3.0.0.
0.2.1 #
- Added
@RpcRemovedsupport: methods annotated with@RpcRemovedgenerate@Deprecated+throw UnsupportedErroroverride in caller and are excluded from versioned responder delegation.
0.2.0 #
- Added contract versioning via Dart interface inheritance. Annotate a child interface with
@RpcServiceandimplements ParentContract— the generator detects the version relationship automatically. - Versioned callers get a
_parentfield holding the parent caller. Methods declared in the child route to the child's service; inherited methods delegate to_parent, forming a transparent chain across any number of versions. - Versioned responders register only the methods declared in their own interface slice, avoiding forced implementation of parent methods that belong to a different responder.
0.1.6 #
- fix: correct custom instance name
0.1.5 #
- bump dependencies
0.1.4 #
- fix: adding bidirectional method
0.1.3 #
- Switch to
SharedPartBuilder+combining_builderto avoid.g.dartoutput collisions with other source_gen builders.
0.1.2 #
- Dependency resolution: allow
analyzer ^8.1.1.
0.1.1 #
- Move annotations to core library
0.1.0 #
- Added
@RpcService/@RpcMethodgenerator withNamesclass (service/method constants,Names.instancefor multiple instances). - Generated
finalcaller,abstractresponder; responder registers methods insetup, you implement handlers. serviceNameOverridefor caller/responder to run multiple instances of the same service.transferModeon service/method:zeroCopyskips codec generation and serializable checks;auto/codecinsertRpcCodec<T>.withDecoder(T.fromJson)unless explicit codecs provided.- Caller/responder both honor method-level codecs/modes; custom RPC names supported via
Namesconstants. - Examples: zero-copy, multiple instances, auto-codec.