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

对于不同的proto协议,生成的js代码中大量代码是重复的 #5

Closed
georgejinme opened this issue Jun 1, 2022 · 3 comments

Comments

@georgejinme
Copy link

您好,我尝试了用两种proto协议生成js代码,发现生成的文件中,大部分内容是重复的,差别主要集中在底部函数传入参数这边。能否将公共代码抽离出去,这样在多proto协议的时候能进一步压缩空间。
可能命令行需要支持一次性生成多个js文件,或者提供代码调用方式?

百忙之中打扰您,如有错误请指正~

@mustime
Copy link
Owner

mustime commented Jun 2, 2022

正常同一个项目中,所有 .proto 文件都应该是只生成一份 js 代码的,所以不会存在你提到的公共代码重复问题。
具体你可以看看 tests/clitests/syntax 目录下的测试样例,使用命令行直接将所有 .proto 文件路径传入即可。

@georgejinme
Copy link
Author

georgejinme commented Jun 6, 2022

收到,感谢回复~ 我后面尝试一下

刚在readme看到了多文件方式,之前没好好看,打扰您了

@georgejinme
Copy link
Author

试了一下,没有问题,issue我关了,再次感谢大佬~

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