Web App Framework with Vecty & GopherJS
This document describes a web app framework targeted for Vecty & GopherJS.
- The framework handles and compiles Go code targeting the frontend and backend
- Framework can build frontend code into HTMl/JS/CSS or Web Assembly (WASM). In both cases, the resulting app is a SPA
- Framework design might enable classic web apps with multiple routes, but that's not a design goal
- Framework provides development-time tooling like:
- Development server that live-reloads and recompiles code
- Generating code for common tasks
Frontend web developers generally have to master 3 technologies to write modern web applications:
- HTML: declarative language for structuring a web page
- CSS: Declarative language for applying styles to a static page
There is a huge ecosystem of technologies and tooling that developers have to choose from to accomplish their goals. They generally fall into one of a few categories:
- Development and build tooling like WebPack and Rollup.js
- CSS superset languages/compilers like SCSS
The Framework aims to replace all these technologies with Go:
- Development and build tooling: framework itself provides a development server and build tool, all based on the standard Go toolchain
- CSS superset languages/compilers: CSS is written in Go
Framework assumes that Buffalo is used for server routing, and it's used in API-only mode. None of the buffalo frontend pipeline features are used, since the framework handles all of the frontend build & development tasks.
Framework also has helpers to make RPC from frontend to backend easier. For example, it can generate code on the frontend and backend to add a new RPC method.
Framework can do server side rendering if the developer opts in to letting framework handle RPC and routing.