Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate Macro Annotations #291

Closed
juanpedromoreno opened this issue Jun 4, 2018 · 2 comments
Closed

Migrate Macro Annotations #291

juanpedromoreno opened this issue Jun 4, 2018 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@juanpedromoreno
Copy link
Member

juanpedromoreno commented Jun 4, 2018

As part of the #290 plan, we need to migrate the current Scalameta macros to the new generation of Macro Annotations.

The current scalameta annotations are:

Annotation Scope Arguments Description
@service Trait - Tags the trait as an [RPC] service, in order to derive server and client code (macro expansion).
@rpc Method (SerializationType, Compression) Indicates that the method is an RPC request. As SerializationType parameter value, Protobuf and Avro are the current supported serialization methods. As Compression parameter value, only Gzip is supported.
@stream Method [S <: StreamingType] Indicates the method's streaming type: server, client, and bidirectional. Hence, the S type parameter can be ResponseStreaming, RequestStreaming, or BidirectionalStreaming, respectively.
@message Case Class - Tags the case class as an RPC message.
@option Object (name: String, value: Any) Defines the equivalent headers in .proto files.
@outputPackage Object (value: String) Defines the package declaration in .proto files, and the namespace tag in .avpr files.
@outputName Object (value: String) Defines the protocol tag in .avpr files; if missing the idlGen tool will use the source file name (without .scala extension) instead.

For all these annotations, the only one that is being actually expanded (in terms of expanded code) is @service. The rest of them can be considered as like "anchors"/"settings" used by the @service annotation.

We could consider doing this work creating smaller issues under the feature-branch feature/scalamacros-migration, for example.

@juanpedromoreno juanpedromoreno added enhancement New feature or request story labels Jun 4, 2018
@juanpedromoreno juanpedromoreno added this to In progress in Freestyle RPC Jun 4, 2018
@juanpedromoreno juanpedromoreno moved this from In progress to To do in Freestyle RPC Jun 4, 2018
@L-Lavigne L-Lavigne self-assigned this Jun 4, 2018
@L-Lavigne L-Lavigne moved this from To do to In progress in Freestyle RPC Jun 4, 2018
@L-Lavigne
Copy link
Contributor

WIP branch: https://github.com/frees-io/freestyle-rpc/commits/MacroConversionWIP (won't compile idlGen module until #298 is done).

@pepegar
Copy link
Member

pepegar commented Jun 22, 2018

Done in #328 ! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Freestyle RPC
  
Done
Development

No branches or pull requests

4 participants