Tools for Porting 3.x Applications to 4.0B1

Going from a working Open Laszlo 3.x application to a blank screen in 4.0 can be frustrating; what do you do once you've downloaded and installed the new server, and your app just doesn't show up? This handy guide should help you get your app to appear.

  1. Eliminate any errors or warnings that appear when compiling or running your app in the version of OL you had previously developed with, in the flash runtime of course.
  2. Eliminate compilation errors or warnings in the flash runtime in OL4B1. (lzr=swf8)
  3. Run in the flash runtime with debug=true. Eliminate any warnings or errors that appear in the Open Laszlo debugger. lzr=swf8&debug=true
  4. Replace any swf resources with stand-in png's. (Don't go through a laborious swf to bitmap conversion yet; just use some medium-sized png's you have sitting around.)
  5. Eliminate any <font src="foo.ttf"/> tags.
  6. Now run in Firefox 2 with lzr=dhtml. (It probably won't work on the first try.) Same as above, eliminate compilation errors and warnings, then runtime errors and warnings.
  7. Install Firebug! Firebug is a totally crucial DHTML debugger. As of this writing, we're using 1.0b7. It's subtle though; it installs itself as disabled. Right-click on the little red x or green check in the bottom-right corner of the status bar, and select "Enable Firebug."
  8. Run your app with firebug enabled. Firebug will almost certainly detect errors. Click on the Firebug error count to bring up the Firebug console. The console shows you the "compiled" javascript code, not your lzx source, so you have to be clever to find out where that code is actually coming from. It might be in the LFC, not your code; then you have to figure out where your code is invoking that part of the LFC. Usually you can fix these errors by taking out calls to unsupported API's or adding a check for null. (See the release notes on dereferencing null pointers.)
  9. Use the "Net" tab in Firebug to monitor network traffic. Fix any 404s.
  10. Cycle through running with Firebug, the OL DHTML debugger, and the OL swf debugger, eliminating errors and warnings until there aren't any more, while still making sure that you haven't broken the swf code. Your app should start to appear at this point.
  11. Try running your app in the browser of your choice; for the best experience, stick to Firefox and IE7. Everything should work in IE6 and Safari, too. (list of supported browsers.)
  12. Still hosed? Read the release notes, consult the laszlo-user and laszlo-dev lists, ask a question in the forums.
  13. Find a bug? Great, we love bugs. Check the bug database to see whether someone else has reported it, and if not, file a bug.

Hope this helps; let us know if you get stuck... and thanks for trying us out.

5 Responses to “Tools for Porting 3.x Applications to 4.0B1”

  1. Le blog de Monsieur Patate » Blog Archive » Les outils pour porter les applications OpenLaszlo 3.x vers OL 4.0B1 Says:

    [...] source: blog du projet OpenLaszlo beta DHTML Firebug flash openlaszlo [...]

  2. Raju Bitter » Portieren von OpenLaszlo 3.x Anwendungen auf die OpenLaszlo 4.0 DHTML/AJAX Says:

    [...] Im OpenLaszlo Projektblog wurde ein kleine Anleitung für die Portierung von OpenLaszlo 3.x Anwendungen auf die 4.0 Version veröffentlicht. Hier eine Übersetzung des Textes für alle die, denen Deutsch lieber ist als Englisch. [...]

  3. raju Says:

    Ben,
    Thanks a lot for this guide. We have a French and German translation now. Let’s have more fun with OL4. Best, Raju

  4. James Says:

    The console shows you the “compiled� javascript code, not your lzx source, so you have to be clever to find out where that code is actually coming from. It might be in the LFC, not your code; then you have to figure out where your code is invoking that part of the LFC.

    Sounds like a nightmare!

  5. Max Says:

    Hi James,

    If you run with debug=true, the original line numbers and filenames appear inline with the code. Also, in DHTML, you can tell which errors are from the LFC and which are from your application, because the LFC is loaded from a separate file. With firebug it works out pretty well. I want a feature that makes the errors open the appropriate file at the appropriate line number in the host OS. Any firebug hackers out there?

    Regards,
    Max Carlson
    OpenLaszlo.org