This is a most important skill. Its often daunting when you approach a fresh area, know what you want to do but just dont know how, nor have the vocabulary yet to express what you want in the relevant forums.
Keep it up Mark, you are an inspiration to us all.
BREAKTHROUGH
OMG this is exciting! I just made a major step towards a p2p git portal proof of concept.
After days fumbling with things I don’t understand I have a Go Wasm go-git app compiling (using a webpack golang wasm plugin) and can invoke git.Clone() in a web browser. Has anyone ever done this before?
Massive thanks to @lazyreader and @maxmcd on the Gophers slack who helped and I could not have done this without. Max spent ages with me on this.
I’m too excited to focus on the next things just now.
Lots of killer apps could be built this way. It feels like I’ve invented fire!
By opening up the Safe platform to apps built using Golang and Rust to name just two, the whole landscape opens up. Existing code and skill sets all become options for building web, desktop and mobile apps. And if we have standard APIs like a POSIX filesystem, we make it even easier. Things are looking so good for Safe right now.
Gosh only a month since I kicked this off and so much progress! I’ll give a fuller update soon and a screencast demo before long, but I want to ask if anyone fancies doing a little side project.
It’s not a high priority, so I’ll not likely get around to it myself but this would still be a nice thing to have in the toolbag. It’s self contained so anyone could have a go at their own pace, and it won’t matter if you don’t finish it.
What I’d like is a web proxy, written in Golang to get around CORS issues when doing requests in the browser. This would ultimately live inside my Go/wasm app (or could be built with Rust/wasm etc), and although we won’t need this for Safe, it will ease adoption as well as help with testing and with inspiring folks with a cleaner easier to use demo. So a very nice but not vital to have. In the mean time I have workarounds, but they are a bit clunky. So it would be nice if it “just worked”.
I’m pretty sure this should be possible (Tauri does something like this for example), but it does need checking out - that a proxy can run like this within the browser. I’ve think I’ve seen a reference to doing this in JavaScript but not certain, but we can ask or you could build a test example to check a proxy can work like this before adding the features needed by such a proxy.
Let me know if you fancy having a go at Go, and if you need it I can help and give some pointers.
And watch this space for the next update!
UPDATE: I’m now less sure this would work, so if anyone who understands the idea thinks it would or would not work, please let me know. My concern is that if the proxy is in the wasm/web app, it may be forced to use http via the browser and unable to circumvent the CORS issue like an external proxy.
user@user:~/src/go_wasm/p2p-git-portal-poc$ yarn build
ERROR in ./src/main.go
Module build failed (from ./node_modules/golang-wasm-async-loader2/dist/index.js):
Error: spawn /usr/lib/go-1.13/bin/go ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:268:19)
at onErrorNT (internal/child_process.js:468:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
@ ./src/App.svelte 28:0-29 469:81-85
@ ./src/main.js
@ multi ./src/main.js
npm run gives:
user@user:~/src/go_wasm/p2p-git-portal-poc$ npm run
Scripts available in svelte-go-poc via `npm run-script`:
build
webpack
dev
In case it helps, npm install works but then npm start gives
user@user:~/src/go_wasm/p2p-git-portal-poc$ npm start
npm ERR! missing script: start
npm ERR! A complete log of this run can be found in:
npm ERR! /home/user/.npm/_logs/2020-11-21T10_52_41_001Z-debug.log
npm run is the way to run a script, so where you would use yarn <script> you can say npm run <script>
So in this case we have yarn build or npm run build. Sorry for not being clearer.
Thanks for the report. It confirms the issue is not isolated so I need to figure out why it is working for me and not for others. Can you try the following and report back:
I tried this - in my case there is no /usr/local/bin/go so I used /usr/bin/go build -o /home/user/SourceCode/p2p-git-portal-poc/src/main.go.wasm /home/user/SourceCode/p2p-git-portal-poc/src/main.go
Oh b****s! Sorry, the evils of copy and paste. Those file paths apply to someone else’s system. Can you modify them to where your p2p-git-portal-poc directory is!
I’m my defence I haven’t got up properly yet. Saturday is our Sunday on the boat, so I’m still lazing on the sofa after my bacon sarny.
Yes you’re right! It’s /home/user/src/go_wasm/p2p-git-portal-poc/src/main.go So what should the target directory be? /home/usr/src/ has two subdirectories, go_wasm and wasm_test.