tag : RequireJS

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.

Setting Up a Jasmine Unit Testing Environment With Testem

Everyone knows now that unit testing is good and that they should do it, but it’s not exactly simple to get started, but once you’re going, it’s pretty simple and highly valuable. But how do you get started? I’ll show you a great setup for Jasmine to get you up and running with unit testing and doing it with style with Testem. Testem and Jasmine come together to make unit testing fun and simple.

August Update: Appliness and js13kGames

There are a couple of cool things going on around the internet that I felt should be shared with all of you. First of all is Appliness, a digital, monthly web development magazine that pools some of the greatest articles from around the web and compiles them into an interactive book. Second is a JavaScript and HTML5 game competition known as js13kGames. Too many lower case letters there if you ask me.

Automatic Minification With Node.js and RequireJS

Last time we talked about how to use NPM and some of the command line utilities that you can install that are built using Node.js. Today, we’re actually going to build a small command line utility ourselves that can be a bit of a time saver. We’re going to use the RequireJS optimizer to automatically concatenate and minify our CSS files the moment any of them are changed.

Backbone Application Walkthrough Part 5: RequireJS - Video Tutorial

Finally! We’ve made it to the end of the Backbone.js Application Walkthrough video tutorial series. In this final video, we make few small adjustments for the sake of organization and a bunch of other changes that convert the application to work using RequireJS. Almost every file gets touched in this video, but each only receives minor changes in order to create an overall major change in modularity and optimization.

Backbone.js Application Walkthrough Part 3: New View and External Templating – Video Tutorial

Moving on to part 3 of the Backbone Application Walkthrough video series, we work on moving all of the templates to external files to reduce the dependency on the templates being included in the index.html file and so that they might become available if we use these views on different pages. Also, I added an extra view that wasn’t in the original application because, as you’ll see in the video, it makes things a little nicer.

$script.js vs RequireJS: Dependency Management Comparisons

As JavaScript moves further and further away from the playground programming language that it used to be, and is used more and more as the core for large-scale applications, managing the code starts to become extremely difficult. Splitting the code into multiple files helps with that, though it also adds more complexity in a different way. One way to fight this new complexity is with dependency management libraries, but which one is right for you?