Comments (5)
Hi! Glad you found the project. It doesn't support NodeJS, and frankly it probably never will. It would probably involve a lot of work and it's not really worth it. It's only intended to be run in browsers.
from protobuf.
Can you please point some directions so that I can try to hack it a little bit?
My plan was to build a grpc.inc.js
that could switch between grpc-web-node-http-transport and whatever transport for browsers. However, I can't even reproduce a working grpc.inc.js
for browsers with the Makefile in grpcwebjs
.
from protobuf.
What error are you getting? This project is kind of in maintenance mode, since GopherJS is pretty much moribound itself (it hasn't been updated for Go 1.13 or modules). I imagine it might be a problem with the grpc-web-client package name, I think we renamed it https://www.npmjs.com/package/@improbable-eng/grpc-web. Maybe that will fix it?
You're on the right track though, if you could build a grpc.inc.js that could switch transport it should be portable between node and the browser. I can't dedicate much time to this myself but I'll help you as much as I can.
from protobuf.
#42 fixes issue with the webpack config.
I also successfully generated a grpc.inc.js that works in node. However, I didn't figure out how to get both node and the browser to work with a single js file, because I have to use different targets (node vs web) in webpack.config.js.
Do you have any suggestions on this?
from protobuf.
Really cool to hear that you could get it working in node. I think we have to generate a single file and use some sort of runtime detection to decide what transport to use. That should be possible with GopherJS by looking at js.Global().Get("window")
or however you do it in vanilla JS.
from protobuf.
Related Issues (20)
- Create a logo for the project HOT 1
- Idea: Hack in support for bidirectional streaming with websockets HOT 8
- Change option go_package to gopherjs_package to avoid conflicting packages
- Break out WsProxy into general purpose websocket <-> gRPC backend proxy HOT 1
- Figure out whats wrong with Firefox integration tests
- Integration Test: Switch from ChromeDriver + Chrome to ChromeDriver + Chrome Headless
- Wsproxy: switch payload size encoding/decoding burden to websocket client
- Wsproxy: context cancellation does not propagate across websocket transport HOT 1
- Wsproxy: add support for existing CallOptions HOT 2
- Cancel requests on context cancellation
- protoc-gen-gopherjs: Consider migrating to https://github.com/lyft/protoc-gen-star HOT 1
- adapting the concept to interface with Flutter HOT 5
- Try using decode.io protobufjs instead of Google-protobuf HOT 1
- Large integers are not correctly parsed
- Generated proto file has wrong imports HOT 5
- Suggestion: Allow enabeling WebSocket transport, even if rpc isn't BiDi or server stream HOT 4
- Interop test for Envoy, nginx and grpcwebproxy backends HOT 2
- Add js tags to protobuf-generated types HOT 2
- Might be worth updating this now that caddy 2 is stable and tinygo can compile to WASM HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from protobuf.