rxjs-grpc icon indicating copy to clipboard operation
rxjs-grpc copied to clipboard

Static generation

Open majelbstoat opened this issue 6 years ago • 2 comments

I'd love to see the ability to statically generate code (not just interfaces) as part of a build process, instead of creating it dynamically when the application starts. I'm currently using the static generation of grpc-node to build my client and server, but would like to move to the observable model because it feels like a much more natural API.

Perhaps this is what is intended by https://github.com/kondi/rxjs-grpc/issues/30?

majelbstoat avatar Jun 26 '18 16:06 majelbstoat

@majelbstoat Sorry, #30 is about something else. I did not plan to use the static version, but I can change my mind :) Can you explain what is the benefit of using the statically generated code vs interfaces and plain JS objects?

kondi avatar Mar 05 '19 12:03 kondi

Some of it is admittedly just personal preference, where I can look at the code generated by the build step and understand exactly what's going on. For my specific situation, protos are stored in a global common path in a monorepo and the build step arranges for the right generated code to go into the right Docker image for deployment. The protos themselves don't actually go into the Docker image.

But also from a practical perspective, I'm generally in favour of doing preprocessing things offline, once. Application startup time can be a factor, especially if there are lots of protos, and you're using something like Knative to spin up new instances in response to load.

majelbstoat avatar Mar 12 '19 23:03 majelbstoat