Giter Site home page Giter Site logo

react's Introduction

react

Go with React GoDoc Go Report Card

Facebook's React is one of the most dominant libraries for front-end development around. Google's Go programming language is one of the most elegantly crafted languages for server development. Why not combine the two?

This package is an extremely thin wrapper over the native react.js API. The objective was to make it light-weight, developer-friendly and intuitive. You shouldn’t have to scour the documentation to get going — a few peeks should be adequate. If you know your way around the React API and you know a bit of Go, then you should be able to make prototypes and production-worthy applications in no time.

This package is best suited for making cross-platform Desktop applications using these technologies:

The package is production ready. An optional (but highly convenient) elements sub-package is also included.

See Tutorial here.

the project to show your appreciation.

Dependencies

Installation

go get -u github.com/rocketlaunchr/react

Examples

The examples can be found here:

Uptime Timer

  • How to create React class components
  • How to pass props from parent to child
  • How to use UnmarshalProps() and UnmarshalState()
  • How to use state() and setState()
  • How to create strongly-typed structured props and states

Event Handling

  • How to create React functional components
  • How to handle events (and pass extra arguments)
  • How to create a Ref and interact with dom object directly
  • 100% written in Go
  • Cross-platform (macOS, Win, Linux)
  • Electron.js based
  • How to bundle javascript dependencies using rollup.js

Performance Tips

  • Use -m command line flag to instruct gopher.js to minify code. Then bundle+minify further with rollup.js xor Webpack/UglifyJS. A Webpack tutorial can be found here.
  • Apply gzip compression
  • Use int instead of (u)int8/16/32/64
  • Use float64 instead of float32
  • Avoid importing fmt at all costs (including indirectly). Use fmtless instead.
  • Avoid importing net/http for http requests (including indirectly). Use gopherjs-xhr instead.
  • Until GopherJS supports Go1.13+, avoid using the standard libraries context package because it uses fmt. Instead use context from forks sub-package.
  • Avoid importing honnef.co/go/js/dom if possible.
  • Use react.JSFn() and use native javascript functions as much as possible.
  • https://github.com/gopherjs/gopherjs/wiki/JavaScript-Tips-and-Gotchas
  • See if jsgo is appropriate for your web-based project.
  • To reduce file size, copy only what's required from elements sub-package.
  • For json unmarshaling, try slim-decoder or use json

Future Work

  • WebAssembly version Help Required

Other useful packages

  • dataframe-go - Statistics and data manipulation
  • dbq - Zero boilerplate database operations for Go
  • electron-alert - SweetAlert2 for Electron Applications
  • igo - A Go transpiler with cool new syntax such as fordefer (defer for for-loops)
  • mysql-go - Properly cancel slow MySQL queries
  • remember-go - Cache slow database queries

Legal Information

The license is a modified MIT license. Refer to LICENSE file for more details.

© 2018-20 PJ Engineering and Business Solutions Pty. Ltd.

Final Notes

Feel free to enhance features by issuing pull-requests.

react's People

Contributors

rocketlaunchr-cto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react's Issues

WASM

There is a react golang project using WASM now.
You should check it out.

https://github.com/dennwc/dom

From looking at your code it should slip into the existing architecture reasonably easily.

(Improvement): Included examples and documentation for Rest API usage

As a user
I would like to develop a full SPA application that talks to a graphql backend
So that I can rapid build a product my users would use.

As a developer with experence with h2o.ai Wave and Nitro plus React+Typescript
I would like to use the same Golang code base(s)
And I would like to follow practices that have improved our back end
And I want to drop bloated Python/Node development environments
So that we can maintain rapid development with secure code
And so that we can ensure lower resource requirements
And so that we can comply with SecDevOps best practices with binary distribution of code

Scenario: Document how rocketlaunchr/react handles http requests

  • Should have example code
  • Should document if golang's net/http is used or external node module like requests/axios needs to be added

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.