rpc_dart_generator 0.4.2
rpc_dart_generator: ^0.4.2 copied to clipboard
Code generator for rpc_dart callers and responders.
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.