Topic: Xajax 0.6 - the next level

Good news everyone!

As you may have already read on our development blog the work on 0.6 has already begun. Yes, xajax 0.5 stable isn't released yet, but you can expect the release date for the next days. smile

During the last weeks we discussed the the roadmap for the near future of xajax and are really excited to take full advantage of PHP5, in order to make xajax PHP5 strict valid. Furthermore we'r going to drop all currently as depreciated marked functions, as well as the legacy classes.

We'd like you to join our discussion! What do you expect from a future xajax release? Are there any fancy features you'd love to see in xajax? Let us know!

Re: Xajax 0.6 - the next level

In the next day the last version of my cms project with PHP 4.4.X Support is coming out.

The  2.x releases than are only working with  PHP 5.2.X and PHP 4.X is finished for me.

PHP 5 with xajax 0.6 is the right way for me because xajax is standard in my projects.

Re: Xajax 0.6 - the next level

Support for FirePHP ( http://www.firephp.org ) as debugging tool.

4 (edited by rune_kg 2008-11-02 11:21:29 AM)

Re: Xajax 0.6 - the next level

Dear Xajax developers

First of all: thank you for a great piece of software. Over the last couple of months I have been integrating xajax into my companys zend-based framework and have created an Xxx_Xajax_Controller and Xxx_Xajax_Crud class with it, which both turned out great and has really speeded up our ajax developement. I have not delved very far into the code itself as there hasn't been a need smile, but here is a couple of suggestions. Please correct me if these features already exists.

### Pure js ###
I dont like all that js in the head so it would be nice to have a method that returns pure javascript. ATM. im using this hack that strips out all the html from printJavascript():

/**
* prints out xajax javascript without the tags
*/
public function printJavascript () {
    if (@$_GET['pfw'] == 'xajax') {
        $js = $this->Xajax->getJavascript();
        $js = preg_replace('/<script[^>].*>/Uis', '', $js);
        $js = str_replace ('</script>', '', $js);
        $js = str_replace ('/* <![CDATA[ */', '', $js);
        $js = str_replace ('/* ]]> */', '', $js);
        $js .= "xajax.callback.global.onRequest = function() {xajax.$('loading').style.display = 'block';}
                xajax.callback.global.beforeResponseProcessing = function() {xajax.$('loading').style.display='none';}";
        echo $js;
        die();
}

and then I add <script src="/blah/controller.php?pfw=xajax"> in the head.

Maybe you could give printJavascript a parameter like printJavascript(xajax::PURE_JS) or something?

### Output buffer ###
It would be cool if there was a outputBuffer flag to xajax. Could be combined with a $xajax->configure('Debug To', ''theDivWhereIWantToWriteTheDebug'') that would write the buffered data to a div on the page.

### Exceptions ###
Should it be possible to do stuff like:

throw new xajaxException ('The article does not exist', xajax::CRITICAL);

and have xajax catch it and output it to page on a given div?

### Charset ###
We have a couple of sites in latin1. It would look prettier with just _one_ setting instead of:

$this->Xajax->configure('characterEncoding', $charset);
$this->Xajax->setCharEncoding($charset);
$this->Xajax->setFlag('decodeUTF8Input', true);

which seems to be the winning combination. Maybe the middle line is not neccesary come to think of it, but still:)

### Questions ###
1) Have there ever been any thoughts about a mapping between xajax requests and normal non-javascript requests? It seems almost doable to have the pages degrade gracefully. This is something I will be looking at in the time to come.

### return $xajaxResponse(); ###
Thats it, again thx a lot and is looking forward seeing the 0.6 version. Let me you if there is anything I can do to help!

Rune

Re: Xajax 0.6 - the next level

Hi Rune,

rune_kg wrote:

Dear Xajax developers

First of all: thank you for a great piece of software. Over the last couple of months I have been integrating xajax into my companys zend-based framework and have created an Xxx_Xajax_Controller and Xxx_Xajax_Crud class with it, which both turned out great and has really speeded up our ajax developement. I have not delved very far into the code itself as there hasn't been a need smile, but here is a couple of suggestions. Please correct me if these features already exists.

### Pure js ###
I dont like all that js in the head so it would be nice to have a method that returns pure javascript. ATM. im using this hack that strips out all the html from printJavascript():

and then I add <script src="/blah/controller.php?pfw=xajax"> in the head.

You are probably looking for the 'deferScriptGeneration' feature. Set this option to true and xajax generates a script tag to include the xajax generated JavaScript externally.

  $xajax = new xajax();
  $xajax->configure("javascript URI","/release_testing/xajax/");
  $xajax->configure("debug",false);
  $xajax->configure('requestURI','index.php');
  $xajax->configure('deferScriptGeneration', true);

### Output buffer ###
It would be cool if there was a outputBuffer flag to xajax. Could be combined with a $xajax->configure('Debug To', ''theDivWhereIWantToWriteTheDebug'') that would write the buffered data to a div on the page.

THat's not a bad idea. The JavaScript popup can be annoying sometimes, especially when you have to reload a page a couple of times. We'll keep that in mind wink


### Exceptions ###
Should it be possible to do stuff like:

throw new xajaxException ('The article does not exist', xajax::CRITICAL);

and have xajax catch it and output it to page on a given div?

Hm, not sure what you mean...


### Charset ###
We have a couple of sites in latin1. It would look prettier with just _one_ setting instead of:

$this->Xajax->configure('characterEncoding', $charset);
$this->Xajax->setCharEncoding($charset);
$this->Xajax->setFlag('decodeUTF8Input', true);

which seems to be the winning combination. Maybe the middle line is not neccesary come to think of it, but still:)

The setCharEncoding method is deprecated. Since beta3 ->configure() replaces all former set functions.  Instead of configuring the characterEncoding and decodeUTF8input you can set the default charset encoding constant before including xajax.

define ('XAJAX_DEFAULT_CHAR_ENCODING', 'ISO-8859-1');
include("xajax/xajax_core/xajax.inc.php");

Xajax detects that the encoding differs from the default setting and enables the decodeUTF8input option automatically.

### Questions ###
1) Have there ever been any thoughts about a mapping between xajax requests and normal non-javascript requests? It seems almost doable to have the pages degrade gracefully. This is something I will be looking at in the time to come.

You mean having functions that process normal post/get form submissions and xajax calls? I haven't been thinking about it yet wink

6 (edited by rune_kg 2008-11-03 1:19:08 PM)

Re: Xajax 0.6 - the next level

Ok, ok, so xajax already does that smile

Thx for you reply. Regarding the exception thing its stupid anyway.

Re: Xajax 0.6 - the next level

Thanks anyway for your suggestions. Ideas are always very welcome! smile

Re: Xajax 0.6 - the next level

I second the debug popup suggestion above.  I also wouldnt mind being able to control the debug output a little, maybe being able to grab its contents and toss it in my own custom error log for further review.

The only other suggestion I have is playing friendlier with the larger libraries, but that is neither teams fault.  I've tried using jQuery modal windows with Xajax forms and it just doesn't work.  Doesn't help that I don't know Javascript, otherwise could probably get it to work.

Keep up the awesome work, I'm sure it the next release will be gold.

Re: Xajax 0.6 - the next level

With the next release, will PHP4 support be dropped ? In other words.. will it be complete based on PHP 5 ?
I don't need PHP4 since it is completly deprecated by the developers, but at the moment i run into some things which are going wrong because it is based on PHP4...  For example , in the callable object class, no methods with __call en the PHP4 constructor (classname = methodname) are included.
In PHP5 this is __construct().

At the moment i am working on a workaround with that. And i'm trying to implement the array with methods 2 register.

Re: Xajax 0.6 - the next level

yeah, we are definitely going to drop php4 support in the next version. The decision is not final yet, but I think we'll release a php5 strict version of xajax 0.5 soon after 0.5 is finally stable, perhaps xajax 0.5.5...

Re: Xajax 0.6 - the next level

Is there a snapshot available ?

Re: Xajax 0.6 - the next level

There is no snapshot. I don't want to maintain 2 versions atm...

Re: Xajax 0.6 - the next level

You don't use svn then ?  It was merely to get an impression of... 
Is there any prediction to make for an --estimated-- release week ... Or just when it ready...
It would be a bit of a pity to base my whole new app on a framework which (maybe) completly reviewed...
Or are you trying to maintain the present api as much as possible..

Re: Xajax 0.6 - the next level

Hi everyone,

we made a good progress on 0.6 since the stable release of 0.5 and I want to give you a sneak preview about the new features and changes:

  • fully PHP5 strict valid

  • JSON response support (you can set the preferred response type by ->configure('responseType','JSON') or XML );

  • improved xajax.getFormValues (the function doesn't parse childNodes of selects anymore)

  • faster argument processing (the xajaxArgumentManager class now uses simpleXML)

  • the xajaxResponse class now merges subsequent script and append calls automatically to reduce the processing/transport overhead

  • unit testing framework

  • CSRF (Cross-site request forgery) protection

  • backwards compatible (easy migration from 0.5)

  • removed all legacy / deprecated functions

All changes are available in our SVN trunk on SourceForge. We are also going to release a preview release (alpha) soon. If you are already using the latest syntax (configure instead of setFlag, xajax.request() instead of xajax.call,...) you should be able to migrate to 0.6 by just replacing your old xajax 0.5 install.

If you have any additional wishes or suggestions let us know before it's too late!

Re: Xajax 0.6 - the next level

Can't wait for .6 to come out!

Any progress already on the .5.5 version? I just upgraded again in my framework, but I will change it back again, too many PHP5 warnings wink

Re: Xajax 0.6 - the next level

We'll skip 0.5.5 and start directly with 0.6. The current progress is really good and we're getting close to a preview version, perhaps even beta by the end of this month.

Re: Xajax 0.6 - the next level

q_no wrote:

We'll skip 0.5.5 and start directly with 0.6. The current progress is really good and we're getting close to a preview version, perhaps even beta by the end of this month.

Good enough for me hehe.

Say so you guys use some sort of profiler? I was just tinkering with my framework, but I noticed that the xajax library is by far the most intensive to load. But I haven't thoroughly checked it yet.

Re: Xajax 0.6 - the next level

I think many advanced features can be done ilke:

1 - Call a responde on MVC architeture, example:  http://site.com/login/  or http://site.com/user/new

     onclick='xajax_call( "http://site.com/user/new", xajax.getformValues("form", true) );'

2 - Define xajax functions from static functions from classes, example:
   
     class User {
           
             public static function register($data) {
                    ....
             }

     }

$Ajax->register(XAJAX_FUNCTION, User->register);

Re: Xajax 0.6 - the next level

i played with the last trunk version of xajax and i am impressed.
The debug to DomElement is really awesome.

greetz

sin

Re: Xajax 0.6 - the next level

hi... it's been some time now wink any ideas on when is 0.6 going to be available? I really love this framework. Thanks.

Using xajax 0.5

Re: Xajax 0.6 - the next level

I made some changes to the core on the XAJAX_CALLABLE_OBJECT part.
Now it is not necassary to pass an object instance. Just a string from the wanted classname is enough.

Beacuse i inherit quit a few classes, the changes gave a significant improvement in speed.