tw2 - future directions

27 views
Skip to first unread message

Paul Johnston

unread,
Jul 1, 2011, 8:39:22 AM7/1/11
to ToscaWidgets-discuss
Hi,

I've just jotted down some of my ideas for tw2 future directions. I
think a lot of these will be interesting to developers on the list.
I'd encourage anyone interested to pick an item they like and do some
work on it.

So, here are my ideas:

Core
----

Client-side validation
I'd like to include simple client-side validation in the core. A
good start would just be checking required fields on form submit. More
advanced validation (e.g. checking user name availability via Ajax)
may require a JS framework.

Google App Engine support
I haven't used GAE myself, but I don't expect this to be
especially difficult. There is no pkg_resources, so template.py needs
a fallback to an alternative mechanism.

Controller widgets refactor
We need to provide a higher-level interface than just "get
request, return response". Need to provide flexible authorization
hooks, and CSRF protection. Also need to remove some of the hackery
around Page widgets.

Pseudo-children refactor
Some widgets have "pseudo-children" e.g. a Form widget has a
submit widget, which is kind-of a child. The framework should provide
more support for this, and we need to get rid of reserved_names which
is very hacky.

Resources refactor
The most pressing need is a resource collator and optimiser. Also
need to preserve order of resources, and it would be nice to avoid
needing "modname=__name__" by inspecting the call stack.

Deferred refactor
Deferred parameters don't get passed any state. If there was some
mechanism to do this, you could do more in deferreds, avoiding the
need to override prepare() in some cases.

tw2.forms
Don't see much value in keeping tw2.forms as a separate package.
Considering moving it into core, but keeping the namespace as
tw2.forms.


Database support
----------------

tw2.sqla - Automatic forms
We'd like an automatic forms system, somewhat like Rum and Sprox.
This is nearly working already and just needs some polish and
documentation to finish it.

tw2.sqla - Automatic model
An alternative approach is to automatically general an SQLAlchemy
model from widget definitions. I've not seen this done before, but it
would suit some use cases very nicely. It's also more similar to the
approach you'd be likely to take with a NoSQL solution.

NoSQL
Some kind of support for Couch/Mongo or similar would be great.


JS Frameworks
-------------

tw2.dynforms
Growing, Hiding and Cascading are useful features. But there's a
lot of JavaScript here, and it's not as widely tested on different
browsers as a proper JS framework. It may well be better to implement
these features using a JS framework, and retire dynforms.

Official framework
I think we should pick a favored tw2 JS framework, and the most
likely candidate is JQuery. We'd use this in the widget browser, make
sure tw2.sqla works seamlessly with it, etc.

tw2.yui
I think this is a great example of what's good about tw2 and we
should push it more. Some more widgets would be good; also YUI 3
support.

tw2.jquery
I'd like to provide common requirements as easy-to-use widgets,
somewhat like I have done in tw2.yui. The main ones would be in the
base package, so you don't need to install lots of tw2.jqplugins.*
packages. Key features would include:
Auto complete
Date picker
HTML editor
Tabs
Expand / collapse
Growing
Hiding
Cascading
Sortable / draggable
Data grid

Popup dialog
When you have a DataGrid (as we have with both JQuery and YUI now)
it would be nice to click "edit" and have an inline dialog popup to
edit the record and save it.

Better Ajax support
Some of the more advanced things I've done with tw2.yui show the
need for even more ajax support in the framework. Generation of JSON
based on a widget schema (e.g. for tw2.yui.DataTable); ajax form
submission with validation; control of JS events from the server.


Bluesky
-------

Mobile support
Create a set of widgets that work well on touchscreen smartphones.

Comet
Support for server-side push aka Comet.

GUI builder
Graphic builder, a bit like Visual Basic.

Thomas G. Willis

unread,
Jul 1, 2011, 9:43:03 AM7/1/11
to toscawidge...@googlegroups.com
What would be considered show stoppers for an official release of tw2? 

My personal feeling is that the validation is a tad flakey at the moment.  I think it needs to be at least as powerful as formencode, 

Also, getting at child error messages requires knowing a bit too much about the implementation details. 

Another thing is making it really easy for a user to unit test their widget, right now a lot of hand holding has to be done with managing globals and the middleware. it would be nice if you could call display or validate and do asserts on the results without having all that machinery in the way. 

Docs, it's always the docs. I think they are adequate for someone who is familiar with tw already, but a lot of details are glossed over. One approach i was thinking of was starting at ground zero and building on top of that for the various features.

a: widget with params, how they are passed to the template etc....
b: adding resources
c: interacting with javascript
d: form building
e: validation

if those get adequate docs where the language makes no assumptions about the readers familiarity other than they know python, and they know web applications, it would be awesome




These 3 things I would consider core, and all the libs can leverage that

merely my .02 :)


Reply all
Reply to author
Forward
0 new messages