Skip to content
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.

Add ts_proto_library rule. #193

Closed
wants to merge 4 commits into from
Closed

Conversation

alexeagle
Copy link
Contributor

Add example that uses it under a karma test.

Fixes #61

/cc @kellycampbell

@gregmagolan
Copy link
Contributor

Fix windows CI?

Copy link
Contributor

@gregmagolan gregmagolan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alexeagle
Copy link
Contributor Author

/cc @cgrushko

Add example that uses it under a karma test.

Fixes bazelbuild#61
Copy link
Contributor

@mrmeku mrmeku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! I'm excited to see how you'll remove the need for the rollup.config

message Car {
string make = 1;
string model = 2;
int32 year = 3;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might consider exercising your test with a message containing an int64. pbjs has a couple of modes for handing int64 in JS and one of the requires that the long node_module be used. We should test that we integrated that scenario correctly

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, good point

@@ -1,7 +1,8 @@
{
"compilerOptions": {
"strict": true,
"lib": ["es2015.promise", "dom", "es5"]
"lib": ["es2015.promise", "dom", "es5"],
"rootDirs": [".", "../bazel-bin/examples"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this for editor support of generated files?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, exactly, I'll add a comment

@cgrushko
Copy link

cc @iirina

@alexeagle
Copy link
Contributor Author

/cc @pherl - anyone from your team care to be in the loop for Bazel / TypeScript proto usage?

@@ -106,6 +116,7 @@ ts_devserver = rule(
"serving_path": attr.string(),
"data": attr.label_list(allow_files = True, cfg = "data"),
"static_files": attr.label_list(allow_files = True),
"bootstrap": attr.label_list(allow_files = [".js"]),
# User scripts for the devserver to concat before the source files
"scripts": attr.label_list(allow_files = True),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suppose it is correct to limit scripts to [".js"] as well

type_blacklisted_declarations = [],
es5_sources = depset([js_es5]),
es6_sources = depset([js_es6]),
transitive_es5_sources = depset(),
Copy link

@jbedard jbedard May 3, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried this PR out and had issues because the transitive sources here don't include the normal sources. I think transitive should be direct + indirect sources? In my case this causes issues when this is read by collect_es6_sources which only reads transitive_es6_sources...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I didn't test it in a production bundle, that's missing here...

@cgrushko
Copy link

cgrushko commented May 4, 2018

My 2 cents - ts_proto_library should be implemented in terms of a Bazel Aspect (I scanned the code and didn't see anything about it).
There are some details in https://blog.bazel.build/2017/02/27/protocol-buffers.html (look for "Bazel Aspects").
If this is already using Aspects, sorry, please disregard :)

@alexeagle
Copy link
Contributor Author

alexeagle commented May 4, 2018 via email

@cgrushko
Copy link

cgrushko commented May 4, 2018 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants