-
Notifications
You must be signed in to change notification settings - Fork 130
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
extension points for plugin #183
Comments
I have never used extension points, but I've heard they might be unpleasant to use. Is it an option to do what you need in runtime? For example, the existing
I imagine it should be possible to create a jest matcher like Could you elaborate a bit what you want to do? |
@timostamm thanks for your reply. Another use case I have is message type refinement (due to custom options) or method signatures (think something like I was thinking about some decorators support for all those tasty generators you have there. Since I couldn't find any programmatic API for the plugin, possible API could be another plugin parameter with absolute path to
|
The plan is to switch to the base types provided by protobuf-es. protobuf-es includes a much improved plugin framework with @bufbuild/protoplugin, which makes it a whole lot easier to write your own plugins. I think this should be the best way forward for your use case as well (generating builder, test builders, jest matchers). It might not give you all the capability extension points give you, but they are a double edged sword for sure. You can see the code for a simple plugin here. I hope we can simplify it even more (not needing to type out .js, .ts and .d.ts code for example). |
Do you have any plans to allow extending the existing plugin? Or maybe it is possible already, and I just couldn't find it...
For example we'd like for each and every proto message to generate builders, test builders (with test values) and probably jest matchers.
Of course we can take the plugin framework and write our own but that means duplicate codegen execution and plenty of code copy & paste from the plugin.
Thanks!
The text was updated successfully, but these errors were encountered: