Write your front in Go!

Hogosuru

Hogosuru is a part of a personel project and export to the community and provide a framework to easly provide write front end in go. He use a rewrite syscall/js (that catch error) and wrap Object and Interface provide by browser

Hogosuru provide implementation for the WEB API http,event,fetch,json,xmlhttprequest,blob,broadcastchannel,indexeddb, localstorage ... with a goal to provide all JS API access https://developer.mozilla.org/fr/docs/Web/API and write full web app in GO

How to use

Just import the module with go module
go get github.com/realPy/hogosuru

The project is written to work with tinygo but compatible with the go official compiler

Try example

Start project in tinygo docker

docker run -it -v $PWD:/go/src/hogosuru tinygo/tinygo bash

Build

docker run --rm -it -w /go/src/hogosuru -v $PWD:/go/src/hogosuru tinygo/tinygo bash 
cp hogosuru/hogosuru.go /usr/local/go/src/syscall/js/
tinygo build  -o ./example/wasm_main/wasm.wasm --no-debug -target wasm example/wasm_main/main.go
tinygo build  -o ./example/wasm_main/dragandrop.wasm --no-debug -target wasm example/wasm_main/dragandrop/main.go

Run server to the the result in js developer console

go run example/server/main.go

Dont forget to get to use the wasm_exec.js provide by tinygo.

How to help

This is a young project and there are a lot of work to do
All help is welcome. If you are interested by this project, please contact me

Implemented API/Object status

API/Object Implemented Support MDN URL
Arraybuffer Partial https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer
Attr Full https://developer.mozilla.org/fr/docs/Web/API/Attr
Blob Full + stream additional support https://developer.mozilla.org/fr/docs/Web/API/Blob
Broadcast Channel Full https://developer.mozilla.org/en-US/docs/Web/API/BroadcastChannel
CustomEvent Full https://developer.mozilla.org/fr/docs/Web/API/CustomEvent
DataTransfer Partial implemented https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer
Document Mostly https://developer.mozilla.org/fr/docs/Web/API/Document
DragEvent Full https://developer.mozilla.org/en-US/docs/Web/API/DragEvent
Element Partial implemented https://developer.mozilla.org/fr/docs/Web/API/Element
Event Partial implemented https://developer.mozilla.org/fr/docs/Web/API/Event
EventTarget Full https://developer.mozilla.org/fr/docs/Web/API/EventTarget/EventTarget
Fetch Partial implemented https://developer.mozilla.org/fr/docs/Web/API/Fetch_API
File Full https://developer.mozilla.org/fr/docs/Web/API/File
FileList Full https://developer.mozilla.org/fr/docs/Web/API/FileList
FormData Partial implemented https://developer.mozilla.org/fr/docs/Web/API/FormData
HTMLInputElement Partial implemented https://developer.mozilla.org/fr/docs/Web/API/HTMLInputElement
HTMLCollection Full https://developer.mozilla.org/fr/docs/Web/API/HTMLCollection
Indexedddb Partial implemented https://developer.mozilla.org/fr/docs/Web/API/IndexedDB_API
JSON Full https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Global_Objects/JSON
MessageEvent Full https://developer.mozilla.org/fr/docs/Web/API/MessageEvent
NamedNodeMap Full https://developer.mozilla.org/fr/docs/Web/API/NamedNodeMap
Node Full https://developer.mozilla.org/en-US/docs/Web/API/Node
NodeList Considerated at Full (Partial implemented but no more need ) https://developer.mozilla.org/fr/docs/Web/API/NodeList
Response Partial implemented https://developer.mozilla.org/fr/docs/Web/API/Response
Storage Full https://developer.mozilla.org/fr/docs/Mozilla/Add-ons/WebExtensions/API/storage
Stream Partial implemented https://developer.mozilla.org/fr/docs/Web/API/Streams_API
uint8array Partial implemented https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array
WebSocket Full https://developer.mozilla.org/fr/docs/Web/API/WebSocket
XMLHttpRequest Partial implemented https://developer.mozilla.org/fr/docs/Web/API/XMLHttpRequest/XMLHttpRequest

Local MD5 sum of file with drag and drop

You can test a local example of local hash
Go to https://realpy.github.io/hogosuru/example/static/draganddrop.html

Open you console developer. Drag some file and see result :)

Comments
  • go-language-fatal-error-all-goroutines-are-asleep-deadlock

    go-language-fatal-error-all-goroutines-are-asleep-deadlock

    https://github.com/realPy/hogosuru/blob/ee8533a3b579978e160160fd61859aa80b6c1e89/promise/promise.go#L249

    use with wg.Wait() no channels or select {} https://stackoverflow.com/questions/26927479/go-language-fatal-error-all-goroutines-are-asleep-deadlock

  • great work! i'm interested in this but example page still not updated?

    great work! i'm interested in this but example page still not updated?

    great work! i'm interested in this but example page still not updated?

    possible to show the example single page app first? will be better if hv a minimal pwa too but single page app will suffice .

  • awesome

    awesome

    this is really useful and impressive. its really nice of you to make this..

    Will be using this with gio

    https://github.com/gioui/gio https://github.com/gioui/gio-x

  • considering using this for serious production use... any production case studies / actual production use case now?

    considering using this for serious production use... any production case studies / actual production use case now?

    considering using this for serious production use...

    1. any production case studies / actual production use case now?
    2. who is using it?
    3. recommended for production use?
    4. what kind of limitations / gotchas / caveats need to look out for? can u pls help specify these onto the front page / readme?

    thx

  • Add forEach() for nodeList Element

    Add forEach() for nodeList Element

    Is actually not possible to iterate natively in nodeList element.

    See https://developer.mozilla.org/fr/docs/Web/API/NodeList/forEach

    In the meantime, do :

    menuSelector, _ := d.QuerySelectorAll(".navbar-item")
    
    for i := 0; i < menuSelector.Length(); i++ {
        item, _ := menuSelector.Item(i)
    }
    
Run WASM tests inside your browser

wasmbrowsertest Run Go wasm tests easily in your browser. If you have a codebase targeting the wasm platform, chances are you would want to test your

Dec 16, 2022
Go compiler running entirely in your browser

wasm-go-playground This is the Go compiler ("gc") compiled for WASM, running in your browser! It can be used to run a simple playground, à la play.gol

Nov 10, 2022
A watchdog for Kubernetes rolebindings. Barks (Slack notifications) when something is happening on your front porch.
A watchdog for Kubernetes rolebindings. Barks (Slack notifications) when something is happening on your front porch.

Cave canem - Beware of the dog A fun little application that acts as a watchdog for Kubernetes rolebindings. If something happens on the front porch i

Jan 7, 2023
Write controller-runtime based k8s controllers that read/write to git, not k8s

Git Backed Controller The basic idea is to write a k8s controller that runs against git and not k8s apiserver. So the controller is reading and writin

Dec 10, 2021
Web-based gdb front-end application

Introduction Tired of using the plain gdb command-line interface to debug your Go/C/C++ applications? Godbg is a graphical web-based front end for gdb

Nov 6, 2022
twitter clone front-end for Internet Engineering course - fall 99 built by go+echo

twitter backend build twitter-like back-end for internet engeering course - fall 99 with go+echo+gorm team mates Roozbeh Sharifnasab + Parsa Fadaee +

Nov 9, 2022
Create production ready microservices mono repo pattern wired with Neo4j. Microservices for other languages and front end repos to be added as well in future.
Create production ready microservices mono repo pattern wired with Neo4j. Microservices for other languages and front end repos to be added as well in future.

Create Microservices MonoRepo in GO/Python Create a new production-ready project with backend (Golang), (Python) by running one CLI command. Focus on

Oct 26, 2022
This app is an attempt towards using go lang with graphql data fetch in react front end.

go_movies _A React js + GraphQL supported with backend in GoLang. This app is an attempt towards using go lang with graphql data fetch in react front

Dec 7, 2021
publish a tree-like data structure from a backend to a front-end

tree-publish publish a tree-like data structure from a backend to a front-end. It needs to be a tree in order to publish the data as JSON document. If

Dec 20, 2021
Edgevpn-gui - Graphical front-end for EdgeVPN
Edgevpn-gui - Graphical front-end for EdgeVPN

EdgeVPN GUI Create Decentralized private networks A simple GUI for EdgeVPN built with fyne. ?? Features Manage EdgeVPN versions locally from the GUI.

Nov 9, 2022
😈 Simple micro-front-end framework.
😈 Simple micro-front-end framework.

Development and Maintenance Status RancherOS 1.x is no longer being actively maintained. There are two significant reasons behind this product decisio

Jan 5, 2022
Responsible for provide data to the web front-end

Responsible for provide data to the web front-end. Generates names based on preseted datasets (list of example names), but you can upload a custom dataset (it must have at least 23 names)

Sep 3, 2022
Thanks to Webassybly technology, we can develop front-end in Go+ language

gfront Thanks to Webassybly technology, we can develop front-end in Go+ language. Inspired of React, go-app and Go+ classfile Hello, world JS(React) i

Feb 2, 2022
Fast :zap: reverse proxy in front of any GraphQL server for caching, securing and monitoring.
Fast :zap: reverse proxy in front of any GraphQL server for caching, securing and monitoring.

Fast ⚡ reverse proxy in front of any GraphQL server for caching, securing and monitoring. Features ?? Caching RFC7234 compliant HTTP Cache. Cache quer

Nov 5, 2022
Write your SQL queries in raw files with all benefits of modern IDEs, use them in an easy way inside your application with all the profit of compile time constants

About qry is a general purpose library for storing your raw database queries in .sql files with all benefits of modern IDEs, instead of strings and co

Dec 25, 2022
A tool that helps you write code in your favorite IDE: your word processor!
A tool that helps you write code in your favorite IDE: your word processor!

WordIDE Have you ever wondered: How would it feel like to write code in a word processor? Me neither. But after months minutes of planning, I present

Jul 21, 2022
A next-generation testing tool. Orion provides a powerful DSL to write and automate your acceptance tests

Orion is born to change the way we implement our acceptance tests. It takes advantage of HCL from Hashicorp t o provide a simple DSL to write the acceptance tests.

Aug 31, 2022
Terratest is a Go library that makes it easier to write automated tests for your infrastructure code.

Terratest is a Go library that makes it easier to write automated tests for your infrastructure code. It provides a variety of helper functions and patterns for common infrastructure testing tasks,

Dec 30, 2022
You can write slowly your words.
You can write slowly your words.

You can write slowly your words. Type Writer function with golang Usage 1 Daktilo(text(string), milliseconds(int)) Usage 2 Daktilo(text(string)) go ru

Jan 18, 2022
Monitor your Website and APIs from your Computer. Get Notified through Slack, E-mail when your server is down or response time is more than expected.
Monitor your Website and APIs from your Computer. Get Notified through Slack, E-mail when your server is down or response time is more than expected.

StatusOK Monitor your Website and APIs from your computer.Get notified through Slack or E-mail when your server is down or response time is more than

Dec 27, 2022