prost icon indicating copy to clipboard operation
prost copied to clipboard

[Question/Feature-Request] Add support for a compiler plugin

Open mkaes opened this issue 4 years ago • 5 comments

Are there any plans to implement a compiler plugin feature like there is for the c++ implementation of protoc?

I am currently using the compiler plugin in c++ to generate some non protobuf related files. Namely typescript definition files for a rest api. While this plugin could still be used it would be awesome if prost would support something similar.

Attached is patch that I am currently using which suits my needs so far. But unfortunately it has same drawbacks. Some of the internal types must be exported and currently the ServiceGenerator interface is broken.

As I just started with rust I am wondering if this a promising path. If so I will try to fix the issues and make a real pull request. Or is this approach in contrast to what is planned for the library? compiler_plugin.txt

mkaes avatar Apr 17 '21 12:04 mkaes

I've also worked on customizing Prost, which required forking the project: https://github.com/kaiserkarel/prosit

Although this is not intended as a competing implementation, just as experimental ground. With the current architecture of Prost, adding the changes was quite cumbersome. Proper plugin infrastructure would allow for more extensions as a library.

KaiserKarel avatar Jul 25 '21 11:07 KaiserKarel

compiler plugin, as i a protoc plugin? +1 for that!

henrikrudstrom avatar Aug 29 '21 19:08 henrikrudstrom

This would be a great addition!

purkhusid avatar Sep 24 '21 09:09 purkhusid

+1 Is there any updates?

fzyzcjy avatar Oct 01 '21 06:10 fzyzcjy

Great idea.

thinkgos avatar Dec 28 '23 10:12 thinkgos