Hello, everyone! Today I’m going to tell you how I’ve contributed to the Angular community. You will learn about the contribution process to a large open-source project and I’ll shed light on the code review. Let’s get started!

Issue

In my previous job, we had a long-lived SPA application, which the user may keep open for a very long time. And at some point, we noticed that some Observable of HTTP request was never completed.

Sad Observable, that is never completed

After doing some small amount of research, we discovered that Angular doesn’t respond to outer XMLHttpRequest.abort() in the case when the browser cancels HTTP requests itself. That situation occurs when the user turns off the device to sleep mode or presses Ctrl+S to save a web page. We even found the appropriate issue. And someone had already made a pull request (PR) to fix this bug. We wrote a workaround with XhrFactory inside our project, expecting that the fix would be released.

But when I checked the fix status six months later, I found out that the issue was still open. And the PR was canceled since the author didn’t update it. Then I decided: “This is my chance to try open-source developing.”

Contribute process

First of all, I read through Angular’s contributing guidelines, which you can find in the  COUNTIBUTING.md file. Here is a list of what you need to do so that the Angular team will consider your PR:

  1. Search  GitHub for an open or closed PR that is related to your submission.
  2. Fork the project.
  3. Create a new branch based on “master”.
  4. Write your code and at least one test to it following Code Style.
  5. Run the full Angular test suite.
  6. Commit your changes with the right message.
  7. Sign Contributor License Agreement (CLA).
  8. Create a PR to the “master” branch of Angular.

#javascript #open-source #typescript #angular

How I Fixed a Bug in Angular
2.30 GEEK