tag : JavaScript

Using Marionette to Display Modal Views

For a while, I’ve been thinking about how best to handle showing modal dialog boxes for my applications while utilizing Backbone views. A lot of interesting ideas passed through my head, but none of them seemed exactly right. Then I saw a post by Derick Bailey where he described how he uses Marionette’s Regions to handle the work. His post is a bit on the old side and Regions have changed a bit since, so I decided to look into how to do it myself.

A Thorough Introduction to MarionetteJS on Smashing Magazine

Hey everyone. I’m sorry that I’ve been neglecting you all so much. I can’t believe it’s been two months since I last posted something on here. In short, I’ve been very busy. I’ve written several articles for other blogs, and that’s actually what this post is all about. If you’re not following some of these blogs, you may have been missing out on some of my work. So here’s what I wrote in my absence from this website.

Spinal Surgery: Upgrade to Backbone 1.0

Hey everyone! Backbone 1.0 has been released! I just happened to pop by their site and see that 1.0 is official, so I have no idea how long it has been out. Why didn’t anyone tell me?!?!? Anyway, there may be some of you out there wondering what this new version brings and how they can update their apps to bring in all the new awesomeness. Well, let’s take a gander at this new stuff.

Lazy Loading JavaScript With RequireJS

As sites are filled with more and more JavaScript, images, and other external assets, web pages have become more and more bloated and performance has started to become an issue. We’ve started to reduce the number of requests by concatenating our JavaScript and CSS files and using image sprites. We’ve shrunk file sizes by minifying and obfuscating our code and optimizing our images. All these measures are good, but they may not be enough. If you have a large JavaScript application, you could have a ton of JavaScript being loaded in that single concatenated file, and a lot of the code may be going to waste because it isn’t used. Let’s try to “lazy load” some of that code using RequireJS.

JavaScript Asynchronous Architectures: Events vs. Promises

I can’t go a single week without reading another article talking about promises. I’m not talking about when you promise your child that you’ll be there for his baseball game. I’m talking about a JavaScript concept that makes it simple to react to the completion of asynchronous actions without indenting ten levels when you need to perform one asynchronous action after another. While working on a Backbone application, I tried to use promises in my main asynchronous processes, and I’m not sure it measures up to my previous event hub architecture. Let’s compare!

Giveaway: JavaScript From the Ground Up

On this site, I offer tutorials and articles to the public for no charge. There are many places you can go, though, that offer in-depth and very thorough tutorials for a fee. Of course, these charges are warranted. I could never put together something so complete without charging for it and there’s no way I’d demand someone else to do it either. Well, today I’m offering coupons to receive access to the “JavaScript Training from the Ground Up“ course on udemy.com for absolutely free (normally $35).

Is Sending Messages Through WebSockets Slow on Chrome?

It wasn’t long ago that I ran into a strange issue with Chrome. My Jasmine tests were failing because the timeout on the asynchronous actions was too short for Chrome, even though they worked perfectly fine for Firefox. This led to me writing some tests to see if Chrome’s WebSocket implementation was slow which gave some pretty interesting results. I’ve also heard some interesting results from my readers, so I decided to investigate some more.

Book Review: Clean Code: A Handbook of Agile Software Development

Every once in a while, a book is published that is considered a must-read for every JavaScript developer who wants to be able to do his or her job the right way and understand JavaScript the way it should be understood. Well, Clean Code is one of those books, except it’s not just for JavaScript developers. This book will enlighten every programmer and bring them to an understanding of how great programming is achieved in practically any language.

Are WebSockets Slow on Chrome?

In my last article where I talked about unit testing Socket.IO with Jasmine, there was a point where I mentioned that I needed to use timeouts that were a second and a half when doing the asynchronous connecting and disconnecting from the Socket.IO server. It was working just fine with 750 millisecond timeouts on Firefox, but when I tested it in Chrome, timeouts were being reached and the specs were failing. Let’s see if we can get to the bottom of this and figure out why Chrome failed so hard here.