Change 20100510-maxcarlson-y by [email protected] on 2010-05-10 
16:21:44 PDT
    in /Users/maxcarlson/openlaszlo/trunk-clean
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Fix HTML wrappers to defer script loading

Bugs Fixed: LPP-8988 - Fix DHTML embedding to allow asynchronous loading of the 
LFC

Technical Reviewer: ptw
QA Reviewer: hminsky

Details: Updating to address Tucker's questions:

Issues:

1) admin/build.xml:  You are copying the LFC but not the console code?  Am I 
missing something?  Shouldn't both pieces be copied when you build a new 
console version?

No, because the DHTML app code is built in place.

  a) Do we have the instructions for building the console written anywhere?

Nope, it's the same as it's always been - cd to lps/admin/ and run ant.

  b) Should you have the build file echo out a message reminding the builder to 
check in the result?

Done.

2) embed-body.xslt vs. embednew.js:  Since it's the LFC that you want to load 
asynchronously, I would think you would want to be setting the defer property 
on the script element in __dhtmlLoadLibrary, not in the script that calls 
lz.embed.lfc.  The way it is written right now, _all_ the calls to lz.embed are 
being deferred.  I suppose that works too, but then, what is the point of the 
queueing code in __dhtmlLoadLibrary?

I added defer="defer" there also - it can't hurt!

Questions:

1) After the LFC is loaded, it seems we then synchronously load each of the app 
libraries.  Would it be better to load each app from the queue using the same 
asynchronous callback technique?  (Adding weight to my Issue 2:  these loads 
will also block unless the dynamically created script element has the defer 
property set.)

Everything should be loaded asynchronously now.

2) So the point of this is that if we are embedded in a larger HTML page, the 
HTML can get on with its displaying while our app is loaded in the background?

Correct!


embed-body* - Change defer="true" to defer="defer".

app-console* - Don't load the LFC directly.

embednew - Add defer="defer" to dynamically created script tags.

dev-console - Add defer="defer" to defer loading the dev console.

build.xml - Add reminder to test the new dev console when rebuilding with ant 
in the 'lps/admin/' directory.

Tests: The developer's console and all apps continue to work, especially in IE7 
DHTML.

Files:
M       WEB-INF/lps/templates/embed-body_jp.xslt
M       WEB-INF/lps/templates/embed-body.xslt
M       WEB-INF/lps/templates/app-console_jp.xslt
M       WEB-INF/lps/templates/app-console.xslt
M       lps/includes/source/embednew.js
M       lps/admin/dev-console.html
M       lps/admin/build.xml

Changeset: 
http://svn.openlaszlo.org/openlaszlo/patches/20100510-maxcarlson-y.tar

Reply via email to