Socket
Socket
Sign inDemoInstall

github.com/zrcoder/gfront

Package Overview
Dependencies
3
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    github.com/zrcoder/gfront

package gfront is a package to build progressive web apps (PWA) with Go programming language and WebAssembly. It uses a declarative syntax that allows creating and dealing with HTML elements only by using Go, and without writing any HTML markup. The package also provides an http.Handler ready to serve all the required resources to run Go-based progressive web apps.


Version published

Readme

Source

gfront

Thanks to Webassybly technology, we can develop front-end in Go+ language now.

Inspired of React, go-app and Go+ classfile

Hello, world

JS(React)

index.html

<!DOCTYPE html>
<html>
  <head>
    <script src="https://unpkg.com/react@16/umd/react.development.js"></script>
    <script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
    <script src="https://unpkg.com/babel-standalone@6.26.0/babel.js"></script>
  </head>

  <body>
    <div id="root"></div>
    <script type="text/babel">
      class App extends React.Component {
        render() {
          // JSX:
          return <h1>Hello world!</h1>
          // return React.createElement('h1', 'Hello, React!')
        }
      }
      ReactDOM.render(<App />, document.getElementById('root'))
    </script>
  </body>
</html>

Go+(gfront)

Main.app

route "/", &Hello{}
runWhenOnBrowser

Hello.com

func Render() UI {
    return h1.text("Hello World!")
}

FAQs

Last updated on 09 Feb 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc