go-astilectron icon indicating copy to clipboard operation
go-astilectron copied to clipboard

Isomorphic Go

Open peternoyes opened this issue 6 years ago • 6 comments

I would be interested in writing the front end code in Go as well and transpiling it to JavaScript using Gopherjs. I suppose I could do it now by first running gopherjs in the resources folder before running the bundler but it would be nice if it were integrated into the process.

Also, forgive me but I am really new to this. I am wondering where you see the javascript console messages, is there any way to inspect? I have never dealt with Electron before.

peternoyes avatar Jan 30 '18 17:01 peternoyes

I'll think about a clean way to integrate this into the process event though I doubt there's one. But I'll try.

Regarding the console messages, you have to put the DevTools attribute of the WindowOptions.WebPreferences struct to true and when the window will be created, the dev tools will appear as well.

asticode avatar Jan 30 '18 18:01 asticode

Gopherjs has a neat front end in go library https://github.com/gopherjs/vecty that could be pretty cool for something like that, not sure if it could work with electron though

Noofbiz avatar Jan 30 '18 20:01 Noofbiz

Yup! I would definitely be using Vecty if we could get this to work.

peternoyes avatar Jan 30 '18 20:01 peternoyes

i think you should just use WASM. Its easier than gopherjs in many ways.

here is a great golang WASM repo where the smart dev has also wrapped on the the Browser API. Because its WASM its must easier to write golang code.

https://github.com/lazyhacker/wasmgo/blob/master/test.go

see the import !!!

--

So maybe this can be used for also interacting with Electron API or wrapping the existing AstiElectron code or something in the middle.

ghost avatar Jun 15 '18 15:06 ghost

The Perfect match.

https://go.isomorphicgo.org/

This is gopherjs based and pretty good. The use of standard template i particularly like..

I think it would be pretty easy to get it working as WASM and so get a speed bump too.

ghost avatar Jun 15 '18 15:06 ghost

@peternoyes

I am leaning heavily towards Vecty now. I tried out react and vue already... https://github.com/gopherjs/vecty

Here is why !!! With the official golang compiler support for WASM now being in Master its game on for WASM and golang. So Vecty is now easily the mostly logical choice. SO you can develop all of your stack with golang and its all strongly typed.

So now you can use all goalng for your communication easily and GRPC is the best choice because you get fast bidirectional comms and codegeneration of all your types.

Then for styling there is Vecty MDC now !!!! https://github.com/agamigo/vecty-material

In summary i feel a demo can be made bringing all this together pretty easily. I really think that this is a huge opportunity for Astilectron and golanf developers that have been screaming for a good way to quickly built high quality app.

You can easily make Mobile webview apps using the Flutter Webview too BTW !!

ghost avatar Jun 20 '18 08:06 ghost