wasmws
goja
wasmws | goja | |
---|---|---|
5 | 25 | |
61 | 4,944 | |
- | - | |
0.0 | 6.3 | |
over 2 years ago | 3 months ago | |
Go | Go | |
Mozilla Public License 2.0 | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
wasmws
-
Is there an alternative to gorilla websocket?
Thanks for writing this! I found it really great to use when I wrote https://github.com/tarndt/wasmws
-
Goomerang 🪃 A protocol buffers over websockets communications library
Before looking at the readme, I thought this was an alternative to using https://github.com/tarndt/wasmws which lets you use gRPC over websockets so that you can use gPRC via WASM without needing an http to gRPC gateway. Now I'm understanding a bit differently. It looks like this uses protobufs but doesn't have anything to do with gRPC at all, instead implementing some of the communication parts of gRPC while ignoring the generation of services but instead focusing a bit more on message routing and pub/sub that you would probably still need NATS.io for if you were using gRPC.
-
Even More Minor Features in Go 1.18
The hijacking a websocket works very well, live in the future today! https://github.com/tarndt/wasmws
-
Migrating from nodejs to go codebase using gopherjs
Everything said above is valid, but if you do think you have a need to transpile... consider running any Go frontend code as WASM rather than Javascript. A few years ago I started doing my frontends and backends all in Go and its been wonderful. I even wrote a library so I could use gRPC from my WASM/Go frontends rather than REST: https://github.com/tarndt/wasmws . Extra wonderful, at least for my tastes. Once caveat is if your brotli compressed, CDN/browser cached, etagged Go WASM is still to big, you can usually make it even smaller by using tinygo rather than the std tool chain for the compiling to WASM.
-
Go and gRPC is just so intuitive. Here's a detailed full-stack flow with gRPC-Web, Go and React. Also, there is a medium story focused on explaining how such a setup might boost efficiency and the step-by-step implementation.
A while back I was writing a pure Go frontend app (WASM) and I wrote this so I could use gRPC rather than REST to talk to my backend: https://github.com/tarndt/wasmws
goja
- Goja: ECMAScript/JavaScript engine in pure Go
-
SSR React in Go
dop251/goja
-
Show HN: Flyscrape – A standalone and scriptable web scraper in Go
Your comment was posted 4 minutes ago. That means you still have enough time to edit your comment to change it so it contains real URLs:
<https://github.com/PuerkitoBio/goquery>
<https://github.com/dop251/goja>
(Please do not reply to this comment—I won't be able to delete it once the previous post is fixed if it contains replies.)
- Goja: ECMAScript 5.1 implementation in pure Go
-
TySON: TypeScript as an embeddable configuration language, without depending on Node or V8
Apparently "not depending on Node or V8" means depending on some random Go JS engine instead.
-
Examples of using task scheduler with Go?
Goja https://github.com/dop251/goja
-
Running a Js file inside Go
Either call a JavaScript interpreter like node with exec.Command and read its stdout, or use a pure Go JavaScript interpreter like goja or otto.
-
easytemplate - Go's text/template library with JS Super Powers
Just to also say this is implemented in pure Go we aren't including V8 or any external dependencies we instead use https://github.com/dop251/goja which is a JS VM written completely in Go.
-
how to JSON Marshal a struct if one of its fields is a fucntion
If you want to serialize a function to JSON one idea may be to embed a scripting language like JavaScript into your program. The goja package is a very good solution: a native ES5 JavaScript (with some ES6 syntax support as well) natively implemented in Go so you can get tight data bindings to your Go types and funcs. For your JSON marshalling you could serialize a JavaScript function source (text) and when reloading that, parse that text with goja to be able to run it dynamically in your Go program. Basically you'd need to get away from pure Go for this and towards something that is JSON compatible to (de)serialize to text.
-
Anyone experienced in golang ssr?
Not really. It was built in-house and I don't know of anything about it that went public. I recall it using Goja for the JS runtime. Code was embedded into the binary (think embed package). There was some kind of sorcery to convert what would be HTTP network calls in the browser into local function calls during SSR, but I'm hazy on how it worked I'm afraid.
What are some alternatives?
goomerang - A small communications library based on protocol buffers over websockets
otto - A JavaScript interpreter in Go (golang)
wombat - Cross platform gRPC client
v8go - Execute JavaScript from Go
grpc-web - gRPC for Web Clients
go-lua - A Lua VM in Go
ws - Tiny WebSocket library for Go.
gopher-lua - GopherLua: VM and compiler for Lua in Go
ote - ote updates a packages' go.mod file with a comment next to all dependencies that are test dependencies; identifying them as such.
tengo - A fast script language for Go
nbio - Pure Go 1000k+ connections solution, support tls/http1.x/websocket and basically compatible with net/http, with high-performance and low memory cost, non-blocking, event-driven, easy-to-use.
go-python - naive go bindings to the CPython2 C-API