Release 0.1

Tony He
Tony He
Sep 24 · 4 min read

This assignment from Open Source Development course is a great exercise to understand how git and Github work. It also gives us opportunity to learn how to cooperate with other developers in the open source community.

Fixed Issues

Issue #1 https://github.com/KarlaChen/my-note/issues/4

We were asked to find a bug on peer student notepad app. I went through some apps and tested to see if it works as expected. I came across a problem with the linked issue above. Once the user saves note with original default message “Welcome to my notepad!” or part of it, pop up message shows “No data to be saved”. However, if the page is reloaded, actual note did get saved. So I decided to fix it. I followed standard process to fork the repo, clone to my local drive, create a new branch, change and commit the code, push to my branch, then send a pull request. The request link is as below:

I simply removed the condition to check if the entered note match the default string “Welcome to my notepad!” partially. In this case, if the notepad is empty, default message will be displayed. If the user did not change the default message, “Welcome to my notepad!” will be shown if reloading the page. For other cases, note will be saved and reflected after refreshing the page.

Issue #2 https://github.com/RyanWils/my-note/issues/12

The second task is to add a feature to an existing app from a different repo. I went through quite a few peer apps and found one that already have Save and Clear buttons. I think it is worthwhile to add a Download button to save the note to local drive. The change requires to add a script called FileSaver.js. Then, I simply added a function call when button click event happens. The function code is shown below:

function download() {

var b = new Blob([document.querySelector(‘#note’).innerHTML],

{type: “text/plain;charset=utf-8”});

saveAs(b, “note.txt”);

}

Once button is clicked, whatever the user input will be saved as note.txt file on local drive. I went through the same processes as in Issue #1 and submitted a pull request as listed below:

https://github.com/RyanWils/my-note/pull/13

Review for Pull Request

I received one issue and pull request on my own notepad repo. It was about adding default text if the notepad is empty. The change was really straightforward. However, because the submitter changed the format of my original code, once pull request was received, almost all lines got changed due to different spaces, indentation, etc. It was not very obvious to me where the submitter did the change. I think if I want to make contribution to others’ code, it is better to maintain the style and format of the original developer. Only codes related to the issue or function needs to be changed or added, so it will be very clear for the maintainer which part is changed.

The pull request review link is as below:

Lessons Learned

Overall, it was a fun and exciting experience to get involved in open source community. I really enjoyed searching for issues as well as helping others to improve their codes. Reflected back on the whole processes, there are a few things I want to address:

  • The open source development process is time consuming. It involves back and forth among all people involved in an issue. Sometimes it takes days to get feedback. For this assignment, I started relatively late, which ended up not getting merged for my contributions before the due date. In the future, I will try to start as early as possible.
  • Although learning to do things by yourself is fun and challenging, sometimes it is much better to ask for help. Other developers know a lot that I do not know before. If come across any issues, it is time efficient to seek help from others. If any specific functions or features are good to add for my own, it is OK to copy from existing code from others given the license permits.
  • It is very exciting to know that in the open source community one can get involved in big famous projects such as React, Git, Angular, etc. I need to get used to wandering in the community and scan codes often. It not only provides great opportunity to learn coding, but also experience to contribute to the world in a simple way. Some projects look intimidating at the beginning, but we still be able to contribute in small pieces.
    Tony He

    Written by

    Tony He

    Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
    Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
    Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade