Skip to content

Instantly share code, notes, and snippets.

@Lalit3716
Last active December 11, 2023 23:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Lalit3716/e60e6697631a4b61cb0a40157dc4e516 to your computer and use it in GitHub Desktop.
Save Lalit3716/e60e6697631a4b61cb0a40157dc4e516 to your computer and use it in GitHub Desktop.
This document describes all the open source work I did during summer 2023 @zulip under Google Summer of Code program.

Google Summer of Code'23 @Zulip - Work Report


Overview

This summer I worked on migrating Zulip's Web frontend codebase from JavaScript to TypeScript. TypeScript is just JavaScript added with extra syntax for having strict type checking. It is an awesome language migrating to it improved the quality, maintainability, and reliability of Zulip's frontend codebase. Apart from this I also worked on doing many refactorings, breaking import cycles in the codebase, and also fixed some bugs 🐛.

Challenges

So my project was to change extensions of some javascript files from .js to .ts and add some types to those files, sounds simple and straightforward right? Well it turned out not so straight forward :\ , Zulip's frontend codebase is huge around 300 files and still growing! Now to figure out type definitions for some modules I had to dig in all other modules linked with it and sometimes I had to dig in server code as well for getting most precise types, not to mention all the code refactoring needed for some modules. Figuring out types for some core data entities like Message, StreamSubscription, User are especially hard because these entities are used throughout the codebase in lot of functions.

Import cycles are also a major challenge for this project, Zulip's frontend codebase have some quite large import cycles between lot of files, now to migrate one javascript module in those large cycles you either have to break that module out of that large cluster or handle all the modules of that cycle simultaenously and hence I also worked on breaking some import cycles throughout the codebase.

Finally, as one of my GSoC peer said - Every javascript file felt like a puzzle when migrating it to typescript. 😄

Work

Since Zulip development community is absolutely amazing, I was active even before GSoC and hence I was really comfortable with community before the community bonding period started. So I ended up using that time to work on my project in addition to continue bonding with community, so the work I mention below includes PRs merged during the community bonding period as well. Those PRs are marked with a *.

For the sake of simplicity let's break my work in 4 sections:-

  1. TypeScript migration PRs
  2. Breaking import cycles and other refactoring PRs
  3. Bug fixes and others
  4. Participation in community/Code Reviews

Quick Links -

TypeScript migration PRs

For figuring out type definitions for many of the below mentioned modules I used the zulip's api documentation which is very extensive!

Breaking import cycles and other refactoring PRs

Bug fixes and others

Participation in community/Code reviews

All of the zulip development related conversations happens on the Zulip iteself!, more specifically at CZO, although I have actively participated in many topics/threads I will list some of them here -

List of all PRs I reviewed -

Future Scope

There are still lot of files left to migrate to TypeScript, this include the files involved in major import cycles like compose/narrow family of modules, so we will need to either stub some modules to migrate that cluster or break some more import cycles. Most of the remaining files though are fairly easy to migrate to typescript now since most of the major core data modules are already migrated to typescript, so migrating the remaining modules will just require us to use already prepared types from the other modules.

My overall experience

Overall my GSoC experience with Zulip was wonderful, I got to learn so many new things! I got to learn the rebase-based git workflow, I had rarely used rebase git command before contributing to Zulip, but I am glad I got to learn about it because it really helps to keep your PRs neat and tidy! I also picked up some more advanced typescript features, for example I learned how to make types with mutually exclusive properties using | operator and a lot more.

Apart from the technical skills, I also got to learn the importance of code reviews, regular checkins, communicating in the community and in general I learned how to work in a large community to develop a software that thousands of people uses!

Since I had such a great time contributing to Zulip, I definitely plan to keep contributing at Zulip as well as many other open source projects out there :)

@kushasupaya
Copy link

Can I join the team to contribute to the project. I have 2+ of experience working with JS/TS projects.

@RuhaniMakhija
Copy link

Hello i can join and contribute to the project. I am working as a frontend Developer and experience in JS, TS, ReactJS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment