2011.10.26

RequireJS plugins

One of the greatest advantages of the AMD module format over the other standards is that it supports loader plugins, which can be used to load other kinds of resources besides JavaScript, it can be a really useful feature and a nice way to abstract some simple behavior, it increases the loader flexibility a lot…

I just pushed to Github all my RequireJS plugins - if you don’t know it yet, RequireJS is an awesome script loader which can improve code organization a lot if used properly - so far I have plugins for loading images, JSON files (automatically parses JSON response), JSONP / asynchronous scripts (like Google Maps) and also script files without appending the “.js” file extension (useful for dynamic scripts). I will create new plugins as needed.

Watch the project on Github & fork it. Please use the Github issues to report bugs and also for features request.

Related


2011.10.25

amd-utils : modular JavaScript utilities

Last week I decided to split some of my personal JavaScript code into individual modules to provide an easy way of loading only what is really necessary and increase code reuse between multiple projects/libraries. The purpose isn’t to replace Dojo, jQuery, YUI, Mootools, etc, but to provide modular solutions for common problems that aren’t solved by most of them and to avoid using a full library when you only need a small subset of features.

The project is on github and I will keep adding new features as needed, there is still a lot of stuff to be ported from my legacy JS/PHP/AS3 code and also to be coded from scratch…
Read more…


2011.09.30

AMD is better for the web than CommonJS modules

I’ve seen a few libraries and tools later using different kinds of ways to
handle dependency management, some of them are very similar to the way that
CommonJS modules looks like:

Read more…


2011.09.03

Single entry point redux

A couple months ago I posted about using a single entry point for JavaScript applications and how it could simplify the HTML logic and also make dependency management easier. A couple people asked if I had some example and the only examples I had were client projects which I couldn’t share the source code…

I’ve just answered a question on the RequireJS mailing list and used a Gist to explain how single entry point works and how it improves the code structure and simplify dependency management.
Read more…