[Framework-Team] Re: PLIP #215: Include new KSS versions

Balazs Ree ree at ree.hu
Wed Jan 30 19:20:15 UTC 2008



Finally... (drum roll):

https://svn.plone.org/svn/plone/review/plip215-new-kss-version


Changed packages:

kss.core, now points to the 1.4 prerelease branch.

kss.demo, Products.Zelenium: these are only needed for testing. Not 
needed for production.

Products.CMFPlone: this only changed to contain the base2 javascript 
resource in the GS. I have not added a migration profile, so please 
create a new portal. (If you run it on an old portal, it will run the 
same with the original cssQuery, slower.)



The changes are in kss.core changelog, but I try to summarize the most 
important ones:



- Major code refactoring, for better readibility and speedups.


- Lots and lots of ecma unittests and selenium tests that test kss.core 
  and the core plugin, are added. All are checkable from a single click 
  from any browser.


- Base2 is used for css selection, instead of the original cssQuery (if 
present). Significantly faster page load.


- multiple selectors in the same rule are allowed, ie.:
      selector1:click selector2:click { ... } , or even:
      selector1:keyup selector2:keydown { ... }


- Value providers can be recursive, ie. 
      nodeAttr(kssAttr(blah)) is allowed.


- added url() special value provider, the first is alternate syntax for:
      action-server: blah;
      blah-kssUrl: "http://foo.bar/blahblah";
  you can now say in one line:
      action-server: blah url(http://foo.bar/blahblah)
  This may be handy if you want to call @@ url-s.

      
- added alias() special value provider, this enables using more client 
  actions on the same node:
      action-client: setAttribute;
      setAttribute-key: foo;
      setAttribute-value: bar;
      action-client: setAttribute alias(other);
      other-key: foo2;
      other-value: bar2; 


- enable node selection in the same line as the action specification, ie. 
  instead of
      action-client: foo;
      foo-kssSelector: css(div.klass);
  you can also say:
      action-client: foo css(div.klass);


- enable full form submits in the same line as the action specification, 
  ie. instead of
      action-server: foo;
      foo-kssSubmitForm: currentForm();
  you can also say:
      action-server: foo currentForm();


- Value providers can be used also in the "event binder id", eg.
  instead of the static binder id: 
      xxxxx:click(blah) { ... } 
  a dynamic binder id can also be used:
      xxxxx:click(kssAttr(blah)) { ... } 
  This feature is needed for upcoming use cases like drag and drop. We  
  don't use this in Plone yet.


- Remove previously deprecated form() and
  currentForm() value providers from normal
  action parameters (remark: they should now
  be used with xxx-kssSelector or directly on the action-client line as 
  described above, and they properly support Zope multiform
  fields like :list, :record, :records.)


- Demos and selenium tests are removed from kss.demo and are now placed 
  together with the plugin in kss.core. This means, all 3rdparty plugins
  should now have a zope-only demo page with a selenium test, if the 
  plugin is loaded the demo appears in the index and the test is run 
  together with all tests. (Demos can be viewed and tested by kss.demo.) 
  We also have kss.template that creates a skeleton kss plugin with
  all bells and whistles.


- Implement loglevels based on cookies (also backported to 3.0.)


- Other fixes (also backported to 3.0):
   - Fix error fallback handling
   - Fix multiple selection form fields marshalling on Safari and IE




That's basically all.

Everything in Plone should run the same.

Some explanation on running demos and selenium tests:

Demos serve to test certain features and can be used as a starting point.
They also enable automated testing if these features work.

To use them you must create in the Zope root:
- a KssDemo SimpleContent object with the id "demo"
- a Zuite object with the id "zuite".

The first one is a bit funky, due to a CMF issue. The KssDemo 
SimpleContent object can only be created inside a Plone portal. Then you 
must cut-and-paste it out to the Zope root.

If this is done, visit the "demo" object. The demo index page appears. 
Visit the demo you like, _OR_ go to Run all Selenium tests. The 
testrunner appears, press on the "play" button, this will run all tests 
and you should get GREEN in every line.

This is currently Zope-level tests, but in a similar way, we will soon be 
able to test all the AJAX in Plone, kss and non kss alike.

Good luck for testing.


-- 
Balazs Ree





More information about the Framework-Team mailing list