DEV Community

Cover image for My Final Week Of Open Source at Seneca
Andre Willomitzer
Andre Willomitzer

Posted on

My Final Week Of Open Source at Seneca

What the class was about

For those who haven't seen some of my previous blogs about the OSD600 open source class at Seneca College here is some background... My name is Andre Willomitzer and I am a Seneca College student taking this class. I am trying to specialize in JavaScript/TypeScript/NodeJS and web development.

OSD600 is about contributing to open source projects on GitHub, collaborating with professional developers/maintainers and also our fellow students. The goal of this is to learn how to leverage the community and learn from each other to build better software and learn best practices.

Throughout the class we have built our own static site generators and also contributed to a variety of projects "out in the wild".

The Final Release 0.4

For the final release we are supposed to once again pick an open source repository. I have chosen solr-node-client which allows you to run solr on NodeJS using a Docker container. What I was hoping to fix in this repository that one of the maintainers Igor Savin told me about is that the tests were not browser compatible (he knew about that).

The repository did not yet have browser tests set up, but he knew that the Undici library was not compatible with browsers.

First Steps

To run browser tests, I decided to use Karma. It is something I previously set up in another TypeScript project, and since the existing tests use describe() and it() functions it seemed like the best choice again.

First I installed the dependencies such as jasmine-core, karma, karma-chrome-launcher, karma-jasmine, and karma-typescript. These allow the Jasmine tests to run and also compile typescript using pre-processing. I also added a script to the package.json file to run the karma --start command.

Next I had to create the config file (note the compiling to JS from TS):
Image description

Running The Tests

Well running the tests went about as well as expected (3-4 errors and very cryptic). One of the errors was esModuleInterop which means one of the modules was using an older import statement no longer compatible. I went and fixed several imports such as:
Image description

After that it was just 1 error left... And that is where I got stopped in my tracks. The error was once again very cryptic. It said one of the imports was not a function even though I used require() in the exact same way as my other imports.

Due to this, I was unable to even run the existing tests using Karma to try and fix the Undici errors.

Unfortunately, I was unable to solve the issue of browser incompatibility. I believe this was in part to choosing a repository which I had no prior experience with... on top of it being a really complex issue but I was hoping to push myself. However, I am satisfied because I learned a lot still during this project.

My takeaways

Working on this project has exposed me to learning how to install Docker on Windows 10 which I will likely need to do at some point in my future as a developer. Furthermore, I learned how to configure Karma for a project that runs tests using a container like Docker which required some extra set up. I was also able to learn about debugging cryptic errors when setting up configurations for things like Karma, and Docker which required a lot of determination.

In addition, due to my own struggles and taking a long time to set up Docker Desktop I wrote README documentation in the repository about how to do it for future developers who want to contribute. I found a lot of my time was spent initially getting the Docker container running rather than actually trying to fix the issue at hand. So if other developers can avoid that it's good.

Conclusion... It's about the friends we made along the way.

I have learned an immense amount during OSD600 at Seneca. I got the chance to work on some amazing projects like jasmine, toad-scheduler where I got to fix a setInterval() bug, and solr-node-client. These projects have exposed me to professional development workflows and how development is done "in the real world" with tools like linting, automated testing, continuous integration. All things I was previously unaware of.

Although I am a little sad I was unable to fix the issue I set out to in this Release 0.4, I feel that it was valuable and I plan to continue contributing to Open Source in my future whenever possible. I met some amazing people who have been extremely helpful and kind in letting a new developer such as myself work on their repositories.

I plan to take OSD700 next winter if I can, after I complete my internship. In the meantime I would like to contribute to more open source projects even if it's small fixes. It's a fun way to learn and meet interesting people.

Top comments (0)