Release 0.1 – Getting Started

We were given the opportunity to contribute to our first open source project i.e Filer. The main aim of Release 0.1 was to learn how to contribute to an Open source project and getting ourselves familiar with the Git and Github.

What changes we made?

Filer was currently using var everywhere and the purpose of Release 0.1 was to update the code to use let, const, and strict mode where applicable.

Why let and const preferred over var?

Well, according to the new update, it is preferred to use let and const over var due to many reasons which are listed below:-

  • Let declares a blocked scope variable which can be reassigned easily
  • Const declares a constant variable which can’t be reassigned
  • Var declares a global variable hence we can’t declare another variable with the same variable name

You can refer to this doc to get further information on when to use var, let and const. Now let’s go over the strict mode!

Strict Mode?

ECMAScript 5 introduced strict mode to get rid of Javascript silent errors and prohibiting some syntax. You can add ‘use strict mode‘ at top of the file. Using let and const but not using strict mode will throw a Reference error. Please refer to this MDN doc for more info.

Process

I decided to modify FS-watcher.js file changing the var variable to let and const where applicable. Also, I added the strict mode getting rid of the reference error. After you decide which file you want to work with, you need to follow the steps listed below:-

  • Create an issue by clicking on the new issue button. Provide a title which includes the file you are modifying and the bug name.
  • Fork the Filer repository
  • Clone the forked repository through git bash or with any git client (eg- TortoiseGit).
  • Create a new branch and use the issue number as your branch name.
  • Open the project in VS code and run npm install.
  • After installation, run npm test to make sure everything is working.
  • Make changes you want and run npm test again.
  • Commit your changes to the new branch if it passes all the tests.
  • Create a pull request to merge your code in the master branch.

Here is the link to my PR and Issue that I’ve created.


Issue: https://github.com/filerjs/filer/issues/707

Pull Request: https://github.com/filerjs/filer/pull/712

Reviewed Pull Request: https://github.com/filerjs/filer/pull/706

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s