Humble is a collection of loosely-coupled tools designed to build client-side and hybrid web applications using go and gopherjs.
Humble is designed for writing front-end code, and is entirely back-end agnostic. You can use Humble in combination with any back-end server written in any language. If you do choose to write your back-end in go as well, Humble offers some tools to make it easy to share code between the server and browser.
This repository contains no code, but serves as an introduction to Humble and a central place for creating new issues and feature requests that are not related to any specific sub-package.
How it Works
Why Write Client-Side Code in Go?
- Built-In Type-Safety. Go is a type-safe, compiled language which means that certain classes of mistakes can be caught before you even run your code. It also makes it possible for text editors to do static analysis and more intelligent autocomplete, increasing your productivity. While projects like TypeScript exist, go offers type-safety as a core feature, and all go code, whether part of the standard library or a third-party package, supports it.
- Robust Standard Library. Go comes with an incredibly robust standard library, and almost all of it is supported in gopherjs (see the compatibility table).
- Sane Concurrency Patterns. Go is one of few modern languages to implement CSP concurrency patterns. Goroutines and channels offer an intuitive and standardized way to deal with concurrency and asynchronous code, and are fully supported in gopherjs.
- Phenomenal Tooling. Go offers some of the best tooling of any modern language. There is standardized documentation on godoc.org, builtin testing, benchmarking, and profiling, and even tools for detecting race conditions and displaying test coverage.
Humble is brand new and is under active development.
All sub-packages are well-tested and are even tested in real browsers when applicable. We do our best to respond to critical issues as quickly as possible. As such, Humble can be considered safe for use in side-projects, experiments, and non-critical production applications. At this time, we do not recommend using Humble for critical production applications.
Humble uses semantic versioning, but offers no guarantees of backwards compatibility until version 1.0. It is likely that the API will change significantly as new issues are discovered and new features are added. As such, we recommend using a dependency tool such as godep to ensure that your code does not break unexpectedly.
Detect is a tiny go package for detecting whether code is running on the server or browser. It is intended to be used in hybrid go applications.
Examples contains several examples of how to use Humble to build real applications.
Form is a package for validating and serializing html forms in the browser. It supports a variety of validations on form inputs and binding forms to arbitrary go structs.
Locstor provides localStorage bindings. In addition to being able to interact with the localStorage API directly, you can create a DataStore object for storing and retrieving arbitrary go data structures, not just strings.
Rest is a small package for sending requests to a RESTful API and unmarshaling the response. Rest sends requests using CRUD semantics. It supports requests with a Content-Type of either application/x-www-form-urlencoded or application/json and parses json responses from the server.
Router is an easy-to-use router which runs in the browser. It supports url parameters and uses history.pushState, gracefully falling back to url hashes if needed.
Temple is a library and a command line tool for sanely managing go templates, with the ability to share them between the server and browser.
View is a small package for organizing view-related code. View includes a View interface and some helper functions for operating on views (e.g. Append, Replace, Remove, etc.).
Where is the Old Code?
If you're looking for the files that used to be in this repository, they have all been moved to stand-alone packages. Check out the Go-Humble Organization Page on github to view all the packages!