June 12, 2024Writing a unit test for a Glimmer component
In Ember, in order to test the logic in our Glimmer components, we write integration tests. We can test the value returned from a getter by…
June 12, 2024In Ember, in order to test the logic in our Glimmer components, we write integration tests. We can test the value returned from a getter by…
March 21, 2024For the longest time I didn't think it was possible to upload a file in an Ember integration test or acceptance test because clicking on a…
February 29, 2024To create a Laravel app with Sail, we run the following command in Terminal: I can never remember this so I always have to find this…
August 17, 2023Let's say we have a component that yields out block params, and we want to write tests to check those block params. One way to do this would…
April 8, 2023Ember Changeset supports nested data. This is documented on the repo. For example: However, what isn't documented at the time of this…
March 19, 2023This post covers how to wire up CodeMirror version 5 in an Ember application. First, let's update the file to include the CodeMirror CSS…
November 15, 2022This post covers how I used the contenteditable attribute in React and worked around a jumping cursor issue.
November 14, 2022This post covers how I used the attribute in Ember and worked around a jumping cursor issue. My First Implementation with a Jumping Cursor…
April 18, 2022Recently I was exploring alternatives to Google Analytics and I came across Plausible, which markets itself as lightweight and open source…
March 16, 2022In this post, I cover how I used a modifier to set the indeterminate state of a checkbox in an Ember app.
February 9, 2022In this post, I cover how I wrote a custom ESLint rule to enforce consistent placement of the @action decorator in an Ember application.
January 28, 2022In this post, I cover how I used a custom ember-template-lint rule to address an accessibility issue in an Ember application.
January 18, 2022Fetch requests don't have a timeout, but we can make them time out using Promise.race() and AbortController.
January 8, 2022Did you know that the router service in Ember provides everything we need to recreate the LinkTo component? Let's create a component called Link with the same public API as LinkTo.
December 18, 2021Recently I learned that we can provide an autocomplete feature for input elements natively in the browser via the datalist tag. I started playing around with it and made a reusable Glimmer component to search against any...
November 25, 2021Recently I learned about server-sent events, which allow for a server to send new data to the browser at any time by pushing messages over a…
November 13, 2021Recently I was trying to figure out how to prevent a deeply nested object from being mutated. That is, I didn't want properties in the…
January 15, 2021Recently I was working on making a modal more accessibile. When I opened the modal and tried to use the keyboard to navigate, the focus…
December 24, 2020In this post, I cover how to get up and running with PostCSS using PostCSS CLI and go over popular plugins including postcss-import…
December 19, 2020Recently I was helping someone make all modals in an application close when a user presses the escape key. Thankfully, ember-keyboard makes…
December 13, 2020This post is based off a question I had asked in the Ember Discuss forum about the caching of getters. Recently I discovered that getters…
December 9, 2020Are you working on an Ember project using Emblem templates and want to convert to Handlebars? This post covers my approach and experience.
November 13, 2020This post covers an example of migrating a computed property to a native class getter and addresses a few questions that I had along the way.
November 11, 2020If you're in the midst of transitioning your classic classes to native classes, it may be helpful to know that you can still use the @action and @tracked decorators.
November 3, 2020ES2020 brings the nullish coalescing operator to JavaScript, which allows us to create default values succinctly.
May 9, 2020Does recursion make your head spin? Haven't used it in awhile and want a refresher? If so, this series is for you.
February 20, 2020Learn how to abort fetch requests with the AbortController class and how to do it in a React component.
January 25, 2020Learn how to sprinkle in Svelte 3 components into a Jekyll site.
January 24, 2020This post shows how to run a Jekyll site with Docker.
January 24, 2020This post covers how to use SQLite with PHP on Heroku.
January 23, 2020This post shows how to create a JSON feed of all of your posts in a Jekyll site.
January 22, 2020Learn how to sprinkle in Svelte 3 components into an existing project.
January 20, 2020Learn how to set up continuous integration with GitHub Actions for your Ember CLI project.
January 13, 2020Installing PHP on Windows
October 17, 2019Learn how to deploy your Create React App project to Surge.sh.
October 12, 2019An introduction to JavaScript Decorators on methods in ES6 classes.
August 12, 2019This post is a brief introduction to protecting web applications against Cross-Site Request Forgery Attacks (CSRF).
August 2, 2019This post covers how to deal with foreign key type of attributes in an API with Ember Data.
July 21, 2019This post covers how I used embedded records with a JSON:API-ish response.
July 17, 2019The URLSearchParams and URL classes can be used to build and parse query strings in JavaScript in both the browser and Node.
June 22, 2019This post covers how to build a simple chat application with Web Sockets in Node.js.
April 11, 2019Does recursion make your head spin? Haven't used it in awhile and want a refresher? If so, this series is for you.
April 5, 2019Does recursion make your head spin? Haven't used it in awhile and want a refresher? If so, this series is for you.
March 31, 2019Does recursion make your head spin? Haven't used it in awhile and want a refresher? If so, this series is for you.
March 26, 2019Does recursion make your head spin? Haven't used it in awhile and want a refresher? If so, this series is for you.
March 9, 2019This post covers two new methods in ES2019 for flattening JavaScript arrays, flat and flatMap.
February 1, 2019This post covers a problem I ran into when reading files on Heroku in an Elixir Phoenix app.
January 22, 2019This post covers a few things I learned when decoding JSON into Elixir structs.
January 13, 2019In this post, we'll look at how to loop in Elixir through recursion by rebuilding Enum.each, Enum.reduce, Enum.map, and Enum.filter.
January 10, 2019In this post, we're going to look at capturing functions and expressions, which can make Elixir code more concise.
January 2, 2019Time to dive into functional programming and learn Elixir. This post covers keyword lists.
September 25, 2018This post covers new Ember component features as of 3.4.
September 6, 2018This post covers creating custom QUnit assertions in Ember.
July 28, 2018This post covers how I handled tracking hasMany relationship changes with ember-changeset.
May 26, 2018This post covers how to access the instance of a model in the defaultValue function of an attribute to conditionally set a default value.
April 30, 2018This post covers how to import files from node_modules in Ember
April 6, 2018This post covers how to extract metadata from a custom API with Ember Data.
March 18, 2018Contextual Components are one of my favorite features in Ember. In this post, I show how you can implement the same pattern in React components using the Render Props pattern.
February 25, 2018In this blog post, I cover the Render Props pattern in React and what it looks like in Ember.
February 11, 2018This post covers how I approached conditional validations with ember-changeset.
January 28, 2018Deploying Laravel with SQLite to Heroku
January 14, 2018The fundamentals of SQLite
October 29, 2017In this post, I cover how to test with relative dates and timezones in an Ember application.
September 21, 2017In this post, I cover how you can subclass an array in JavaScript in ES2015 (ES6).
September 3, 2017This post explores a few approaches to mocking services in acceptance tests and shows an example that stubs window.confirm.
August 31, 2017Client-side templating with Handlebars.js
August 31, 2017Event delegation examples using jQuery
August 27, 2017In this post, I go over the iterable and iterator protocols and show some examples of making your own objects iterable so that they can be used with the for...of loop or the spread operator.
August 21, 2017This post is an introduction to the Set class in JavaScript.
August 10, 2017The fundamentals of constructor functions and ES6 classes
August 9, 2017Examples of using the Google Maps JavaScript API
August 9, 2017The fundamentals of objects in JavaScript
July 30, 2017How I built a checkbox list Ember component using contextual components and an ES 2015 Set
May 29, 2017In my new SitePoint course "Test-Driven Development in Node.js", I teach test-driven development using practical examples, covering a range of topics including the fundamental theory, testing asynchronous code, and the d...
May 5, 2017Imagine you have the following component: where looks like: and the template looks like: The component is a light wrapper around the…
February 20, 2017One technique I often like to do when I am refactoring is move relationship logic outside of an action into the Ember Data model behind a custom method. Let me show you.
February 18, 2017One idea I've been been experimenting with in an Angular 1.5 application I've been working on is using ES6 generators to manage concurrency in components.
February 14, 2017Have you ever felt like you had a gap in your learning because you didn't know common algorithms and data structures in computer science? Maybe you've tanked an interview where they asked you an algorithm question? Want ...
February 10, 2017In Ember Data, if you delete a record from the store, related records are kept in the store. How do you cascade delete related records? Find out in this post.
October 28, 2016Did you know that JSON:API supports updating relationships independently at URLs from relationship links? Learn how to do this with Ember Data.
October 15, 2016This post covers what are generator functions in ES6, how generator functions work, how generators and promises work together, and some examples of generator functions used in other libraries and frameworks.
August 11, 2016Have you ever argued with your team on how an API should be formatted? JSON:API was created to standardize how APIs are built and keep API formatting discussions to a minimum.
August 3, 2016The Page Object design pattern is used to isolate HTML structure and CSS selectors from your tests. In this post and video tutorial, I'll refactor an acceptance and integration test in Ember to use a page object with the...
July 30, 2016If 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 discuss why you might want to choose on...
July 25, 2016A podcast where three JavaScript developers discuss strategies and tips to help your career as a software developer.
July 10, 2016Ever wondered how to create your own custom Ember CLI command? Recently I went through this process and today I'd like to share what I learned in case you wanted to create your own custom command too.
June 21, 2016One of the challenges of working with dates is unit testing code that depends on the current date. Let's look at how to stub out "today".
June 19, 2016Have a custom API that you aren't sure how to use with Ember Data? Interested in writing your own adapter or serializer? Want to just know more about how Ember Data works? This is the Ember Data book you have been waitin...
April 8, 2016Get up and running with Ember FastBoot with this video tutorial. This video tutorial goes through converting a simple application using jQuery AJAX calls, components, and Ember Data to using Ember FastBoot in under 5 min...
April 7, 2016This post shows how you can style your select menus with modern CSS
March 12, 2016TL;DR - If both success and reject handlers are executing unintentionally, you might be forgetting to throw after you catch in the promise chain.
February 27, 2016If you've had to work with Ember Data and non-standard APIs, you may have dug into the adapters and serializers a bit and seen snapshot as a parameter to a few of the methods. Let me show you what a snapshot is and why y...
February 21, 2016Many APIs use nested resource paths. That is, URL paths that contain a hierarchy of resource types. How do you handle that in Ember Data? Let me show you.
February 18, 2016Here are the slides from my presentation at the EmberSC meetup on 2/17/16 on Ember Data and Custom APIs.
February 10, 2016One pain point of Ember that I often hear is that the learning curve is a little steep. Because Angular is extremely popular, I'd like to introduce Ember from the perspective of an Angular developer, hopefully getting th...
February 6, 2016Not too long ago I wrote about Testing Serializers in Ember. The examples in the post went over testing the serialization process on responses and verifying methods like normalizeResponse and keyForRelationship worked co...
January 29, 2016In today's post, I'd like to share a few ways of how you can work with nested data in Ember Data models.
January 28, 2016Have you ever been on a project where you make one change and later realize you broke something else? It feels like you're playing whack-a-mole. In today's post, I'd like to introduce you to some of the benefits of unit ...
January 23, 2016When I first started working with Ember Data in the 1.X days, one of the most frustrating things was having to work with custom APIs. In this post, I'd like to share a few common ways to customize serializers that others...
January 14, 2016In this post, we'll look at how integration tests can be used in conjunction with unit tests to effectively test different aspects of your Ember components.
January 12, 2016Interested in giving Ember a try but don't want to install Ember CLI on your machine? Or maybe you love Cloud 9 IDE but are unsure of how to run Ember CLI on there. Check out this short video I created that walks you thr...
January 9, 2016This post covers what Ember Data expects for error responses and how they map to our model attributes.
January 5, 2016In today's post, I want to show you how a fluent interface, also known as a fluent API, can help improve the readability of your code.
January 3, 2016When working with Jasmine, you might find yourself wanting to control which tests execute. Let me show you how to do this with Jasmine.
December 5, 2015A serializer in Ember Data is used to normalize response payloads and serialize request payloads as data is transferred between the client and the server. This post covers the serializers that ship with Ember Data.
November 27, 2015For those who want to start learning Ember 2, here is a list of my recommendations for the best places to learn Ember.
November 23, 2015Ember Data has a feature called transforms that allow you to transform values before they are set on a model or sent back to the server. If you've been working with Ember Data, then you have already been using transforms...
November 14, 2015This session will introduce you to Ember, a framework for building ambitious web applications. You will build an application using Ember 2 and its companion command line utility Ember CLI. We'll use the power of Ember Da...
November 9, 2015How do you go about testing controllers, components, and services that are given Ember Data objects like DS.AdapterPopulatedRecordArray or DS.RecordArray? Let me show you!
November 4, 2015How do you go about testing methods on serializers like normalizeResponse and keyForRelationship? Let me show you!
October 16, 2015The adapter design pattern is very useful in JavaScript when it comes to data fetching and persistence. The travel adapter is the most…
September 1, 2015Earlier this year I wrote about Unit Testing Angular Directives with Isolate Scope. Now that I am working with Angular again, I've…
May 11, 2015Rapid Ember.js is an excellent 60 minute introduction to learning the Ember.js framework. The author William Hart does a great job at…
April 30, 2015Lately I have been trying out more end-to-end / integration testing with CasperJS. Having these tests in place seems valuable for critical…
April 20, 2015Writing unit tests when working with Require.js is tough. Out of the box, Require.js does not make mocking very easy. It involves setting up…
March 18, 2015As a frontend developer, you might find yourself in a situation where you have to work with unRESTful endpoints. If you are working with…
February 28, 2015When it comes to testing in JavaScript, I would say that there are two types of tests: unit tests and end to end tests, which are also…
February 21, 2015In this post, learn how to transform code using forEach to using reduce on JavaScript Arrays.
February 12, 2015If you are building complex user interfaces, you will at some point want to start unit testing your directives. Below is a simple directive…
February 6, 2015Custom promises can really clean up your code in certain situations. For me, I have found that using custom promises can clean up consumers…
February 1, 2015I get asked pretty frequently, "What is the best way to learn Angular.js?". Here is a path of resources in order of what I think is a good…
January 29, 2015Recently I upgraded the unit tests for a work project from using Jasmine 1.3 to Jasmine 2.1. The suite had about 400 tests. When I upgraded…
January 28, 2015In Angular, we can mock out services using $provide. Let's look at a simple example. Here we have two services using the API in our module…
January 19, 2015Often times in web applications you only want a single instance of a class/constructor/reference type to ever be created. This is called the…
January 13, 2015Getting started with unit testing your Angular code can be tricky due to setting up your test runner, learning some of the conventions, and…
January 12, 2015Testing in JavaScript is becoming expected by developers more and more. But where do you start? There are so many framework choices out…
January 9, 2015There are many things that you need to consider when writing JavaScript for an international site. Things such as formatting currency, dates…
January 7, 2015One of the difficult parts I am experiencing when working with Backbone is separating out display logic properties from models. Let's look…
January 6, 2015Last year I started a new job as where I am currently tasked with rebuilding an ecommerce site for the company. The JavaScript stack is…
January 5, 2015Modules allow us to organize code and prevent polluting the global namespace. Until ES6, JavaScript didn't have a native module system…
January 1, 2015Over the past year I have been reading a lot about design patterns. One of the patterns I learned about was the Template Method pattern…
December 29, 2014CoffeeScript has been an interesting language to learn. At first, I wasn't really into it because it required me to learn another another…
December 13, 2014One of the things I have found most challenging when working with Backbone.js is writing maintainable and unit testable views. Based on…
November 6, 2014Recently I gave angular-data a try and found it awesome for data modeling in Angular.js. Why use angular-data? There are many ways to model…
July 2, 2014When it comes to memory management and JavaScript applications using Backbone, you'll often hear about zombie views and how easy it is to…
June 27, 2014Learning how to manage asynchronous code in JavaScript can be challenging. In the browser, asynchronous operations come in the form of AJAX…
January 20, 2014In the [last post on Request Expectations]({% post_url 2014-01-18-request-expectations-with-httpBackend %}), we looked at how we can set…
January 18, 2014So you have an Angular service that communicates with an API, but you're not really sure how to go about testing it. Maybe you read the…