https://codingcafe.jp/posts/signal-5yrs
I spent five years building a web app, posted it on Hacker News, and
got my first $1.
February 13, 2022
This is the story of five years spent wandering around the JavaScript
tech stack, wasting time, getting lost, and finally taking off.
Self Introduction
Nice to meet you. I'm an engineer who runs a small mobile app
development company.
Since about the same time I started programming, I have been
composing music as a hobby.
The standard way to compose music today is to use a large size
software called DAW. However, I was frustrated by the large number of
plug-ins I had to install on my machine and the lack of ready-to-use
composition software, so I preferred to use lightweight MIDI
sequencer applications.
However, many of them have been around since the days of Windows 2000
and have not been updated, and since Windows 10, MIDI audio is no
longer properly supported.
To solve this problem, I started to develop a minimalist,
ultra-lightweight, out-of-the-box composition app.
2014
It was November 2014 when I started writing code. First I started
implementing the GUI framework, as anyone would. This, now that I
think about it, is a clear sign of failure, or rather, of a long-term
project.
Nevertheless, the audio engine and GUI framework, implemented in C++,
started to build up nicely. Piano rolls were displayed and sounds
could be played. Fonts are rendered, and it can be built on a Mac.
Four months later, in March 2015, I was still implementing the
scrollbars. No matter how skilled you are, you should not just start
developing from GUI frameworks.
2015
And in May 2015, I turned my attention to the then-popular
"Electron", a cool technology used in Slack. At that time, my company
was still using HipChat. You remember HipChat?
Yes, you guessed it, let's go with Electron and CoffeeScript. I was
confident that this was the right technology stack. Webpack isn't
that popular yet. Back in the days of downloading libraries as js
files, there was no cooler technology than CoffeeScript. (I'm still a
fan of CoffeeScript's "List Comprehensions".)
I used a library called coffee-react and wrote components with
React.createClass. It's not that bad.
At that time, performance was not so good because the sound was still
being played by generating the Audio class. And of course, the UI was
incomplete.
2016
It's been three years now, and with a sense of urgency that this
would never be completed, I finally set up a concept. Let's take a
look at README.md from back then.
Make an app that allows you to concentrate on composing music without
being distracted by choosing sound sources or adjusting effects.
That's great. This is still being followed today.
And let's take a look at the code. The main tech stack is still
CoffeeScript, but we changed the UI framework from React to Riot.js.
This, in retrospect, is clearly the biggest time waster. (Riot.js is
a very nice library.)
Riot.js, have you heard of it? It's like Vue now. I've been writing a
lot of .tag files for templates. I've installed Babel, Mocha, ESLint,
and added libraries via npm. It's actually pretty cool, don't you
think? It was also around this time that I created the repository.
https://github.com/ryohey/signal
If there is one major detour here, it is that I created a state
management library.
That's right. Everyone creates their own state management library. I
am no exception. This was just made out of an idea, so don't worry
about it.
https://github.com/ryohey/shinjuku
And now the time has come. "ES6" is here.
Arrow functions, map, filter, and all the cool features of
CoffeeScript have come to JavaScript. I've rewritten my entire code
base from CoffeeScript to ES6. There's nothing cooler than a new
standard.
And for about six months, the implementation in Riot.js progressed
nicely. The application is almost ready to go. We've been
modularizing the code and evolving it into an infinitely cleaner code
base.
This idea in itself is not bad, because React is still popular in
2022. But as a project, it was the worst thing we could have done.
But as a project, it was the worst thing we could have done, because
we couldn't release the app until 2021.
2017
From here on, I just worked on the implementation. I spent a lot of
time changing the screen layout, refactoring the handling of dragging
notes with the mouse, and adjusting minor behavior. Of course, I'm
also obsessed with colors. There was even a function to switch
themes. At that time, the quality of the app had reached a viable
level. Why didn't they just release it? Now, I would advise me to
release it now.
But then came the reasons for not releasing it: the introduction of
MobX, a state management library, and the introduction of Flow, a
type checking system. My own Store has had to be rewritten
significantly (and in a much cooler fashion).
2018
A super huge revolution is coming." TypeScript". Should you publish a
web app that is filled with tons of non-type-safe JavaScript code? Of
course not (as far as I'm concerned at the time).
So I rewrote everything in TypeScript, including my own libraries.
Eliminating any is the biggest mission of 2018.
2019.
I didn't get to write much code this year, but there is work to be
done. It' s Material-UI. Ever since Bootstrap, we've been obsessed
with cool UI kits. (In 2022, I now think the unstyled UI library is
very cool, but is that a danger sign?)
Anyway, I'll be replacing my own components like Button and Toolbar
with Material-UI ones. It's also cool to have less proprietary code
and feel like you're riding on the shoulders of giants.
At this time, the UI is almost complete, but what about when you
really try to use it for songwriting? The piano roll is heavy. Do you
know that it is very difficult to create a light web app that renders
a lot of elements like these notes in React?
There's no way I could publish such a slow app. I've made all kinds
of performance improvements.
2020
I just couldn't improve the heavy piano roll behavior. Want to know
the history of the drawing method? Here's a timeline below.
|Year|Drawing method| |---|---| |2016.3|Drawing with
tags| |
2016.4|Drawing with