comparison with RequireJS

56 views
Skip to first unread message

Johnny Gau

unread,
Oct 31, 2013, 2:43:02 PM10/31/13
to rapt...@googlegroups.com
What is the difference between RaptorJS and RequireJS ?
 
Can I have some insight comparison ?
 
Thanks.

Patrick Steele-Idem

unread,
Oct 31, 2013, 4:44:30 PM10/31/13
to rapt...@googlegroups.com
Hi Johnny,

The main difference between RaptorJS and RequireJS is that the RaptorJS asynchronous module loader is a lot more efficient because it works in conjunction with the server-side RaptorJS Optimizer to determine how to optimally download resources. The RaptorJS Optimizer automatically generates metadata on the server-side that tells the client-side asynchronous module loader how to efficiently download modules. Among other things, the RaptorJS Optimizer allows you to configure how modules are bundled up (to reduce round trip costs) and it automatically adds checksums to resources so that they are cache friendly. Neither of these benefits are offered by RequireJS because it is purely a client-side module loader (there's the RequireJS optimizer, but it is has very, very limited functionality and it mostly designed for generating one big JS bundle for all your code for completely bypassing the client-side module loader).

In addition, every RaptorJS module has a package.json file that describes the dependencies for the module so that the dependencies do not live in the code and conditional dependencies are supported through the more robust packaging format offered by RaptorJS:

My moving dependencies into package.json files, instead of relying on the AMD syntax, the RaptorJS asynchronous module loader is completely agnostic of how you write your code. RequireJS forces you to use the AMD syntax while when using RaptorJS you can use ES6 syntax, your own syntax or no syntax at all.

Lastly, the RaptorJS asynchronous module loader is not limited to just JavaScript. It can be used to download anything... CSS, LESS, compiled templates, etc.

I hope that helps clarify.

Thanks,
Patrick
Reply all
Reply to author
Forward
0 new messages