Parallel loading js files with LABjs

3 views
Skip to first unread message

Jeremy Ricketts

unread,
Jul 4, 2009, 4:23:08 PM7/4/09
to djangola
Thought this was very interesting given our discussions last meeting.
I'd love to get everyone's take on this. This feels like a fairly
lightweight, straightforward solution to me.

Ajaxian coverage: http://ajaxian.com/archives/labjs-simple-abstraction-for-loading-dependencies-correctly

LABjs Homepage: http://labjs.com

Daniel González Gasull

unread,
Jul 4, 2009, 4:39:22 PM7/4/09
to djan...@googlegroups.com
My understanding is that this will prevent having JavaScript files
loading in the wrong order. But how does this make it faster? Am I
missing anything?

Maybe when complexity grows it makes sense to use something like
Pyjamas or GWT. Pyjamas compiles from Python to JavaScript and the
functionality that isn't needed won't be included in the final .js
file. You can use Pyjamas with jQuery or any other JavaScript
framework:

http://groups.google.com/group/pyjamas-dev/browse_thread/thread/b89fc996978a751c?pli=1
--
http://DjanSoft.com :: Agile Application Development with Python

Jeremy

unread,
Jul 4, 2009, 4:48:23 PM7/4/09
to djan...@googlegroups.com
This is a better run-down as to the reasoning behind LABjs and shows some tests:


Small excerpt:
"[...] <script> tags, when they download, block other assets from downloading to fully render the page. As a result, a user’s experience with the webpage is severely degraded as that page may take significantly longer to download and subsequently render because the browser is unable to download anything else while the <script> tag is “bogarting” the download queue."

~ Jeremy



2009/7/4 Daniel González Gasull <gas...@gmail.com>

Kris Kowal

unread,
Jul 4, 2009, 5:46:31 PM7/4/09
to djan...@googlegroups.com
This library will definitely speed up your page loads, but it is a
stopgap since it does not solve the quintessential problem that the
relationships among all used modules are all expressed in an external
document, once for every page. For the software engineering practice,
it is ultimately more scalable to have modules express their own
immediate dependencies (especially since these tend to change) and
then have a program compose them into a system of a few documents to
download in a non-blocking fashion at the appropriate times.

Kris

Daniel González Gasull

unread,
Jul 4, 2009, 7:01:39 PM7/4/09
to djan...@googlegroups.com
Thanks, Jeremy. I get it now. I thought it was to get around the
HTTP 1.1 limit of 2 objects per domain.

This increases the load in 1KB. Not much, but Pyjamas would make
everything in a single and slim .js file.
Reply all
Reply to author
Forward
0 new messages