Friday Updates: Jest, Puppeteer, Data Lead, Tabata, Wahl Street, Vacation

Photo by Elizeu Dias

What I’m working on at Preceden

There’s a scene from Malcom in the Middle that I think of often where Hal sets out to fix a light bulb and gets sucked into fixing a bunch of other things in the process:

That’s largely the story of what I’ve been doing with Preceden.

Preceden lets you drag an event around on your timeline to change its dates. When you move it to a new position, Preceden updates the event’s dates to reflect the new location. Figuring out the format for the new date is tricky and something Preceden doesn’t do well currently. For example, if you originally specified the event ended on “23 Apr 2021” and you move it to the end of April, ideally Preceden would give it a format of “30 Apr 2021” but currently it would set it to “April 30, 2021”.

Preceden has a boatload of backend unit tests, but zero frontend unit tests which would help me better test things like this. I said alright, time to figure out how to do that:

My buddy Hrishi (hey friend!) recommended Jest which proved to be a great suggestion. Within a few hours I had some basic unit tests set up and things were looking promising. But then I realized that integrating Jest made Preceden’s PDF and PNG export features break, ugh.

Behind the scenes Preceden has used wkhtmltopdf to convert HTML to PDF/PNG, but wkhtmltopdf uses an old version of the QT web browser to do the conversion and QT wasn’t working with the modern JavaScript that Jest was introducing into the codebase. Working with wkhtmltopdf has been a major hassle over the years and I’ve spent countless hours getting it to work well for Preceden. This was the straw that broke the camel’s back though and I decided to research other solutions.

That eventually led me to Puppeteer a tool that basically lets you use Chrome to generate PDFs/PNGs. There’s a Ruby gem called Grover which makes it possible to integrate Puppeteer into a Ruby on Rails app. And thankfully it wasn’t too hard to make the switch… locally.

But then I pushed to staging and got a bunch of cryptic errors. That led me down a 10 hour path of updating webpacker and a myriad of other Node modules that Preceden uses and trying to figure out how to make it all play nicely together on Heroku.

Introducing Puppeteer and these other updates also caused Preceden to blow past Heroku’s 500mb slug limit (I think it came in at like 700mb?), so I had to spend a few hours figuring out how to reduce the size.

In the end, I got Puppeteer working on staging and then pushed it to production. All was well. But then a few days later Milan, the front-end developer I work with, reported that Preceden’s responsive navigation wasn’t working in production. Turns out that the various updates made it so Alpine.js wasn’t getting loaded properly. That led to more debugging.

Eventually we got that fixed too and for the moment everything is working AFAIK.

Next week I can finally circle back and add some unit tests and improve the original drag and drop date formatting issue. Hopefully.

What I’m working on at Help Scout

Our hiring funnel for the Data Lead position went like this:

  • 15 applications
  • 7 interviews
  • 3 trial projects

Last week we made an offer to one of the folks who completed the trial project and he accepted! He’ll take over the Data Lead role from me in mid-May and help take Help Scout’s data operations to the next level.

What I’m experimenting with

I had been doing a lot of YouTube HIIT workouts, but my knees were killing me so I stopped and just focused on rowing and yoga for a few months. But I miss the intensity of the HIIT workouts so started trying to figure out other ways I could get that intensity without killing my knees. I wound up finding an app called Tabata Trainer which lets you create custom HIIT-style workouts. I’ve been experimenting with different exercises to gauge how they impact my knees and seem to have found a combination that both gives me a good workout and isn’t bad on my knees:

  • Jumping Jacks
  • Push Ups
  • Russian Twists
  • Mountain Climbers
  • Plank
  • Crunches
  • Dip

Tabata involves working through these exercises 20 seconds on then 10 seconds off, then repeating the whole thing 8 times. For these 7 exercises, it works out to 28 minutes. I’ve been alternating each day between this and yoga and not surprisingly am feeling pretty healthy as a result.

What I’m watching

Juggling Preceden, Help Scout, etc has had me feeling spread pretty thin recently. It’s nothing compared to Mark Wahlberg’s life though:

I really enjoyed this series and it got me thinking a lot about what is enough, what are my priorities, etc.

Vacation

I haven’t been good about taking vacation over the last few years but I’ve been feeling pretty wiped recently so took this mostly week off. Every time I take a few days off I’m like “Man, I really need to do this more often” and this week was no exception. Now I just need to do it more often.

Hope all is well with you all – thanks for reading.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s