-
Notifications
You must be signed in to change notification settings - Fork 764
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
grpcweb npm runtime module #210
Conversation
npm/scripts/build.js
Outdated
"grpc.web.StreamBodyClientReadableStream", | ||
"grpc.web.GrpcWebClientBase", | ||
|
||
// @TODO: Include these |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't really need to. These 2 files are irrelevant for this purpose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't grpc.web.GatewayClientBase
be required if a client was compiled with mode=base64
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may have to remove it for some other reasons in the near future. So I just don't want to call this out as a TODO
. We can add support for that any time.
Is the |
Should
I am not sure if the |
Typically it would be included in a project to keep its runtime dependencies from changing between installs, but in this case it actually is unncessary. There are no runtime dependencies, just the |
Btw, |
It gets generated on an
I don't believe it is. I just didn't want to pollute the root directory. If there are multiple npm modules that may live in this repository it might be good to have subfolders for them. Do you want me to move it? |
Ah. Can you add some notes to the main Thanks for your contribution! This is very important. |
Yes please. Let's not create a |
It would mean that all the other files/folders will need to be added to the I could also make a |
Please make sure to include the Readme (or a Readme) in the package so that it gets displayed on npmjs.com; looking at your test package at the moment gives me “Unable to find a readme“ which is not ideal. |
Yes please add |
npm/package.json
Outdated
@@ -0,0 +1,14 @@ | |||
{ | |||
"name": "grpc-web", | |||
"version": "0.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's call it version 0.1.0 please. Thanks.
Now that I think about it more. Should we put This repo contains both the gRPC-Web client JS code and the custom Nginx proxy code. Sorry for going back and forth. Not very familiar with how github repo and npm modules interact |
@stanley-cheung Normally they correspond one-to-one. But in cases where they don't, especially the “monorepo” pattern, indeed |
Is I'm more in favour of It may make sense to maintain separate README's for the npm module instead of using the main repository one. The quick start using docker-compose for instance could be omitted as well as any closure related examples. A project that is using the npm module most likely doesn't need to see that information first hand while viewing the package at npmjs.com, yarnpkg.com etc. |
+1 to |
Well I'm not a contributor, I'm not CNCF and not Google, so anything I say is from the perspective of an user with long years of JS experience. From that perspective, I'd also prefer packages/grpc-web. It's more intuitive and more in line with the community standards. But, in that case the correct thing to do would be to move the actual sources to that location, and that would mean changing the whole build process for the Closure version as well. I'm not sure how the maintainers would like that. |
I am open to moving all the JS source code to be under @zaucy If you feel like moving all the source code is too big a task, feel free to leave the PR in the current state and I can do the big move on top of that. |
Actually we just need to rename |
I kept the scripts folder for the
I'll let you move the js files in case there are any issues with the examples / closure related pieces that I haven't touched on. All that would need to be changed in the grpc-web package is this line https://github.com/grpc/grpc-web/pull/210/files#diff-dabf4379a467e2218cfdb99795a1558bR9 |
Is |
Yep SGTM. @zaucy Thanks for all the great work! Now all the changes are in the new |
@zaucy Can you squash the commits please? |
d3b5c03
to
2bafd8c
Compare
@stanley-cheung Done! |
[Edit] Nevermind. My node version is too old. Upgraded to Node 8 and error went away. |
Ah the script is not compatible with your version of node. Is it required that it work with node 4? I'm running node 8 which is the current LTS. |
Node 4 is way past EOL. The earliest supported release is 6. I guess this is an use case for the |
That would be unnecessary. The error is caused by the build script. The |
Great! This all works. I ran |
Nevermind, I didn't realize I was in a VM. We don't have to support Node 4 at this stage. |
Created for #197
This sets up an npm module that runs the google closure compiler on the client related js before publishing to npm.