Go to file
2019-02-23 14:40:01 +00:00
data replace zxq.co/ripple/hanayo 2019-02-23 13:29:15 +00:00
modules replace zxq.co/ripple/hanayo 2019-02-23 13:29:15 +00:00
routers replace zxq.co/ripple/hanayo 2019-02-23 13:29:15 +00:00
scripts replace zxq.co/ripple/hanayo 2019-02-23 13:29:15 +00:00
semantic replace zxq.co/ripple/hanayo 2019-02-23 13:29:15 +00:00
services replace zxq.co/ripple/hanayo 2019-02-23 13:29:15 +00:00
static add relax and autopilot leaderboards 2019-02-23 13:59:41 +00:00
templates forgot here too 2019-02-23 14:40:01 +00:00
vendor replace zxq.co/ripple/hanayo 2019-02-23 13:29:15 +00:00
.drone.yml replace zxq.co/ripple/hanayo 2019-02-23 13:29:15 +00:00
.editorconfig replace zxq.co/ripple/hanayo 2019-02-23 13:29:15 +00:00
.eslintrc replace zxq.co/ripple/hanayo 2019-02-23 13:29:15 +00:00
.gitignore replace zxq.co/ripple/hanayo 2019-02-23 13:29:15 +00:00
.gitmodules replace zxq.co/ripple/hanayo 2019-02-23 13:29:15 +00:00
2fa.go replace zxq.co/ripple/hanayo 2019-02-23 13:29:15 +00:00
avatar.go replace zxq.co/ripple/hanayo 2019-02-23 13:29:15 +00:00
beatmap.go replace zxq.co/ripple/hanayo 2019-02-23 13:29:15 +00:00
context.go replace zxq.co/ripple/hanayo 2019-02-23 13:29:15 +00:00
dev.go replace zxq.co/ripple/hanayo 2019-02-23 13:29:15 +00:00
doc.go replace zxq.co/ripple/hanayo 2019-02-23 13:29:15 +00:00
errors.go replace zxq.co/ripple/hanayo 2019-02-23 13:29:15 +00:00
funcmap.go replace zxq.co/ripple/hanayo 2019-02-23 13:29:15 +00:00
Gopkg.lock replace zxq.co/ripple/hanayo 2019-02-23 13:29:15 +00:00
Gopkg.toml replace zxq.co/ripple/hanayo 2019-02-23 13:29:15 +00:00
gulpfile.js replace zxq.co/ripple/hanayo 2019-02-23 13:29:15 +00:00
helpers.go replace zxq.co/ripple/hanayo 2019-02-23 13:29:15 +00:00
irc.go replace zxq.co/ripple/hanayo 2019-02-23 13:29:15 +00:00
LICENSE replace zxq.co/ripple/hanayo 2019-02-23 13:29:15 +00:00
loadchangelog.go replace zxq.co/ripple/hanayo 2019-02-23 13:29:15 +00:00
localisation.go replace zxq.co/ripple/hanayo 2019-02-23 13:29:15 +00:00
login.go replace zxq.co/ripple/hanayo 2019-02-23 13:29:15 +00:00
main.go replace zxq.co/ripple/hanayo 2019-02-23 13:29:15 +00:00
messages.go replace zxq.co/ripple/hanayo 2019-02-23 13:29:15 +00:00
oauth.go replace zxq.co/ripple/hanayo 2019-02-23 13:29:15 +00:00
package.json replace zxq.co/ripple/hanayo 2019-02-23 13:29:15 +00:00
profbackground.go Add some stuff 2019-02-23 14:37:47 +00:00
profile.go replace zxq.co/ripple/hanayo 2019-02-23 13:29:15 +00:00
pw.go replace zxq.co/ripple/hanayo 2019-02-23 13:29:15 +00:00
rate_limiter.go replace zxq.co/ripple/hanayo 2019-02-23 13:29:15 +00:00
README.md replace zxq.co/ripple/hanayo 2019-02-23 13:29:15 +00:00
recovery.go replace zxq.co/ripple/hanayo 2019-02-23 13:29:15 +00:00
register.go replace zxq.co/ripple/hanayo 2019-02-23 13:29:15 +00:00
semantic.json replace zxq.co/ripple/hanayo 2019-02-23 13:29:15 +00:00
sessions.go replace zxq.co/ripple/hanayo 2019-02-23 13:29:15 +00:00
simple.go replace zxq.co/ripple/hanayo 2019-02-23 13:29:15 +00:00
startuato_linux.go replace zxq.co/ripple/hanayo 2019-02-23 13:29:15 +00:00
startuato_windows.go replace zxq.co/ripple/hanayo 2019-02-23 13:29:15 +00:00
templates.go replace zxq.co/ripple/hanayo 2019-02-23 13:29:15 +00:00
tracking.go replace zxq.co/ripple/hanayo 2019-02-23 13:29:15 +00:00
yarn.lock replace zxq.co/ripple/hanayo 2019-02-23 13:29:15 +00:00

Hanayo build status

This repository has a mirror here. The original repo is still here.

To fellow developers: this is not how you do it!

The biggest flaw of hanayo are that when I set out to create it, I wanted to create a template system that:

  • Created a handler by simply having the file "be there"
  • Could fetch the data it needed on its own, often from the Ripple API
  • Had the actual Go code be as little as possible

This was not immediately evident to me, a Go beginner, but what I did there was basically make Go be PHP.

The biggest lesson I learned on how to properly do templates, was learning to use Vue. Yes, Vue can be used for the frontend and not really for server-rendered stuff, but even just learning how to do stuff with it can help you understand what a template is actually supposed to be in order to be maintainable.

The key concepts and insights for me where:

  • Separating clearly code and markup, making the template declarative and keeping as little code in the template
  • A template should be purely functional. Its mere creation should not generate side effects, nor should it be dependent on things that are not its precise inputs: for a given input there is a specific output.
  • The concept of component as a single self-contained entity which is the same wherever you use it is very powerful.
  • Once a template/component starts becoming too big, split it into more components.

But don't stop here. Actually making a project using Vue helps you to understand this much more easily than using mere words. Go ahead and build something, even if just to play around!