DEV Community

Rachit Chawla
Rachit Chawla

Posted on

My First Dive into Big Open Source: Tackling Blocksuite

Introduction

In the bustling realm of open source collaboration, I recently took a plunge into the Blocksuite project—a robust playground with 3.1k stars and a thriving community of 102 contributors. My mission? Tackling a TypeScript type error lurking in the shadows of vite.config.size.ts (PR #5412). This journey was a profound exploration, not just into code but also into the collaborative spirit that powers open source development.

The Challenge Unveiled

The challenge at hand was a TypeScript type error that surfaced in the vite.config.size.ts file. The crux of the issue lay in the type inference of the 'base' configuration. While TypeScript anticipated a function call, it turned out that 'base' was a function itself. The consequences were disruptions in the build process, creating a less-than-ideal development environment.

Crafting the Solution

To tackle this challenge head-on, I implemented a two-fold solution. First, I introduced explicit type annotations to define the type of the 'base' configuration in vite.config.size.ts. Second, I ensured that the 'base' function received the necessary parameter { mode: process.env.NODE_ENV }. These changes were carefully crafted not only to resolve the TypeScript type errors but also to pave the way for a more seamless build process.

  • Modified vite.config.size.ts: Invoked the 'base' function with the required parameter.

Testing the Waters

Before presenting my contribution to the broader Blocksuite community, I conducted comprehensive local testing. The goal was clear: ensure that the modifications eradicated TypeScript type errors and that the build process ran effortlessly.

The Pull Request Odyssey

The journey of my pull request was more than a mere submission. It evolved through multiple commits, with each commit addressing a specific aspect of the codebase. As an advocate for clean and organized code, linting became a prominent feature of this coding adventure.

Automated Checks and Reviews

The Blocksuite project boasted a robust set of automated checks and reviews. The CI workflow, Size Report workflow, and 10 ECE Playground checks played a pivotal role in validating the integrity of my contribution. The Vercel deployment previews provided a tangible preview of the impact of my changes.

The CLA Hurdle

The open-source adventure presented an unexpected twist in the form of the Contributor License Agreement (CLA). Signing the CLA was a necessary step, symbolizing a commitment to the collaborative spirit of open source.

Title Lint Challenge

One unexpected challenge surfaced during the PR title lint check. Adjustments were made to align with the supported scopes, ensuring that the pull request adhered to the project's conventions.

Merge and Approval

After navigating through these challenges, the moment of truth arrived. The changes were reviewed, approved, and officially merged into the Blocksuite project. This collaborative effort was made possible with the guidance of project maintainers and contributors, notably @doodlewind.

Conclusion

My inaugural journey into a significant open source project like Blocksuite was more than a coding challenge; it was an enriching experience. From decoding TypeScript errors to navigating the intricacies of testing and review processes, each step brought valuable lessons. As I conclude this chapter, I carry not just the satisfaction of resolving an issue but also a deeper understanding of collaborative coding in the open source community. This adventure marks a milestone in my journey as a contributor, and I eagerly anticipate more challenges and collaborations in the vibrant world of open source.

Top comments (0)