1. Stripe checkout launch
This week saw the culmination of a month of heads-down building and refactoring, as we ditched Boords' home-rolled billing and invoicing UI in favour of Stripe's Checkout and Customer portal products. Aside from the reduced complexity in our code - I was able to remove ~2,500 lines of code from the backend alone - the new billing system is much easier to reason about. We effectively try and mirror Stripe's subscription status as delivered by webhooks. Previously we took that information and translated it through our own logic, which is a layer of complexity I'm happy to see gone.
2. Rails upgrade
Our billing upgrade necessitated a Rails upgrade. We've been running Rails 4.2 since Boords' inception in 2015, so an upgrade is long overdue. For the most part, it went fairly smoothly. Most of Boords' complexity lies on the frontend, which no doubt sped things up. There were a few gem upgrades as you'd expect, but the bulk of the migration was done in a couple of hours. One notable fly in the proverbial ointment was JSON fields. It turns out that Rails 6 stores JSON fields as strings (as per the RFC 7159 standard), whereas Rails 4 stores them as objects or arrays. It took a couple of hours of stumbling around to find this Github issue, and I ended up implementing an ActiveRecord concern to mirror the old behaviour as described here.
3. Typescript in Vim
While this was mostly a backend upgrade, some frontend work was needed to launch the new Checkout page. Editing Typescript files in Vim had been noticeably slow for me for some time, and this felt like the right time to figure our what was going on. My first instinct was the Typescript server, but it turns out the blame lay squarely with syntax highlighting, specifically the regex engine I was using. I wrote up a quick summary which hopefully will save someone else a few hours of head scratching.