Dev

Building Components in a Sandbox

Apr 07, 2017

Recently, we started looking for a front-end dev to take some weight off my shoulders. We published a job listing that describes the position and how we work. It also includes the steps for our hiring process. After a short interview to simply discuss the applicant’s background and interests, we invite them to do a paid “assignment”. The assignment is to have them build one of our existing AngularJS components in Vue.js, which we’re in the process of migrating to. The assignment reveals if they can 1) code, 2) communicate, 3) match a screenshot, and 4) learn on-the-go. I created a private repo for the assignment, so there’s also 5) know how to use version control.

At first, I intended for the repo to be a sandbox for the applicant—a place for them to start coding with minimal setup and remain outside of our top secret repos. In setting up the sandbox, I took the opportunity to start with a clean slate. If we were to start building Cushion now, what would we use for the dev environment? Three years is a long time in the modern dev world, and even though our current stack isn’t “old” by any means, certain areas of it are collecting cobwebs—specifically the front-end and its build script.

Aside from using such a heavy framework like AngularJS, one of my bigger regrets is writing the front-end in CoffeeScript. *gasp* CoffeeScript is easy to write fast, but at the expense of a lazy and loosely structured codebase—AngularJS didn’t help with that either. Fortunately, JavaScript is catching up with most of CoffeeScript’s more appealing features, so we’re taking the opportunity to migrate to ES6 during our Vue.js switch.

As for the build script, Cushion is currently a combination of Gulp and Browserify, which isn’t ideal for quickly developing small parts of a large app. After reading up on the latest tech stacks, it seems like Webpack is the way to go. Vue.js even has a wonderful CLI for quickly starting up a new environment with everything we need. A few tweaks here and there and our assignment repo was ready for use. There was only one problem—the environment was too nice. I grew jealous. With Webpack’s hot reloading, the code updates almost instantly. With Cushion’s build script, I’ll make a change and stare longingly out the window, watching the world go by.

I also hated the idea of the repo being a throwaway. If we were to finish, I imagined copying over the components manually. That’s 2014 Jonnie’s way of thinking. 2017 is a new me. I decided to turn the assignment repo into Cushion’s new component library. Since the applicants would be recreating Cushion’s existing components in our new stack, why not build them to be production-ready? That would make the assignment even more worthwhile.

hello world component

I styled a page to house the new components and created a “Hello World” component as an example. From there, we could add each new component to the page and interact with them in a sandbox environment—separate from the app.

For the applicants who really wanted to make an impression, we even had a test harness that came with Vue.js’s dev environment. Components could be unit tested in isolation, so we really knew that they worked (and would continue to work if anyone needed to make changes). With proper unit testing, the component page’s would no longer be used for testing behavior. Instead, it could be used to ensure that the components’ interactions are up to par with the rest of Cushion.

components

We currently have six components in the sandbox with two more on the way. Once we reach a point where we can start using these in production, I’ll package the library and install it as a dependency. Whenever we need a component, I can simply import it and know that it’ll work as expected.

Share this on Twitter or Facebook

Archive

  1. Restructuring an Evolving App: Part 1
    Design
  2. My Typical Week as a Founder
    Story
  3. Building Components in a Sandbox
    Dev
  4. Reactive Time with Vue.js
    Dev
  5. Visualizing Daylight Saving Time
    Dev
  6. Recording Screencast GIFs
    Dev
  7. Writing a Job Listing
    Story
  8. Using Feature Flags to Run Betas
    Dev
  9. Our First Company Lunch
    Story
  10. How to embed Vue.js & Vuex inside an AngularJS app... wait what?
    Dev
  11. Funding Cushion
    Story
  12. Hiring a Team of Freelancers
    Story
  13. Taking a Real Break From Work
    Story
  14. Slack as a Notification Center
    Dev
  15. Document Your Features
    Story
  16. 300
    Story
  17. Vacations
    Design
  18. Offering Discounts
    Design
  19. Waves of Traffic
    Story
  20. Less Blogging, More Journaling
    Story
  21. Retention Through Useful Features
    Design
  22. The Onboarding Checklist
    Design
  23. Spreading the Word
    Story
  24. From Beta to Launch - The Subdomain
    Dev
  25. From Beta to Launch - Sign up
    Design
  26. From Beta to Launch - Messaging
    Design
  27. Launch
    Story
  28. Authenticating with 3rd Party Services
    Dev
  29. Intro to Integrations
    Design
  30. Inspiration vs Imitation
    Story
  31. The Emotional Rollercoaster
    Story
  32. Designing Project Blocks
    Design
  33. Everything in Increments
    Story
  34. Deleting Your Account
    Design
  35. Designing the Subscription Page
    Design
  36. Rewriting the Timeline
    Dev
  37. Restructuring the Individual Project Page
    Design
  38. Project Blocks
    Story
  39. Redesigning the Homepage
    Design
  40. Multiple Timelines
    Design
  41. Archiving and Estimate Differences
    Design
  42. Multiple Financial Goals
    Design
  43. Zooming in on the Timeline
    Design
  44. Currency
    Dev
  45. Preferences, Accounts, and a Typeface Change
    Design
  46. Sending Out the First Email
    Story
  47. Currency Inputs, Notifications, and Invoice Nets
    Design
  48. Dots and Lines
    Design
  49. Calculating in the Database and Revealing Tendencies
    Dev
  50. Improved Form UX
    Design
  51. Cushion is Online
    Story
  52. Schedule Timeline Patterns
    Design
  53. A Slimmer Schedule Timeline
    Design
  54. The Schedule Timeline
    Design
  55. Plugging in Real Data for the First Time
    Design
  56. Transitions and Project Lists
    Design
  57. Death to Modals
    Design
  58. The Individual Project Page
    Design
  59. Estimated Incomes and Talks with Other Freelancers
    Story
  60. Statuses to Lists and the Paid Beta
    Story
  61. The Timeline
    Story
  62. Invoice Terminology
    Dev
  63. Modal Forms
    Dev
  64. Wiring the Backend to the Frontend
    Dev
  65. Balancing Design and Dev
    Story
  66. Timecop, Monocle, and Vagrant
    Dev
  67. Going with Ruby and Sinatra
    Dev
  68. Ditching local-first and trying out Node.js
    Dev
  69. Switching to AngularJS
    Dev
  70. Building the Table with Vue.js
    Dev
  71. Clients, Projects, and Invoices
    Dev
  72. Introduction
    Story

Running Costs

Take a close look at the costs that go into running a web app and why we use specific services.

View the Costs

How It’s Made

Follow along with the journal for insight into the overall experience of building an app.

Read the Journal