DEV Community

Yuan-Hsi Lee
Yuan-Hsi Lee

Posted on

Hacktoberfest - Week 3

The third week of Hacktoberfest! Hooray!

This week I'm trying something new, jQuery. I know it is a popular Javascript library but I just never get a chance to dig into it. The challenge that I gave myself this week is to learn the basic jQuery knowledge and complete a pull request by working on jQuery.

In the first week of the open-source course, I mentioned that I have an interest in working on browser extensions. My professor sent me an issue of a repo and encourage me to try it. At that time, I just quickly viewed the repo and realize it is too big for me and I don't have any experience working on jQuery. This week, I was thinking that since I have some experience working on browser extensions and have enough time and confidence, I should pick up this repo and solve an issue.

This repo is a browser extension for Twitter called refined-twitter. It helps users to customize their pages by hiding the components that they don't want to see such as sidebars, promoted ads.

The issue I choose to solve is "Search function gone with 'What's Happening' and 'Who To Follow' boxes". They used to have different options for removing the "trending" and "who to follow" components. However, after Twitter changed the UI, these 2 options no longer worked. They created a new option for hiding these 2 components but this also takes the search tab away.

After watching jQuery tutorial videos and check the documentation of jQuery, I started to look into the repo. I started by checking other options' js files and use keywords search to see the related files. For solving this issue, it doesn't have to make changes for other files since this option has already existed in the current panel. I only need to modify the content.

The current line of code to remove the components is to hide the whole sidebar. Instead, I just make the "What's happening" and "Who to follow" boxes hidden. In this way, the footer including copyright and navigations of Twitter and the Search tab will still remain on the page.

This PR took me 2 days to learn jQuery, 1 day to read the repo, and only 3 hours to solve the issue. It reminds me of what my professor said, "Programming is 90% reading, 1% writing, 9% debugging." Especially, when we work as a team or contribute to open-source projects, we need to spend time reading other people's code and try to understand and adopt the way they code. This can also teach us new skills, tools that we never thought about. For example, in the repo that I worked on last week, they use ESLint to maintain the code. I've never thought about using tools to remain consistent and how important this is in a group project.

Looking forward to having more surprises in the next PR!

Top comments (0)