It’s been about 2 years. That’s right, about 2 years ago I uttered to a nerdy friend of mine at the pub, “Ya know? I’d really like to be an open source contributor. That’d be awesome. Might have a look into that soon”. SoonTM, the bane of actually getting anything done. Sure enough, 2 years later and I still didn’t have a single PR to my name.

But recently I decided to change all that. Why? Well, I decided that if I was going to be the main author of a React based blog and claim expertise in React then I shouldn’t just have a working knowledge of how to use React but I should know about it’s internals as well. This is how it came to be that I would shake off the shackles of my self-given and most loathed title of “wannabe open source contributor” and raised my first PR on the React the repo.

Was it the sort of change which afterward I should be expecting a personal call from Mark Zuckerberg at any minute to thank me for single handedly securing the future of React? Absolutely not, but it was a start and I hope by writing about my first steps now I might help or inspire someone else to come and take the same steps with me.

 

It begins…I’m so new!!

When I begin something new in technology I find that my first port of call has to be to read something. Some people are able to just start playing with the nuts and bolts without any instruction what-so-ever but unfortunately I’m not really one of them.

With this in mind my first stop was the How to Contribute docs that the react team had recently put so much work into updating. The work they put in was totally worth it. I feel like these docs are more than just a great start to contributing to React they are really a great intro to open source development full stop.

This was perfect for a newbie contributor like me. I studiously went about watching all the videos and reading all the documentation on the pages. I watched a short video course they linked me on egghead.io on how to make pull requests and rebase before making a PR etc. which was great to brush up on seen as I’d be making such public commits in my new life as an open source contributor!

As I kept reading and watching the vids, I found one video they linked in particular to be a really great watch. It was an easy going recording of a google hangout between Ben Alpert and Kent C. Dodds. The conversation went at a nice comfortable pace and the format really helped to demystify what it meant to be an open source contributor and who the people who contribute to open source really are. Watching Kent and Ben go back and forth really helped to remind me that the people who are contributing/working on React are just regular, friendly guys and girls.

There was lots of good advice in the video as Ben talked about what to expect when contributing to React. What followed was a quick walk through of some of the things that stick out to people immediately upon first walking through the code base. Sort of a “gotcha’s safari”, if you will.

Although, There was one thing that was said during the video which put my teeth on edge immediately. Ben said, and I paraphrase, “Yeah, React is pretty stable so you won’t find that there are many bugs. We do have some bugs flagged as ‘Good first bugs’ though and these are a great way to make your first contribution…” Oh great! How helpful, I thought. I’m actually getting excited now. This is going to be fun. “…but most of them go pretty quickly”.

It would seem, not unlike the first time I went into a high end tattoo parlour expecting to be walking out with a tattoo immediately, I hadn’t really appreciated that I wouldn’t be the only newbie looking to get started. More than that I hadn’t appreciated that in all likelihood React owes at least some of it’s popularity to being so robust and thus bug-free.

Trying to remain undeterred I continued watching the videos and reading. I did this until I got into some of the documentation outlining the implementation of the code and how it all works. This is where I caught myself scanning. Don’t get me wrong, the info contained was all excellent. I made many bookmarks! But without having gotten my hands dirty in the code it was difficult to really give it context and relevance.

At this point I thought to myself, “If I was at the first day of a new job would I read all their documentation or would this be the point where I just started playing with the code until the docs had more context?” The answer was obvious. So I made a git clone and got the solution building.  Then it was off to market to look for bugs.

 

A couple of hours late for the school dance

How did hunting for a topic for my first PR feel? Exactly as the title of this section suggests. All the fun games have been played, all the available dance partners are too good-looking and the rest are happy dancing by themselves. In my case, all the bugs I thought I could do were taken, the ones that were left were all explained very well using proper English words, just not in an order I understood!

All in all it felt a bit like everyone was moving along with a great head of steam and I couldn’t really work out where to fit myself in. Desperate not to let this become another dead fork on my github account I frantically searched for something, anything, I could do to help.

Docs? All the things I knew enough about were taken. Latest features?! What about Fiber?! Yeah right! Get back to reality! I haven’t even made a PR yet!

Then something surfaced from the back of my brain. I really wish I could remember who said it or which video or blog post it was in so I could credit them. Basically what they said was that if you want to get into Open source then just do something! Anything you can find, anything that’s useful. Don’t go for meaningful straight away, just start by getting involved.

This fell into step perfectly with the idea I had earlier about “What if this was my first day on the job? What would I do?”. I’d probably find something simple to do that was useful but something I’d find hard to stuff up. You know, a confidence booster. Something to let you know that I’m are a developer and I’m worth it!

That’s when I noticed, in amongst the text that flew by on my console window during the build…LINTING ERRORS! Most were warnings about lines being past max length in the fiber project but there were some actual errors. I’d found it. A simple yet helpful way to start. Of course, I should have been asking how these errors got past CI but I was too excited to waste my time asking questions like that so off I went.

 

Look Mum I’m doing it! I’m helping!

Off I set slaying lint warnings and errors with reckless abandon.  The build pipeline was getting cleaner one misaligned double space at a time and although it was a humble beginning I was contributing.

Ten minutes later I was ready to prepare my Pull request. I don’t think I’ve ever so checked over such trivial changes so carefully in my life. A minute or two more of confirmation and I’d submitted my first PR and it was time for a victory coffee to celebrate my sheer unadulterated awesomeness at becoming a React contributor. There was even time to bask in the glow of my wife’s blank unimpressed face as I explained how much of a bad ass code ninja she was married to.

What do they say? Pride comes before the fall? The fall began whilst I did something which fell somewhere between a skip, a strut and a swagger back towards my desk victory coffee in hand. All that stopped very suddenly as I cocked my head sideways squinting at the screen trying to comprehend what I was looking at……Oh god, a red build.

My first official PR and I’d just officially and publicly proven that I was incapable of moving code 2 spaces to the left without breaking something. Oh god. Oh god. Oh god.

After giving myself the world fastest crash course circle CI’s interface to work out what was going on I realised what I’d done wrong. Remember earlier when I pointed out that I should have been asking how those linting errors got through CI? Yeah.

Turns out that the warnings were real but the linting errors appear to have been something specific to my own machine. So whilst the linting passed on my machine it was now failing on the CI server. I made another quick commit reverting the linting error “fixes” leaving behind the warning fixes whose helpfulness were most accurately described as extremely questionable. I checked in again along with an apology message.

The build passed and although I was still happy with my self I now existed with an ego whose size was fair more manageable.

 

Now to walk off into the sunset

There you have it, that’s the story so far. I don’t quite have the notoriety as a super hacker open source ninja yet but all those guys who’ve earned that title merged their first PRs once upon a time as well. The important thing is that I’ve taken my first step.

All in the all the whole experience has made me far more confident in my ability to move forward in the whole process. My challenge from here and going forward will be to, with each commit, try to find better and more meaningful ways to contribute until I can do some real good.

It will be an incremental process but I’m convinced it will be for the best. In this light, I’ve decided to set my sights on learning enough about the renderer. Once I’m able to understand how that works I can then start looking into helping with Fiber and try to be useful in that space…eventually.

At the end of the journey to shake off my wannabe contributor title, what advice would I give to other wannabe contributors? I guess it would be this: don’t wait. Start now. Clone a repo and start learning it. Whilst you’re doing that understand that it will take some time to ramp up to being useful. It takes time to ramp up in any code base but don’t be discouraged.

Remember that talking about wanting to be an open source contributor for two years like I did won’t make you an open source contributor. Putting in the effort to make yourself a useful member of a community centred around your favourite repo will.

If this article has inspired you to start your open source journey then please do share your story with me and The Reactionary community. Get in touch in the comments below or any or my social medias (the links are at the top of the page).