The new Ripple frontend.
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
Giuseppe Guerra 3fc0620d69 Merge branch 'master' of zxq.co:ripple/hanayo 3ヶ月前
data Ranking criteria fixes 4ヶ月前
modules Updated hardcoded server ips 6ヶ月前
routers Bancho API privs, Bancho OAuth, update api vendor 4ヶ月前
scripts Update locales 1年前
semantic Fix placeholder color being completely white 2年前
services Finish token creation pages 2年前
static Bancho API privs, Bancho OAuth, update api vendor 4ヶ月前
templates Ranking criteria fixes 4ヶ月前
vendor Bancho API privs, Bancho OAuth, update api vendor 4ヶ月前
website-docs @ 1bd4238f62 Updated submodule website-docs 3ヶ月前
.drone.yml add drone 1年前
.editorconfig add drone 1年前
.eslintrc eslint config 1年前
.gitignore Add basic oauth flow 2年前
.gitmodules Add submodule website-docs 2年前
2fa.go append query to redir URL in 2fa 2年前
Gopkg.lock Bancho API privs, Bancho OAuth, update api vendor 4ヶ月前
Gopkg.toml require license to be agreed before starting hanayo 1年前
LICENSE Forgetting we are using GNU AGPL: check 3年前
README.md Explain why you shouldn't write code like hanayo in the README 1年前
avatar.go ADD EVERYTHING TO TEMPLATES FILE OH YEAH 2年前
beatmap.go merge appends and remove shiet 1年前
context.go fix breaking changes 1年前
dev.go Bancho API privs, Bancho OAuth, update api vendor 4ヶ月前
doc.go ⬆️ v1.8.6 ⬆️ 1年前
errors.go ADD EVERYTHING TO TEMPLATES FILE OH YEAH 2年前
funcmap.go Play Time 6ヶ月前
gulpfile.js make dark site a real setting instead of an easter egg 1年前
helpers.go pass valid context to Exchange code 1年前
irc.go ADD EVERYTHING TO TEMPLATES FILE OH YEAH 2年前
loadchangelog.go Support for new changelog format 11ヶ月前
localisation.go Make website show localised text 2年前
login.go ADD EVERYTHING TO TEMPLATES FILE OH YEAH 2年前
main.go require license to be agreed before starting hanayo 1年前
messages.go Add messages system (for {error,success,info,...} messages) 3年前
oauth.go Add X-Frame-Options: deny to OAuth token requests 2年前
package.json Start implementing localisation in JavaScript 2年前
profbackground.go Slight increase of 13% of profile background quality 2年前
profile.go ADD EVERYTHING TO TEMPLATES FILE OH YEAH 2年前
pw.go Create token revocation page 2年前
rate_limiter.go use getContext instead of MustGet("context").(context) 3年前
recovery.go Update vendor 2年前
register.go Don't add user to leaderboard when they register 2年前
semantic.json Display achievements on user profiles 1年前
sessions.go Make Language set in the Context, not by the template 2年前
simple.go ADD EVERYTHING TO TEMPLATES FILE OH YEAH 2年前
startuato_linux.go deploy a specific branch 2年前
startuato_windows.go When refreshing templates, restart the entire webserver 3年前
templates.go ignore non-html files while loading templates 1年前
tracking.go Move from git.zxq.co to zxq.co 2年前
yarn.lock Start implementing localisation in JavaScript 2年前

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!