-
Notifications
You must be signed in to change notification settings - Fork 116
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
Split code generation logic into javy-codegen crate #877
base: main
Are you sure you want to change the base?
Conversation
First of all, thanks for making this PR! My main concern with the changes in the current state of this PR is a lot of internal implementation details would be exposed as part of the public API on the More concretely what I'm thinking is:
I think with those changes, it would significantly reduce the number of concepts exposed by a codegen crate API (assuming the Cargo feature exposing the configurations for configs, v2 plugins, and default plugins is left in the default disabled state). How does that sound? |
Thanks for the quick turnaround on feedback!
I think that's a fair assumption to make. I imagine most customers would start by taking a dependency on the plugin crate and codegen and then use more specific user plugins if necessary.
Totally in agreement, I wasn't sure what was ideal for the external API and figured there would be feedback around that.
I think this makes sense. Is the intent with generator that if the feature flag is set for V2 that the customer would always be linking to V2? Or should this be something that the customers can provide directly to the generator?
Seems fine to me also I'm not sure how often customs will want to set those configs though. I probably won't have time to take a swing at this till the weekend but I'll open another PR to implement just those changes and circle back on this afterwards. |
We don't publish the plugin crate and we don't intend to. Someone can use
I was thinking more that the Cargo feature on the codegen crate would gate access to setter methods to set booleans on
Ideally consumers never set those configs. The only reason that support is there is to support using the default plugin with the Javy CLI. The approach I would recommend for anyone doing this programmatically would be to create a plugin with the equivalent configuration options set in the plugin. |
Description of the change
This change accomplishes the following,
codegen
logic out into it's own cratejavy-codegen
javy-codegen
to use DI for the required WASM plugins (providers).Outside of that all existing behaviors should continue to function as is as far as I can tell.
Why am I making this change?
To enable runtime generation of WASM in a micro-service via direct consumption of the
javy-codegen
crate.Checklist
javy-cli
andjavy-plugin
do not require updating CHANGELOG files.