No Description

qewc 216e2405bd Update register.html 2 years ago
data c3d206c173 replace zxq.co/ripple/hanayo 2 years ago
modules c3d206c173 replace zxq.co/ripple/hanayo 2 years ago
routers c3d206c173 replace zxq.co/ripple/hanayo 2 years ago
scripts c3d206c173 replace zxq.co/ripple/hanayo 2 years ago
semantic c3d206c173 replace zxq.co/ripple/hanayo 2 years ago
services c3d206c173 replace zxq.co/ripple/hanayo 2 years ago
static 8c28f4497a d 2 years ago
templates 216e2405bd Update register.html 2 years ago
vendor c3d206c173 replace zxq.co/ripple/hanayo 2 years ago
.drone.yml c3d206c173 replace zxq.co/ripple/hanayo 2 years ago
.editorconfig c3d206c173 replace zxq.co/ripple/hanayo 2 years ago
.eslintrc c3d206c173 replace zxq.co/ripple/hanayo 2 years ago
.gitignore a1f938078a yea h 2 years ago
.gitmodules c3d206c173 replace zxq.co/ripple/hanayo 2 years ago
2fa.go c3d206c173 replace zxq.co/ripple/hanayo 2 years ago
Gopkg.lock c3d206c173 replace zxq.co/ripple/hanayo 2 years ago
Gopkg.toml c3d206c173 replace zxq.co/ripple/hanayo 2 years ago
LICENSE c3d206c173 replace zxq.co/ripple/hanayo 2 years ago
README.md c3d206c173 replace zxq.co/ripple/hanayo 2 years ago
avatar.go c3d206c173 replace zxq.co/ripple/hanayo 2 years ago
beatmap.go c3d206c173 replace zxq.co/ripple/hanayo 2 years ago
ccreate.go 697cb30f0f add clans 2 years ago
clan.go 697cb30f0f add clans 2 years ago
context.go c3d206c173 replace zxq.co/ripple/hanayo 2 years ago
dev.go c3d206c173 replace zxq.co/ripple/hanayo 2 years ago
doc.go c3d206c173 replace zxq.co/ripple/hanayo 2 years ago
errors.go c3d206c173 replace zxq.co/ripple/hanayo 2 years ago
funcmap.go c3d206c173 replace zxq.co/ripple/hanayo 2 years ago
gulpfile.js c3d206c173 replace zxq.co/ripple/hanayo 2 years ago
helpers.go 6817d88cd5 Meme 2 years ago
irc.go c3d206c173 replace zxq.co/ripple/hanayo 2 years ago
loadchangelog.go c3d206c173 replace zxq.co/ripple/hanayo 2 years ago
localisation.go c3d206c173 replace zxq.co/ripple/hanayo 2 years ago
login.go c3d206c173 replace zxq.co/ripple/hanayo 2 years ago
main.go ee9ae352a8 briuh 1 2 years ago
messages.go c3d206c173 replace zxq.co/ripple/hanayo 2 years ago
oauth.go c3d206c173 replace zxq.co/ripple/hanayo 2 years ago
package.json c3d206c173 replace zxq.co/ripple/hanayo 2 years ago
profbackground.go 3a6e52209f my b 2 years ago
profile.go 872d1eec92 Add relax and autopilot profile 2 years ago
pw.go c3d206c173 replace zxq.co/ripple/hanayo 2 years ago
rate_limiter.go c3d206c173 replace zxq.co/ripple/hanayo 2 years ago
recovery.go c3d206c173 replace zxq.co/ripple/hanayo 2 years ago
register.go 2058ab8747 remove keys 2 years ago
semantic.css e1acdbe1bc Flip dark and light 2 years ago
semantic.js e1acdbe1bc Flip dark and light 2 years ago
semantic.json c3d206c173 replace zxq.co/ripple/hanayo 2 years ago
sessions.go c3d206c173 replace zxq.co/ripple/hanayo 2 years ago
simple.go c3d206c173 replace zxq.co/ripple/hanayo 2 years ago
startuato_linux.go c3d206c173 replace zxq.co/ripple/hanayo 2 years ago
startuato_windows.go c3d206c173 replace zxq.co/ripple/hanayo 2 years ago
team.json 6ad06560fe add her twitter 2 years ago
templates.go c3d206c173 replace zxq.co/ripple/hanayo 2 years ago
tracking.go c3d206c173 replace zxq.co/ripple/hanayo 2 years ago

README.md

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!