Updating Relationships Independently in JSON:API with Ember Data

Friday, October 28th, 2016

In JSON:API, relationships can be modified when updating resources. For example, if you wanted to add or remove tags from an article, you could make a PATCH request to /articles/:id with the following request payload:

Read More

A Practical Introduction to ES6 Generator Functions

Saturday, October 15th, 2016

Generator functions, also called generators for short, are an ES6/ES2015 feature that might seem confusing at first with little practicality. However, once you take the time to learn how they work and see some practical examples, you’ll really see how powerful and useful they can be. In this post, we’ll cover the following:

Read More

Consider Using JSON:API For Your API

Thursday, August 11th, 2016

Have you ever argued with your team on how an API should be formatted? JSON:API is a specification that was created to standardize and reduce the number of decisions that have to be made when building JSON APIs. (Yes, it can be confusing talking about JSON:API compliant APIs and JSON APIs that don’t follow the spec). The benefit of following a specification that is opinionated about the format of your API is that it allows developers to be more productive and focus on what matters, the unique parts of an application.

Read More

Refactoring to Page Objects with ember-cli-page-object

Wednesday, August 3rd, 2016

The Page Object design pattern is used to isolate HTML structure and CSS selectors from your tests. One of the main benefits from the page object pattern is test readability, and this really starts to shine as your acceptance and integration (component) tests get more complicated. Not only do page objects greatly improve test readability, they also make your tests more DRY. When HTML structure and CSS selectors change, you can make a change in a single place in your page object as opposed to going through and updating multiple, repeated selectors in your tests. Personally, I have also found that tests have become easier to write as my page objects get more defined.

Read More

The for Loop vs. forEach in JavaScript

Saturday, July 30th, 2016

If you’re new to JavaScript, you may be wondering what the difference is between using a classic for loop versus using the forEach() method on arrays. In this post, I’d like to review how each of these work and discuss why you might want to choose one over the other.

Read More