What I learned this week #2

SVRourke
5 min readSep 24, 2021
Photo by Green Chameleon on Unsplash

This is the second article I’ve written documenting what I’ve learned in the previous week the purpose of these articles is to show my work I hope that by documenting my learning I can get a better understanding of my progress, and If my writing about it inspires or interests anyone then that’s a great side effect. When I wrote the last article I was halfway through building a habit tracker to learn node, express, mongoose, and MongoDB. In addition, I wanted to learn more about Mocha and Chai testing for JavaScript and do a deep dive into Git.

Life is what happens to us while we are making other plans.

Photo by Roberto Cortese on Unsplash

Shopify Internship

At the time of writing this article, I am mid-job-search and on Thursday I received an email about remote internships at Shopify which piqued my interest. Upon further inspection, the soonest-starting applicable internship was closing applications the following Tuesday. I continued to read about the internship becoming more and more hopeful that I might be able to participate and I would have applied that day but there was one requirement I had to meet which I couldn’t Immediately: the programming challenge. I had 5 days to fulfill the requirements and build the best Rails app I could. (I’m writing an article about the process the link will be here when I’m done)

Photo by Wesley Tingey on Unsplash

ActiveStorage

I’ve been using Rails for around a year and a half now, and for the most part, I feel like I can go from idea to basic prototype rather quickly, however for whatever reason I had never used one key aspect of Rails in any of my projects: ActiveStorage. Many times I’ve thought to myself that I should come up with a project and use it but It never happened until I found the Shopify Internship. I’ll save specifics for the inevitable article about the project however I will say that the project involved uploading Images. I did not have particularly challenging requirements for the project and thus the amount of ActiveStorage functionality I had to pick up was minimal. It is very easy to upload images to the server and attach them to a model, ActiveStorage even provides a configuration YAML file if you’d like to store the files elsewhere like Google Drive, AWS, etc. I’m eager to use it in another project soon.

Photo by Chris Liverani on Unsplash

RSpec

I have to admit up until last week I have been half attempting to do TDD but mostly avoiding testing my code. I had recently started messing around with Mocha and Chai for JavaScript but the Shopify project required comprehensive testing. I picked RSpec and dove in, I was not completely unfamiliar with RSpec before this week but I had never written tests as comprehensive as these. After writing the tests for the Shopify project I honestly feel like I’ve wasted a significant amount of time blindly feeling my way through functionality and excessive debugging. In terms of usage, RSpec is very easy and I was even able to use vscode’s built-in debugging to run and write my tests.

Photo by Minh Tran on Unsplash

Bootstrap 5 (adding to rails app)

I tried bootstrap once or twice a few versions ago but admittedly I didn’t see a real use for it. I use SASS for most of my projects and I genuinely enjoy styling the front end. For the Shopify project, the front end was not my priority by any means but I still wanted it to be responsive and clean if not attractive. The front end not being my focus combined with the time limit pushed me back to bootstrap, I figured: If it works cool if it’s not good I’ll find something else. Aside from a slight initial issue with trying to integrate bootstrap JavaScript with Rails, it worked and It worked well! I can’t believe how quickly the style-less text and forms on the page became a sleek, responsive UI that just felt “right”, I’m now a believer and I’m eager to try more front-end frameworks.

Photo by Luis Quintero on Unsplash

Webpack

After I finished the Shopify project I wanted something simple before I went back to the habit tracker I was working on last week so I decided to make a chrome extension to disguise Hacker News as google sheets for easy perusal on work hours. This started simply enough until I wanted to separate my concerns. I’m used to react, node, and Express where I can simply create another file, write some code in that file and import it. So I thought why not try Webpack? I’ve indirectly used it many times with Rails and create-react-app so I watched a few videos and switched the extension over to using webpack. My only complaint is I haven’t had the time to figure out using breakpoints with webpack though that might be related to how chrome extensions work.

Photo by Debby Hudson on Unsplash

Conclusion

This article was easier to write than the last. I didn’t learn what I had planned this week and the habit tracker I was working on has been relegated to the back burner but I’m still happy with what I got done. I hope I get the internship but next week is back on course with the MERN stack

If you enjoyed my writing feel free to check out my website and connect with me on LinkedIn

--

--