-
Notifications
You must be signed in to change notification settings - Fork 112
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
RFC: Add "modern" version of closure_template_library #389
Comments
this would be really awesome in terms of maintainability, at least the way we structure templates when using |
Is there any particular reason that you want to use aspects here? They are complicated and only useful if you like to overlay on top of other rules that you don't have control on (for example closure_js_proto overlaying on top of existing proto rules). I haven't dealt with closure templates but for this particular case, all you you need seems like a macro: def closure_template_library(name, deps, ...): Then your particular target java or js target depends on foo_java or foo_js. |
The reason why I thought of aspects to implement this is so users don't have to pay the overhead for languages they don't use during analysis, and that it might be slightly easier to add new languages (there is an official generator for python that The main reason why I'm proposing this new rule is to fix the limitations of the current |
Current situation
closure_template_{java,js}_library
has been part ofrules_closure
for some time.Since its addition in 2016(?), a lot has changed, both in
rules_closure
andBazel
, and I think it's time to create something new. Something that looks and feels more like other "modern"Bazel
-rules.The current versions of
closure_template_{java,js}_library
are implemented as thin (independent) wrappers aroundgenrule
. This means that adding dependencies to or removing them from templates requires changing multiple targets, which is rather error-prone. Also, using closure templates from a new language (e.g. from Java if you only used them in JS) requires adding targets for all transitive dependencies.New rule
The style of the new rules is inspired by
proto_library
. Instead of having per-language targets, we will create a dedicatedclosure_template_library
rule that defines the dependencies between individual templates, and multipleclosure_template_{language}_library
-rules that generate language bindings for the templates.Internally, the language rules will use aspects to generate the language bindings for transitive dependencies.
Other design goals are:
closure_proto_library
should work (e.g. closure_proto_library: propagate descriptors to create_closure_js_library (like #277) #314, Issues building protos, and using them #388), andClosureWorker
(it currently isn't).The text was updated successfully, but these errors were encountered: