Release 0.2 – Fixing bugs 593 and 589 in Mozilla Brackets

For release 0.2 I decided to pick two bugs to fix on Mozilla Brackets. They are:

My pull requests for these two bugs are:

Fixing issue #589:

Fixing this issue I found to be quite interesting and learned a lot from it. The issue was that we needed to update the dependencies and devDependencies in the package.json file and ignore the updates for the dependencies and devDependencies that Adobe uses upstream. As humphd stated, these dependencies/devDependencies would get updated later when merging with Adobe upstream.

I fixed this issue by using a tool called npm-check. This tool helped me find the dependencies/devDependencies that needed to be updated in the package.json file. When I installed it and ran it, it displayed this:

Screen Shot 2017-02-24 at 11.48.31 AM.png

Screen Shot 2017-02-24 at 11.53.05 AM.png

This is a list of all the dependencies/devDependencies that Mozilla Brackets uses in the package.json file that had updates available. By running the command npm-check -u it enabled me to select all the dependencies/devDependencies that I wanted to updated. This looked like this:

Screen Shot 2017-02-24 at 12.03.18 PM.png

After I had selected all the dependencies/devDependencies I wanted to update (ignoring the dependencies/devDependencies that Adobe uses) the tool updated them for me and also updated the version number in the package.json file. I reinstalled bramble and ran it using these commands:

  • npm install
  • npm run build
  • npm start

And got a few error messages that looked like this:

Screen Shot 2017-02-24 at 12.36.37 PM.png

This error message was caused from updating the autoprefixer-core dependency. It caused the postcss dependency to not work correctly. I fixed this problem by switching over to autoprefixer and changing the code in the Gruntfile.js for the postcss task as humphd suggested. After doing this it fixed the problem and bramble installed and ran without any errors.

Fixing issue #593:

Fixing this issue I found to be simple. The file got added when we merged with upstream. There were two options that were suggested to fix this problem. Either to remove the file completely or to modify it to fit our project. As suggested by humphd I needed to modify to file to fit our project instead of removing it.

I modified the file by using vim to change the text in the file. humphd suggested to modify the file with these suggestions:

  • Get rid of the Prerequisites section
  • Keep the section on Steps to Reproduce, Expected and Actual behaviour
  • Change the Versions section to be about which browser (name and version) and OS the user is using

After modify the file using vim to make these changes I created my pull request and it got accepted.

I learned a lot from fixing these issues especially updating the dependencies/devDependencies in the package.json file. I never installed a npm tool before and found that installing one like npm-check can be quite helpful when fixing a bug. I learned how to install the npm tool by using these videos that are available here which is from the npmjs website. I also learned that updating module dependencies/devDependencies in the package.json file don’t always work as planned and you have to sometimes rewrite code to work with the new APIs they use.

Overall, I found solving these 2 bugs in Mozilla Brackets to be interesting and fun. I learned a lot from solving issue #589 and found using an npm tool such as npm-check to be helpful and time saving when updating a lot of dependencies/devDependencies in the package.json file. Also I learned that updating dependencies/devDependencies don’t always go as planned and you need to sometimes rewrite code in order to get the updates to work correctly, which is what I had to do to get autoprefixer and postcss working.


Leave a Reply

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

You are commenting using your 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 )

Google+ photo

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

Connecting to %s