Some tests for P4A 4.0

In the last few weeks I’ve been thinking a lot about the future of P4A, there would be a lot of small things to do but I wanted to think about something big enough for a major release jump.

Some time ago we discussed about the rendering layer, at the moment we generate all the HTML and we use our custom CSS + some jQuery/jQuery UI goodness to enhance everithing a little bit. Point is that jQuery UI is growing too slowly and we need something bigger and more RIA oriented, like Dojo, ExtJS or Qooxdoo. We discussed about which one would be better and at the moment I’d go with Dojo, it has a great FLOSS license, it’s supported by a lot of major players, it’s highly modular and it has my preferred way of including modules. At last I cannot avoid talking about the new wonderful “Claro” graphical theme, simply amazing.

So I started coding some of P4A’s widgets just to test something out and everything was pretty easy, I’d choose to use the declarative syntax because it was the fastest way to have everything running but now I’m running into a few major problems.

First of all I faced a performance issue, maybe it’s due to dojo’s declarative syntax I chose and I should definetively do a comparison test with the programmatic syntax (also if I do not like generating javascript too much). Another problem is due to the fact that most P4A developers tend to use the easiest P4A’s AJAX stack, which actually redraws all the mask (the body tag) without a full page refresh. To do the dojo has to redraw all the widgets in the mask and so the performance issue is not only visible during the first page loading but on every page redrawing. The user would see the page flicker (if we decide to hide the DOM while dojo is rendering) or the unstyled elements for a sec and than the styled widgets. This is not the best way to go…

But here we’ve the most critical issue, every time the page is redesigned (not using a full page refresh) we’ve a noticable memory leak, dojo keeps allocating memory and this is very very bad. That’s not a dojo problem, I mean, I replease the DOM nodes and recall the dojo parser, but the previously built dojo objects are not removed from memory. Actually I hoped that dojo would have recognized that an element was already parsed but this is not happening. Thus we would have to destroy all dojo objects before redrawing them but this operation will make the page flickering longer.

Conclusions? Hard to tell at the moment. I think I want to try a different way doing a quick test using only dojo’s CSS instead of the whole javascripts also because in a P4A application all the events have to be managen by the server and not by the client. I’ll try to do this kind of test ASAP and let you know some more considerations about this topic.

9 thoughts on “Some tests for P4A 4.0

  1. Remy Villeneuve

    Better documentation is a MUST. Whenever a version 4.0 comes out, it should be paramount to release it with good documentation and lots of examples of code applying to the various uses of elements (widgets, etc) … It is a pain sometimes… I spent two hours trying to figure out how to make a date picker compatible with previous code which was outputting a date formatted in a different manner than previous versions, and still have not found the correct way but at least managed by changing the LOCALE… Alas, that was a try and error process…

    Ie.: How to make a data picker output MySQL DATETIME compatible stings…

    I know a lot of people are hardcore programmers, but the strength of your RAD is the nice environment it provides with ease for casual developers. Alas, I always feel like I am not taping the full potential because I don’t always have the time to look at the PHP code of p4a itself to figure out what goes on for function parameters, etc.

  2. Remy Villeneuve

    Yeah I understand your position, I am myself developing a end-user platform using your RAD and for which I have not yet written docs… don’t have the time amongst the debugging process! But yeah, I could probably help you out soon with documentation, as long as I am not the only one writing because I wouldn’t consider myself a wiki guru!

    Thanks again for all your work, I just meant to say with no offense that with good documentation, P4A would be a killer platform even more than it is!

  3. Remy Villeneuve

    [big huge freaking carbon arc lightbulb energizing over my head]

    P4a… Mobile!

    How about in version 4 we integrate methods to seamlessly generate mobile-friendly (ie. iP[a,o]d/iPhone) rendering based on the values of the elements generated in a frame…

    Just in idea I had while working on my current project, which would save me tons of time if I could generate all my content from the same platform.

  4. Fabrizio Balliano Post author

    @Remy: sometimes I wrote mobile application but the problem is that a desktop mask can be really complex and an automatic mobile rendering won’t ever fit all possible configurations… you could simply put the sources definitions in external files and create 2 apps (1 for mobile and 1 for desktop) sharing the data sources but with different layouts not having a lot of effort. anyway let’s keep this idea here :)

  5. Senghor

    P4A 4.0 -> When can we see this release coming out? I’m Senior Developer and I Use P4A a lot . May very soon I will share my Experience in it (I Mean giving some screenshot about some Application a Buil with it)

  6. Fabrizio Balliano Post author

    Please share your experience, it will be nice to hear it!
    For the p4a 4.0 experiments they’re not available anymore, they were just a test and about extjs, now i’m more oriented to dojo but all the software is yet to be writter :(

  7. Senghor

    One More Sugestion , It is about using HTML 5 ?
    Actually HTML 5 is in fashion in Web Wold Application. Think about it .
    It Will make a Strong Break Between all P4A 3.0 Releases and the New one (I mean P4A 4.0) .
    I Will Try to give my contibution in the Wiki more often i can.

    You have our strong Support for your duty.

Leave a Reply

Your email address will not be published. Required fields are marked *