Rewind: react-spinkit, DT, & Other Open Source Contributions
I recently discovered that Amazon's Open Source contribution policy had gotten even more streamlined, allowing engineers to make simple contributions to most projects without pre-approval. It was never fun having friction that was potentially more work than the small fix you wanted to upstream, and so I'm really excited about this. I'm always happy to make PRs and always feel a little sad when I have to break out the old
patch-package hammer, so now I'll be able to quickly pull down a repo and contribute a quick fix. Even better, it's always enlightening to see other repos and setups and patterns, providing a great learning opportunity. With all that in mind, this policy update prompted to consider what contributions I had made the effort to push through the process.
Before Twitch had a proper React UI component library, things were less standardized, especially in our scrappy mobile web project. As we converted into a true SPA we started needing loading indicators, and react-spinkit was the de facto choice at the time. We'd run into issues trying to use it in an SSR application, and so I got approval and wandered in hoping to make a quick change. Along the way I noticed some other small papercuts and starting pulling on some threads, and before long I wound up with a massive update that made a lot of changes, modernized some of the patterns (per the long-ago days of 2017 at least), closed 6 diverse issues, and resulted in a major version bump. Ironically, we actually wound up getting an official replacement a few months later. But looking back at that library, I'm kind of curious about doing a 2021 update pass based on everything I've learned since then and to see what I think of how I left things before.
Workbox serves as the foundation for many service worker implementations, and we began experimenting with one to further improve our SSR app's performance. But we wanted to keep leveraging our cached SSR pages so we needed to use the rarer
navigationPreload functionality, but it wasn't plumbed through all the wrapping libraries. I thought it was going to be a simple change but Workbox is a complex monorepo, which I was luckily already familiar with at least. The eventual final PR involved one line of new actual logic, plumbing the value through a few layers, and then mostly updating their extensive test suite (which was really cool and invoked all the browsers on my computer for true integration tests). Sadly, I stepped into one of the few untested areas as well and had to do an immediate follow-up 🤦. This contribution meant I needed paperwork with both my company and Google due to their CLA, but it's always fun adding something to these big important libraries (which was I jumped on this one as soon as it came up).
On the topic of adding to big libraries, my contribution to Relay was easily the funniest. It was definitely more paperwork (including another CLA) than actual work, since all I needed to do was run a script to generate a new version of their Relay Specification site, which I needed to help show our GraphQL team how Relay's expectations differed from base GraphQL. Their docs CI job was broken and I was tired of explaining why the published site was out of date, so I wound up with an unglamourous contribution that looks much more impressive on paper.
Looking over that list, after the initial first-month work, we really leaned on filing issues and hoping or using
patch-package unless there were issues that spread outside of our team and thus couldn't be as efficiently worked around. Going forward, here's hoping the tides are changing.
Update One Week Later
Things are off to a good start, with PRs to both type-fest and relay-compiler-language-typescript. In fitting with my above comment, these were both nifty type-focused changes and I really enjoyed them.