Hi p a,

What you have described is basically where I am at. I have a large 
multi-page app. My plan is to start as you did and "component-ize" it and 
convert the bulk of the views to components I can then load with ajax. To 
convert it to a full-fledged SPA, I'd then start using ractive to move the 
view logic to the client side. I guess at this point, I'm trying to decide 
if going that further step is really worth it. (Besides the value of 
learning how to do it. That's always something I can do in another 
project). Ember, angular and backbone all seems to be overkill and involve 
a steep learning curve.  That's why I was attracted to ractive--it's easy 
to learn. But even then, I am not sure how much is gained. As Niphold likes 
to point out, if it is about efficiency, the bottlneck in my app is db 
access and not generation of the views--that won't change no matter how 
much the view logic is pushed client side.

So let me ask, was the conversion to a client side SPA worth it? Also, can 
I use just ractive and let web2py do the routing and some of the templating 
(I guess that sort of how Massimo did it in the estore project)? 

Thanks for the help!!

Rod

P.S. Thanks Niphold, crossroads.js looks simple enough. If I go the whole 
SPA route, I'll likely either use that or pages.js.



On Tuesday, October 20, 2015 at 2:44:26 PM UTC-7, p a wrote:
>
> A few months ago I decided to turn my existing, rather big and complex 
> multi-page web2py app into a single page app. The plan is to load all the 
> existing pages using web2py_component into the div#main_region, so that I 
> get a working application as soon as possible, but then start to move view 
> logic to the client, eventually calling web2py only for json data, and 
> building the client pages using some kind of library of framework.
>
> I was already using jquery and bootstrap a lot (plus handsontable, 
> ckeditor, jqplot...), so I had to use a library/framework compatible with 
> that, and I didn't even consider angular and ember, since they seem to have 
> their own way for doing everything.
>
> I did consider backbone+marionette, but I felt I was back to the Java 
> days, writing a lot of code and getting nothing in return. I also felt like 
> I had to duplicate work that was already done in web2py. Ractive definitely 
> seems a better match fo web2py+jquery, to my limited experience, if you 
> find a good way to organize your code.
>
> I found the following tutorial extremely helpful (it has 6 parts, I 
> recommend you read at least the first 4 parts):
>
> http://paquitosoftware.com/ractive-js-tutorial-setting-up-your-environment/
>
> It shows how to use ractive, webpack, page.js for routing, and proposes a 
> nice folder structure for your code. It also shows you how to take 
> advantage of webpack to compile ES6 into javascript real time, and you 
> could use a similar trick for coffescript or something you like better than 
> plain old javascript.
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to