Giter VIP home page Giter VIP logo

Comments (5)

johanbrandhorst avatar johanbrandhorst commented on June 4, 2024

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.

the729 avatar the729 commented on June 4, 2024

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.

johanbrandhorst avatar johanbrandhorst commented on June 4, 2024

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.

the729 avatar the729 commented on June 4, 2024

#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.

johanbrandhorst avatar johanbrandhorst commented on June 4, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.