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

Static generation #34

Open
majelbstoat opened this issue Jun 26, 2018 · 2 comments
Open

Static generation #34

majelbstoat opened this issue Jun 26, 2018 · 2 comments

Comments

@majelbstoat
Copy link

majelbstoat commented Jun 26, 2018

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 #30?

@kondi
Copy link
Owner

kondi commented Mar 5, 2019

@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?

@majelbstoat
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants