You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey there, I was reviewing this example and I notice your example could be more idiomatic with existing Bazel proto rules.
<lang>_proto_library should prefer to use depson a proto_library vs referring to it as a src. Example can be found here: https://docs.bazel.build/versions/master/be/java.html#java_proto_library. The rationale being this is generating source code from a collection of dependencies and is usually expressed that way.
ts_library targets that wish to use the generated ts lang proto library should express dependency on the target using deps instead of src. It's considered generally a best practice to declare a label in srcs that is directly are directly consumed by the rule that output source files (citation). In this particular case, I believe the ts_library is depending on a previously generated target and wouldn't be expected to list it as a src of the library itself. Additionally, its considered a best practice to not have the same file listed in srcs of multiple targets, which this would cause.
The text was updated successfully, but these errors were encountered:
Hey, I agree with the first one that says _proto_library should definitely pick up the descriptors from "deps" attribute instead of "srcs".
Since _proto_library is a source generating target, we should not think it as a JS-producing target and also I'm not sure if ts_library picks up source files from the "deps" attribute. (I guess I'm gonna see if it works that way.)
Hey there, I was reviewing this example and I notice your example could be more idiomatic with existing Bazel proto rules.
<lang>_proto_library
should prefer to usedeps
on aproto_library
vs referring to it as asrc
. Example can be found here: https://docs.bazel.build/versions/master/be/java.html#java_proto_library. The rationale being this is generating source code from a collection of dependencies and is usually expressed that way.ts_library
targets that wish to use the generated ts lang proto library should express dependency on the target usingdeps
instead ofsrc
. It's considered generally a best practice to declare a label insrcs
that is directly are directly consumed by the rule that output source files (citation). In this particular case, I believe thets_library
is depending on a previously generated target and wouldn't be expected to list it as a src of the library itself. Additionally, its considered a best practice to not have the same file listed insrcs
of multiple targets, which this would cause.The text was updated successfully, but these errors were encountered: