doekman / base2

Automatically exported from code.google.com/p/base2
0 stars 0 forks source link

Allow "lazy loading" of base2 packages #36

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
It would be nice to be able to do something like this:

base2.use("DOM");
base2.use("DOM.extras.scrollIntoView");
base2.use("JSB");

Dojo allows lazy loading like this. It's a very cool feature.

Original issue reported on code.google.com by dean.edw...@gmail.com on 23 Jul 2007 at 9:23

GoogleCodeExporter commented 9 years ago
It is a nice feature. Especially if you know how to use it. 

But the loading scheme should be clear to the programmer. That way, resources 
which are not directly needed 
can be loaded from the DOMContentReady (postponed loading). This way, 
just-to-late becomes right-in-time ;-
) You don't want an app which needs to fetch a resource, when scrollIntoView is 
needed to be executed.

Another thing: I take, base2.use will be a blocking call. Do they use the 
XmlHttpRequest with async = false? That 
might freeze the browser...

Original comment by doek...@gmail.com on 23 Jul 2007 at 11:26

GoogleCodeExporter commented 9 years ago
I just remembered the dojo explanation of their lazy loading: "It's just like 
C's #include statement". Yeah, but with 
an optional network delay.

Original comment by doek...@gmail.com on 23 Jul 2007 at 11:47

GoogleCodeExporter commented 9 years ago
I don't expect lazy loading to be good. If you are lazy then you get what you
deserve. Rather, I see this as a development tool. You can include code easily
without messing about with URLs and script tags. I have a vague idea that you 
can
build an optimised (compressed) package after analysing the includes. A vague 
idea.

Original comment by dean.edw...@gmail.com on 24 Jul 2007 at 12:35

GoogleCodeExporter commented 9 years ago
"vagy loading"

Original comment by doek...@gmail.com on 28 Jul 2007 at 10:11

GoogleCodeExporter commented 9 years ago
>That might freeze the browser... 

Not if you're using Opera, in which js does not freeze the interface.

Original comment by joao.ei...@gmail.com on 21 Jan 2008 at 12:43