A starting point for building web applications with Polymer 1.0 and GopherJS
Visit (https://github.com/PalmStoneGames/polymer-template/) and fetch the Polymer Template.
With Node.js installed, run the following one liner from the root of your Polymer Template download:
npm install -g gulp bower && npm install && bower install
Polymer template requires the following dependencies:
- Node.js, used to run JavaScript tools from the command line.
- npm, the node package manager, installed with Node.js and used to install Node.js packages.
- gulp, a Node.js-based build tool.
- bower, a Node.js-based package manager used to install front-end packages (like Polymer).
- go, the programming language
- gopherJS, a compiler for Go to Javascript
To install dependencies:
- Check your Node.js version.
node --version
The version should be at or above 0.12.x.
-
If you don't have Node.js installed, or you have a lower version, go to nodejs.org and click on the big green Install button.
-
Install
gulp
andbower
globally.
npm install -g gulp bower
This lets you run gulp
and bower
from the command line.
- Install the local
npm
andbower
dependencies.
cd polymer-template && npm install && bower install
This installs the element sets (Paper, Iron, Platinum) and tools required to build and serve apps.
- Download and install the Go programming language.
Please follow the instructions for your system at https://golang.org/doc/install
- Grab the GopherJS compiler.
go get -u github.com/gopherjs/gopherjs
Build the current project, for development and testing.
gulp build:dev && go build ./...
Build and optimize the current project, ready for deployment.
gulp build:prod && go build ./...
Polymer uses Bower for package management. This makes it easy to keep your elements up to date and versioned. For tooling, we use npm to manage Node.js-based dependencies.