...taps microphone
...well, okay, I predicted 2026, so I'm about three years early.
Code gets dusty awfully quickly! What keeps happening is, I get distracted and forget to update this website for a while, and then the code rot sets in and I'm unable to update the site for some extended period of time until I get around to either fixing it up again or replacing it completely.
I did not, this time, have to rewrite the technology underlying this site from scratch in order to get it running (though I was tempted, and actually got a pretty good way into building a web components-based static site generator before I came to my senses.)
Instead, I had to
- Fix an encoding error in the database, where at some point the UTF-8 content got re-encoded as ISO 8859-1 causing a lot of "n£" mojibake. (I spent a while barking up the wrong tree on this one: the encoding in the static-rendered files was correct, and the mojibake only showed up on hydration; therefore I spent way longer than I should have fiddling with content-type headers, thinking the data was getting corrupted in transit. Turns out the static files just predate the database problem.)
- Get a working Vue install running on a new machine. Since I'm the only one using this software, I set up this site so that the authoring tools appear when running in development mode, but are not currently included in the production build. This is very convenient, and means everything is in place to turn this into a multi-user site if somehow I ever found a reason to do that; but means that to write a new blog post I have to actually run the site build tools locally in dev mode. The code was all sitting comfortably in a git repository, that part's fine, but
- most of its dependencies are out of date or outright deprecated.
- The command-line tool for installing the framework and its dependencies was deprecated.
- I had to install new old versions of node, npm, node-sass, and eventually python, which some build tool deep in some sub-dependency's stack wanted for some reason
- (And then update each of those a step at a time to get them as current as possible without introducing too many breaking changes)
- Having done all that, and finally getting the site to run locally, I discovered I needed to track down a 'credentials' file which I had carefully .gitignore'd (because you don't want tokens in the cloud!), and therefore lost, (because the cloud is where I keep all my stuff!)
- I also needed to temporarily disable the part of my code that checks the user's password, because I had forgotten it and it was only stored in encrypted form in the database. (For whatever reason, I built really robust security into a blogging tool that will only ever be used by one person. There's a nonce on every api call to mitigate bearer token theft. I don't know why I thought I needed that.)
- Lastly I needed to modify the SQL table structure again, because somewhere in the process of debugging the encoding issues way back in step one, I dropped and recreated a table, and lost the auto-increment setting on one key.
And now I have a functioning website again. Easy as that!
Narrator: It was not as easy as that
Turns out that while developer mode is working fine, so I can talk to the database and add and edit these posts, building a deployable update to the app is still not possible. Something deep in the internals of PrerenderSpaPlugin is, I'm pretty sure, getting from something deep in the internals of webpack a Promise when it's expecting a callback, or maybe the other way round, anyway static renders are failing silently and I haven't yet figured out why.
Modern software development is mostly a matter of gluing things to other things, connecting this framework to that database using this dependency and etc. That sure doesn't mean it's gotten easier.
(In particular I feel like we're due for a reckoning for putting so much trust in npm. It's so convenient depending on other peoples' code, but those dependencies go out of date or accrete incompabilities so quickly, even if you're actively maintaining a project it can be hard to keep up with new vulnerabilities and breaking changes from dependency updates; set a project aside for a while and you're pretty much guaranteed to have to rebuild its whole infrastructure from scratch next time you want to pick it up again.)