The first thing I am going to tackle, is Require.js

I love the idea of compartmentalizing different views/viewModels into 
separate files, organised in role-oriented directorates.
We 2py already does that, as part of the MVC-RoR-like 
:convention-over-configuration' approach. Durandal (and Ember) aim for the 
same thing, generally, each implementing a "modules" mechanism for loading 
partial-templates and javascript-files.

The first question I have to ask, is wethere or not to re-use the existing 
we2py folder-structure for that, or have it all in sub-folders in the 
static folder.

I think it would be awesome if the existing folder-structure could be 
reused.
The views folder, already contains what would become the templates of the 
client-side SPA framework(s). There is only the issue of how to have the 
syntax not collide with web2py's template language(s).

I think there is still room for both to exist, though as serving different 
roles - i.e:
Web2py templating would/could be used for SEO-related stuff, and/or in 
combination of client-side templating, each fulfilling different roles.
For example, *static* data, can be done using web2py's templating (i.e: 
Titles of pages, injection of reusable components such as "Forms", etc.), 
while client-side templating would be reserved for *dynamic* content, bound 
to javascript-observable-objects.
But there could be dual-roles for the same data - like in the case of Forms:
There could still be usage of web2py-generated forms, but using a different 
sub-class of the regular one - that generates the same structure of Form 
tags, only each tag with additional properties for data-binding to a 
specific framework. The generated Form-object, would then be injected into 
the template in the usual web2py-templating-kind-of-way.

Javascript 'controllers', could just be located in the existing controllers 
folder.
Same for models. 
As for javascript 'modelViews', they can either be located in the 'views' 
folder (alongside their templates), or a new "viewModels" folder.
As for 'routs', there should probably be a special new folder for them.

This would be very convenient for development, and can be easily configured 
using requier.js, or any other framework's modules mechanism.

The only question is weather there is going to have to be changes to web2py 
to enable it to serve these javascript files from these locations...
I hope these wouldn't be a problem there...

If all fails, the static folder can always be falled-back to. 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to