← Posts

Why I Contribute to Open Source

Growth through open source and lessons learned from analyzing code

·6 min read
#open-source#opensource#contribution#maintainer#developer-story#learning

들어가며

'나는 왜 오픈소스를 하고 있을까?'

나는 오픈소스를 좋아한다. 시간 날 때마다 깃허브에 들어가서 오픈소스를 구경하기도 하고, 기여하기도 한다.

그런데 문득 이런 생각이 들었다. 나는 왜 오픈소스를 하고 있을까?

오픈소스와 어떻게 친해졌나

나는 개발을 시작할 때부터 다른 개발자들의 코드를 자주 참고했다. 실무에서는 어떤 식으로 코드를 짤까 항상 궁금했었기에, 깃허브에 공개된 다양한 사이드 프로젝트들을 살펴보았다. 코드를 읽다 보니 자연스럽게 PR 히스토리까지 파고들게 되었고, 그들이 어떤 고민을 거쳐 이런 구조를 만들었는지, 왜 이런 라이브러리를 선택했는지 등 많은 인사이트를 얻을 수 있었다.

점차 React, Tanstack Query 같은 오픈소스 라이브러리들에도 관심이 생겼다. 그래서 가볍게 스터디를 통해 React를 까보면서 직접 바닐라 코드로 구현해보기도 했다. 오픈소스를 더 깊이 이해하고 싶었기 때문이다.

그러다 깃허브의 Contributors 섹션을 보며 '나도 여기에 이름을 올리면 좋겠다'는 생각이 들었고, 문서 번역이나 오타 수정 같은 작은 기여부터 시작했다.

여러 오픈소스 프로젝트에 기여하면서 운이 좋게도 Suspensive의 메인테이너로 활동하게 되었고, 좋은 인연들도 많이 생겼다.

Suspensive ContributorsSuspensive Contributors

그러다 문득 깨달은 것이 있다. 우리가 당연하게 여기며 매일 사용하는 도구들 대부분이 오픈소스라는 것이다. 이러한 오픈소스 프로젝트들은 개인이나 회사가 운영하고 있지만, 수익보다는 커뮤니티의 후원과 기여에 의존해 프로젝트를 이어가고 있다.

그래서 이제는, 거창하게 들릴 수 있겠지만 생태계의 발전을 위해 기여한다. 개발자들이 관심을 갖고 도와야 이 생태계가 긍정적인 방향으로 나아갈 수 있기 때문이다. 눈에 띄지 않는 작은 기여일지라도, 프로젝트를 이해하고 공감하는 마음에서 비롯된 것이라면 충분히 의미가 있다. 이러한 작은 노력이 모여 결국 우리 모두에게 혜택으로 돌아올 것이라고 믿는다.

나는 소소하지만 후원 활동도 하고 있다. GitHub Sponsors를 통해 오픈소스 프로젝트 또는 메인테이너에게 후원하면서, 그들의 노력에 조금이나마 보답하고자 한다.

GitHub SponsorsGitHub Sponsors

오픈소스 분석하기

구조 파악하기

프로젝트의 전체적인 구조를 파악하는 것부터 시작하자. README는 프로젝트의 대문이다. 여기서 이 코드베이스가 어떤 문제를 해결하는지, 어떤 기능을 제공하는지 파악할 수 있다. 공식 문서의 getting startedintroduction 섹션에서 더 자세한 내용도 알 수 있다.

폴더와 파일들의 관계를 그려가면서 각각의 역할을 이해하는 것이 좋다. 이때 단순히 파일 구조만 보지 말고, 주요 파일들이 어떻게 상호작용하는지 흐름을 따라가보자.

구조를 파악하는 팁

나는 보통 아래와 같은 순서로 분석한다.

  1. 프로젝트의 entry point(예: index.ts) 파일 찾기
  2. 주요 폴더들의 역할 파악하기
  • src/
  • packages/
  • examples/
  • tests/
  1. import/export 관계를 따라가며 코드 흐름 그려보기

히스토리 살펴보기

프로젝트의 히스토리도 중요한 학습 자료다. 과거의 PR들을 보면 현재 코드베이스가 어떤 고민과 의사결정을 거쳐 이렇게 구현되었는지 이해할 수 있다. 때로는 내가 떠올린 아이디어가 이미 논의되었을 수도 있고, 왜 그 방향을 선택하지 않았는지 알 수 있다.

분석하기 전에 체크할 것

프로젝트마다 필요한 사전 지식이 다르다. 타입스크립트로 작성된 프로젝트라면 타입스크립트에 대한 이해가, 특정 도메인의 문제를 해결하는 프로젝트라면 해당 도메인 지식이 필요할 수 있다. 분석하기 전에 필요한 지식을 먼저 파악하고 준비하자.

오픈소스에 기여하기

기여 시작하기

처음부터 모든 코드를 이해하려 들지 말자. 히스토리를 모르는 수많은 코드를 완벽히 이해하는 것은 불가능에 가깝다. 대신 관심 있는 부분, 기여하고 싶은 부분에 집중하자. 문서화부터 시작해도 좋고, 작은 버그 수정부터 시작해도 좋다.

PR 작성하기

먼저 CONTRIBUTING.md 문서를 꼭 확인하자. 이 문서에는 PR 작성부터 커밋 메시지 컨벤션, 코드 스타일 가이드 등 프로젝트가 원하는 기여 방식이 상세히 나와있다. 이 가이드라인을 따르지 않으면 좋은 기여라도 수정 요청을 받을 수 있다.

변경사항을 명확하게 설명하고, 관련된 이슈가 있다면 반드시 언급하자. 리뷰어가 쉽게 이해할 수 있도록 작성하는 것이 중요하다. 코드 변경이 필요한 이유와 어떤 문제를 해결하는지 구체적으로 설명하면 더 좋다.

소소한 PR 작성 팁

나는 PR 설명을 작성할 때 AS-ISTO-BE 섹션을 나눠서 설명한다.
현재 상황과 문제점, 그리고 변경 후에 어떻게 개선되는지를 스크린샷이나 짧은 영상을 함께 첨부한다.
시각적 자료는 글로 설명하기 어려운 부분을 효과적으로 전달할 수 있고, 메인테이너의 리뷰 시간도 크게 줄여준다.

본인이 작성한 코드에 직접 코멘트를 달아두는 것도 좋다.
중점적으로 봐줬으면 하는 부분이나, 이런 방식으로 구현해도 괜찮을지 확신이 없는 부분에 대해 미리 의견을 구할 수 있다. 이런 적극적인 소통은 리뷰 과정을 더 효율적으로 만든다.

이슈 올리기

이슈를 올리거나 코멘트를 남기는 것도 중요한 기여다. 버그를 발견했다면 재현 방법을 자세히 설명하고, 해결 방안에 대한 생각도 함께 공유하자.

이슈를 작성할 때는 아래 내용을 포함하면 좋다.

  • 어떤 상황에서 발생하는지
  • 예상한 동작과 실제 동작의 차이
  • 문제를 재현할 수 있는 최소한의 코드 (codesandbox 등으로 재현 가능하면 좋음)
  • 개발 환경 정보 (OS, 브라우저, 라이브러리 버전 등)

마치며

처음에는 모든 것이 낯설고 어려워 보일 수 있다. 나도 처음에는 망설였지만 작은 것부터 시작하니 생각보다 어렵지 않았다. 문서의 오타를 고치고, 번역에 참여하면서 자연스럽게 프로젝트를 이해할 수 있었다.

나는 좋은 오픈소스를 많이 보고 배울 수 있었다. 앞으로도 꾸준히 코드를 읽고, 기여하면서 성장해나갈 것이다. 우리는 매일 수많은 오픈소스의 도움을 받고 있는 만큼, 이제는 우리가 이 생태계에 작은 것이라도 기여할 차례다.

오픈소스 기여는 완벽하지 않아도 괜찮다.

"Perfect is the enemy of good."

오픈소스 기여는 완벽하지 않아도 괜찮다. 오히려 완벽해야 할 필요가 없다. 오픈소스는 모두가 참여하는 곳이다. 작은 기여도 의미가 있다.

Introduction

'Why am I doing open source?'

I love open source. Whenever I have free time, I go on GitHub to browse open source projects and contribute to them.

But one day, this thought occurred to me. Why am I doing open source?

How I Became Friends with Open Source

From the very beginning of my development journey, I frequently referenced other developers' code. I was always curious about how code is written in real-world projects, so I explored various side projects published on GitHub. As I read through the code, I naturally dug into PR histories and gained many insights into what deliberations led to their architecture, why they chose certain libraries, and more.

Gradually, I became interested in open source libraries like React and Tanstack Query as well. So I casually started a study group where we dug into React's internals and I even implemented it from scratch in vanilla code. I wanted to understand open source on a deeper level.

Then, while looking at the Contributors section on GitHub, I thought 'It would be nice to have my name there too,' and started with small contributions like documentation translations and typo fixes.

While contributing to various open source projects, I was fortunate enough to become a maintainer of Suspensive, and I've made many great connections along the way.

Suspensive ContributorsSuspensive Contributors

Then I had a realization. Most of the tools we take for granted and use every day are open source. These open source projects are maintained by individuals or companies, but they rely on community sponsorship and contributions rather than revenue to keep the projects going.

So now, and this might sound grandiose, I contribute for the advancement of the ecosystem. Developers need to show interest and help for this ecosystem to move in a positive direction. Even a small contribution that goes unnoticed, if it comes from understanding and empathy for the project, is meaningful enough. I believe these small efforts accumulate and eventually benefit us all.

I also engage in modest sponsorship activities. Through GitHub Sponsors, I sponsor open source projects or maintainers, hoping to give back even a little for their efforts.

GitHub SponsorsGitHub Sponsors

Analyzing Open Source

Understanding the Structure

Start by understanding the overall structure of the project. The README is the front door of a project. Here you can understand what problems the codebase solves and what features it provides. You can find more detailed information in the getting started or introduction sections of the official documentation.

It's helpful to draw out the relationships between folders and files while understanding each one's role. Don't just look at the file structure — follow the flow to see how the main files interact with each other.

Tips for Understanding the Structure

I usually analyze in the following order:

  1. Find the project's entry point (e.g., index.ts) file
  2. Understand the roles of the main folders
  • src/
  • packages/
  • examples/
  • tests/
  1. Trace the import/export relationships to map out the code flow

Exploring the History

A project's history is also an important learning resource. By looking at past PRs, you can understand what deliberations and decisions led to the current codebase's implementation. Sometimes an idea you came up with may have already been discussed, and you can learn why that direction wasn't chosen.

Things to Check Before Analyzing

Each project requires different prior knowledge. If the project is written in TypeScript, you need an understanding of TypeScript; if the project solves problems in a specific domain, you may need domain knowledge. Identify and prepare the necessary knowledge before analyzing.

Contributing to Open Source

Getting Started with Contributions

Don't try to understand all the code from the start. It's nearly impossible to fully understand a vast amount of code without knowing its history. Instead, focus on the parts that interest you or that you want to contribute to. Starting with documentation is fine, and starting with small bug fixes is fine too.

Writing PRs

First, make sure to check the CONTRIBUTING.md document. This document contains detailed information about the project's preferred contribution methods, from PR writing to commit message conventions and code style guides. Even good contributions can receive revision requests if they don't follow these guidelines.

Clearly explain your changes, and be sure to mention any related issues. It's important to write in a way that reviewers can easily understand. It's even better if you specifically explain why the code change is needed and what problem it solves.

Casual Tips for Writing PRs

When writing PR descriptions, I divide them into AS-IS and TO-BE sections.
I describe the current situation and problems, and then how things improve after the change, attaching screenshots or short videos.
Visual materials can effectively convey parts that are hard to explain in writing, and they also significantly reduce the maintainer's review time.

It's also a good idea to leave comments on your own code.
You can proactively ask for opinions on parts you'd like reviewers to focus on, or parts where you're unsure if your implementation approach is appropriate. This kind of active communication makes the review process more efficient.

Filing Issues

Filing issues or leaving comments is also an important contribution. If you've found a bug, describe the reproduction steps in detail and share your thoughts on potential solutions as well.

When writing an issue, it's good to include the following:

  • Under what circumstances it occurs
  • The difference between expected behavior and actual behavior
  • Minimal code to reproduce the problem (preferably reproducible via codesandbox or similar)
  • Development environment information (OS, browser, library versions, etc.)

Closing Thoughts

At first, everything may seem unfamiliar and difficult. I hesitated at first too, but starting small made it less daunting than expected. By fixing typos in documentation and participating in translations, I was able to naturally understand the projects.

I was able to see and learn from many great open source projects. I will continue to read code, contribute, and grow. Since we receive help from countless open source projects every day, it's now our turn to contribute even something small to this ecosystem.

Open source contributions don't have to be perfect.

"Perfect is the enemy of good."

Open source contributions don't have to be perfect. In fact, they don't need to be. Open source is a place where everyone participates. Even small contributions are meaningful.