Brainstorming

886 views
Skip to first unread message

Massimo Di Pierro

unread,
Jun 15, 2014, 4:34:25 AM6/15/14
to web...@googlegroups.com
Often Angular comes up on this list. I tried it and I was un-impressed. 
Instead today my favorite client-side stack is based on these:

- jquery.js
- sugar.js
- ractive.js
- semantic-ui (css & js)

Have you tried sugar, ractive, and semantic-ui? What is your opinion?

Massimo




Niphlod

unread,
Jun 15, 2014, 9:39:21 AM6/15/14
to web...@googlegroups.com
I was sincerely impressed with how many things you can do with Angular, but the learning curve is too steep.
Then I tried knockout...much better in terms of learning curve, and its methods to map json objects (resultsets) with view-models couples nicely with web2py.....but the templating lacks too much and is a tad bit verbose.
Then I tried ractive, and I had a serious headache to figure out how to do "basic tasks" : to be fair, I asked a question on their google-group and got an answer pretty soon: unfortunately the solution was there but the docs weren't updated yet (that's why I had a hard time with it).
It seems that the ractive "concept" is closer to my mindset, i.e. it's the tool I'd use to solve "problems" I can't solve with web2py alone, so it "adds" a good value given the effort spent.
That being said, there's a whole new concept to adapt to with all of them: your project starts to be python + html and then is python+html+js, with matters like "how do I organize js code within my app", "let's use requirejs" and so on...it's not that easy to adapt if you're coming from python web frameworks.

Anthony

unread,
Jun 15, 2014, 12:19:49 PM6/15/14
to web...@googlegroups.com
Have you tried React.js (from Facebook). I haven't tried it but have read good things. Supposedly somewhat similar to Ractive. Also seems to be more active (Ractive has had no commits for a month and seems to have limited user group activity).

Anthony

António Ramos

unread,
Jun 15, 2014, 2:21:28 PM6/15/14
to web...@googlegroups.com

If you check the popularity of angular ractive react etc at github you have a winner:
ANGULAR!!
Big community, videos ,books etc
And
JOBS!!

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

Michele Comitini

unread,
Jun 15, 2014, 3:07:47 PM6/15/14
to web...@googlegroups.com
ractive.js author's ideas about the philosophy of the framework and more, are nicely writte in a blog.
Many interesting points that were brought up here are discussed in depth there.

http://blog.ractivejs.org/


mic


samuel bonill

unread,
Jun 15, 2014, 8:59:43 PM6/15/14
to web...@googlegroups.com
Angular is very easy to learn...

#1 http://campus.codeschool.com/courses/shaping-up-with-angular-js/intro

#2 www.ng-book.com

Massimo Di Pierro

unread,
Jun 15, 2014, 11:31:16 PM6/15/14
to web...@googlegroups.com
I have used Angular for a project and it was a nightmare. I soon moved to ractive and did not regret it. Angular forces a scope and, for example, promises can only live within the scope. That means you cannot use Angular promises in your own library unless you put all the code in the scope. I constantly found myself fighting the constraints imposed by angular. 

António Ramos

unread,
Jun 16, 2014, 3:00:16 AM6/16/14
to web...@googlegroups.com
Massimo, can you post a ractive example where you had problems doing it with angular?

Whe should go to examples to understand this angular/ractive issue better




JorgeH

unread,
Jun 16, 2014, 9:49:48 AM6/16/14
to web...@googlegroups.com
I have tried both Angular and Ractive.

I choose Ractive every time.

Derek

unread,
Jun 16, 2014, 2:25:17 PM6/16/14
to web...@googlegroups.com
I prefer jqote2 and jquery pesonally. It's one of the fastest out there and the templates are pretty simple yet flexible.

chuan137

unread,
Jun 16, 2014, 5:24:18 PM6/16/14
to web...@googlegroups.com
Noelse mentioned Backbonejs yet? working on a project with it now, but do not care for it too much, I am thinking of switching to AngularJS actually.


On Sunday, June 15, 2014 10:34:25 AM UTC+2, Massimo Di Pierro wrote:

eric cuver

unread,
Jun 16, 2014, 7:30:16 PM6/16/14
to web...@googlegroups.com
we can be used web2py with ractive ?

Andrew W

unread,
Jun 17, 2014, 2:48:03 AM6/17/14
to web...@googlegroups.com
I want to use the template capabilities of web2py for server side script generation, not just html.   From my brief look at the ractive website I'm wondering if it is any better than what web2py does now.  Do I really want a js library for this for server side templating.  I could use node but I can't see a reason to change.

Massimo, are you thinking of changing the templating approach ?

Paolo Valleri

unread,
Jun 17, 2014, 8:14:12 AM6/17/14
to web...@googlegroups.com
Just to name an other one, I've used backbonejs for a project, it was the right choice for my purposes. it is very easy to develop a client side app if you have a rest back-end.

Paolo

samuel bonill

unread,
Jun 17, 2014, 8:36:30 AM6/17/14
to web...@googlegroups.com
Paolo, really backbonejs is very complex, the best solution is backbone-marionettejs

http://marionettejs.com


--
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 a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/LCXnVnIeLl4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.

Niphlod

unread,
Jun 17, 2014, 9:53:38 AM6/17/14
to web...@googlegroups.com
@backboners: declaring models twice is not something I'd do for living ;-D

samuel bonill

unread,
Jun 17, 2014, 10:10:22 AM6/17/14
to web...@googlegroups.com
Niphlod, for that reason I just use Angularjs...


2014-06-17 8:53 GMT-05:00 Niphlod <nip...@gmail.com>:
@backboners: declaring models twice is not something I'd do for living ;-D

--

pbreit

unread,
Jun 18, 2014, 2:39:46 AM6/18/14
to web...@googlegroups.com
I have trouble with Angular. I'm sure it's mainly because I'm a newbie but I don't understand why it needs to be so complicated. I think this is partly behind my wondering is Massimo had ever considered a JavaScript framework. A web2py of JavaScript frameworks might be really interesting. It does seem like that's the direction we're headed. With a simple REST server.

Massimo Di Pierro

unread,
Jun 19, 2014, 6:41:31 PM6/19/14
to web...@googlegroups.com
In this thread there are lots of references to various libraries but they are not all the same and serve different purposes.

I like sugar.js and ractive.js

sugar.js is similar to underscore.js+moments.js and it extends basic objects like Date, Array, and String so that they have more methods.

ractive.js is a reactive template language. That means you do not decide when to render the template (as in typical jQuery templates or web2py templates) but when data changes (clientside data in js), the page is automatically updated. This is an example http://learn.ractivejs.org/two-way-binding/1/ [click on "fix code" to see it working.

ractive has lots of overlap with angular but angular constraints you a lot because of the concept of scope and requires that you follow lots of conventions. For example angular Promises leave inside the scope and the scope to a controller which, in their jargon, is a piece of a web page. What if you need Promises in function defined outside the scope because they are shared across controllers? Moreover the complexity of the syntax for defining controller grows in complexity as soon as you try do something non-trivial. I find ractive to be more intuitive. I am tempted to say Angular is to Django as Ractive is to web2py.

Massimo

samuel bonill

unread,
Jun 19, 2014, 8:07:30 PM6/19/14
to web...@googlegroups.com
Massimo, in angularjs, if you want use Promises in all the application scope, you need Factory o services, example :

var module = angular.module('myapp', []);
 
module.service('userService', function(){
    this.api = $http.get('http://example.com/blog/default/index/blog.json');
});

// controller #1
module.controller('FooController', function($scope, userService){
  $scope.data = userService.api.success(function(data) .etc.. );
  
});

// controller #2
module.controller('BarController', function($scope, userService){
   $scope.my_scope = userService.api.success(function(data) .etc.. );
});


link: http://viralpatel.net/blogs/angularjs-service-factory-tutorial/


and data binding it's very easy... example :

  <input type="text" ng-model="yourName" placeholder="Enter a name here">
   <h1>Hello {{yourName}}!</h1>

https://angularjs.org/




JorgeH

unread,
Jun 19, 2014, 10:41:02 PM6/19/14
to web...@googlegroups.com

"I am tempted to say Angular is to Django as Ractive is to web2py."
On Thursday, June 19, 2014 5:41:31 PM UTC-5, Massimo Di Pierro wrote:

Good way to put it!

Besides, angular has routing and other functioinalities that web2py already has.  It doesn't make much sense having to learn and adhere to several conventions and conditions.

Massimo Di Pierro

unread,
Jun 19, 2014, 11:17:37 PM6/19/14
to web...@googlegroups.com
In ractive there is nothing equivalent to this;

module.controller('FooController'function($scope, userService){
  $scope.data = userService.api.success(function(data) .etc.. );   
});

You do not have to bind a controller to a scope. You can still do this:

<input type="text" value="{{yourName}}" placeholder="Enter a name here">
   <h1>Hello {{yourName}}!</h1>
Notice no ng-modal, simply {{yourName}}. 
To unsubscribe from this group and all its topics, send an email to web2py+unsubscribe@googlegroups.com.

samuel bonill

unread,
Jun 20, 2014, 11:46:30 AM6/20/14
to web...@googlegroups.com
angular has routing and other functioinalities that web2py already has.


Angular was created for implement client side apps, based in RESTful APi, like mobile apps with ng-cordova or interactive desktop application.

I develop RESTful API in web2py, and the client with NodeJs + angular for desktop app, and client mobile with phonegap + ng-cordova

web2py create the http resources and angular just use the resources and play with them

Please excuse my poor English !! :)

Phyo Arkar

unread,
Jun 20, 2014, 2:14:30 PM6/20/14
to web2py
For UI i recommend Qooxdoo.

Qooxdoo make us no need to write HTML and CSS , for 3 years already . We even forget what HTML and CSS looks like
its javascript is so clean and truly object oriented . UI Widgets are professionally designed , we don't even need a  graphic designer in our team.
Integration with web2py is very easy too , but we write whole view logic in qooxdoo and server side data by doing ajax request, to JsonRPC.

It is complete, we only need specialized JSLibs like D3 and JQPlot , all other needs are provided by qooxdoo (From UI to AJAX LongPoll , JsonRPC, Databinding).


--
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+un...@googlegroups.com.

Michele Comitini

unread,
Jun 20, 2014, 5:02:06 PM6/20/14
to web...@googlegroups.com
I share Massimo opinion about ractive.js: simple and effective.  The author goal is not having a bloat of features, but rather having a foundation that helps developers, with few clear, but powerful enough concepts, translated in a small framework.

Besides personal preferences, it's clear to me, that the problem here is not web2py including or not a specific client side tool.  Great confusion arises and consequently many different approaches, frameworks, tools and so on. IMHO thas is because of client side (browser) approach to UX:  js + html could be not the best way to create a UX.  Most if not all of the js frameworks around today, are a response to that problem.  My POV is that web2py should have a rather agnostic attitude toward a wide range of frameworks, by having some kind of layer that would allow to keep server side code mostly untouched when changing js framework, easily add support for a new js framework.
In practice web2py should use a well defined protocol between client and server, to pass actions, messages and events back and forth.

In any case, following the "battery included" paradigm of web2py, we must choose a default js framework to start with.

Phyo Arkar

unread,
Jun 20, 2014, 5:26:44 PM6/20/14
to web2py

On Sat, Jun 21, 2014 at 3:31 AM, Michele Comitini <michele....@gmail.com> wrote:
My POV is that web2py should have a rather agnostic attitude toward a wide range of frameworks, by having some kind of layer that would allow to keep server side code mostly untouched when changing js framework, easily add support for a new js framework.
In practice web2py should use a well defined protocol between client and server, to pass actions, messages and events back and forth.

>My POV is that web2py should have a rather agnostic attitude toward a wide range of frameworks, by having some kind of layer that would allow to keep server side code mostly untouched when changing js >framework, easily add support for a new js framework.
>In practice web2py should use a well defined protocol between client and server, to pass actions, messages and events back and forth.


+ 100!

Exactly my toughts too.

Massimo Di Pierro

unread,
Jun 21, 2014, 5:33:04 AM6/21/14
to web...@googlegroups.com
web2py is mostly serverside and that is not going to change. I think what we are discussing is the future...

In the future I envision a new framework that has more client-side logic. In order to do that we have make some choices of client-side frameworks. I also agree that communication between client and server needs to rely on standards. One possible standard are using hypermedia API for self documenting json services. Yet I find it to be insufficient. I am spending lot of time thinking about a generic way for client and server to communicate. The problem is that they need to communicate more than data, but also templates, and workflow information.

Limedrop

unread,
Jun 22, 2014, 5:09:29 PM6/22/14
to web...@googlegroups.com
Have you looked at breezejs? A "JavaScript library that helps you manage data in rich client applications".

Breeze dynamically builds a mirror of the server-side db model on the client and then binds to UI controls so the UI updates when the data model changes. Each object knows when it has changed and what has changed. Essentially it builds a client-side cache of the db.

On the surface it's focused on .NET (with it's own .NET components), but if you look underneath you see that web2py could easily provide the back-end.

Nice overview here:
http://www.breezejs.com/documentation/introduction

MIT license.

Mirek Zvolský

unread,
Jul 3, 2014, 4:46:06 AM7/3/14
to
Here is a project which lists and compares a little javascript frameworks:

Ramos

unread,
May 6, 2015, 7:45:53 AM5/6/15
to web...@googlegroups.com
There is a new kid on the block

Reactjs

Any experiment with it and web2py ?
Seems a lot less complex than angularjs

Regards

Richard Vézina

unread,
May 6, 2015, 10:38:39 AM5/6/15
to web2py-users
I think it will be difficult to make everyone happy with a given choice...

Michele "agnostic" point is good even if in pratice it may be difficult (let say BS2 for instance we were maried with it until recently)

Ractive.js as Massimo imaged is Ractive.js is to Angular.js what web2py is to Django

The main issue with Ractive.js is it documentation which is not to bad actually but difficult to apprend, but it lacks of concreate examples...

The user base seem limited and the project don't seem to be really active...

I would have a welcome based on W3 repo that Massimo publish on github showing how to properly integrate with Ractive.js

How to structure correctly the code remain to me a challenge

Richard

António Ramos

unread,
May 6, 2015, 11:02:36 AM5/6/15
to web...@googlegroups.com
I didnt say Ractive.js

I wrote

React.JS

Ron Chatterjee

unread,
May 6, 2015, 11:09:11 AM5/6/15
to web...@googlegroups.com
I don't shy away admitting I don't know much about javascript. Believe it or not, I used Dreamweaver and other adobe creative cloud products like edge reflow and was able to integrate them into web2py seamlessly without having to do anything with javascript. I copied the javascript, css and html out of those tools and put them in the static library like I do with bootstrap and include them in the layout. Not sure if I am assisting the discussion here but thought may be I can pitch in and share my 2 cents:-)

-Ron

António Ramos

unread,
May 6, 2015, 11:16:58 AM5/6/15
to web...@googlegroups.com
We are talking about integrating web2py with javascript ui frameworks


2015-05-06 16:09 GMT+01:00 Ron Chatterjee <achatte...@gmail.com>:
What is this post is all about regarding web2py? Just went over my head! 

Ron Chatterjee

unread,
May 6, 2015, 11:23:22 AM5/6/15
to web...@googlegroups.com
That will be a cool concept unless I have to write javascript. 

Michele Comitini

unread,
May 6, 2015, 12:06:38 PM5/6/15
to web...@googlegroups.com
IMHO ReactJS is no newer than Ractive.js.  It's being backed by facebook since a while ago.  I like the author's philosophy (read independence ) and design simplicity of Ractive.js, things that I appreciate even more in web2py, but that's a matter of personal taste :-)

2015-05-06 17:23 GMT+02:00 Ron Chatterjee <achatte...@gmail.com>:
That will be a cool concept!:-). I would love to see its done.

JorgeH

unread,
May 6, 2015, 12:43:03 PM5/6/15
to web...@googlegroups.com
React.js is not that new.

They are pretty similar.

Here is an article from May 6th 2014. Exactly 365 days ago.

http://blog.ractivejs.org/posts/whats-the-difference-between-react-and-ractive/

Massimo is already implementing ractive.js into web2py with impressive accomplishes.


http://www.ractivejs.org/

Ron Chatterjee

unread,
May 6, 2015, 12:58:12 PM5/6/15
to web...@googlegroups.com
Can we take a sneak peak at that, whats upcoming?:-)

Richard Vézina

unread,
May 6, 2015, 1:07:52 PM5/6/15
to web2py-users
@Ron, we are talking!!

:)

Richard

Ron Chatterjee

unread,
May 6, 2015, 1:11:00 PM5/6/15
to web...@googlegroups.com
I thought there is an example to share. Sorry.

Richard Vézina

unread,
May 6, 2015, 1:20:17 PM5/6/15
to web2py-users
https://github.com/mdipierro/w3

This is Massimo's example of Ractive.js integration into web2py workflow

Richard

Ron Chatterjee

unread,
May 6, 2015, 1:29:20 PM5/6/15
to web...@googlegroups.com
Thanks. Looks like lot of Json format data. Reminds me of mongodb.
Reply all
Reply to author
Forward
0 new messages